Uploaded image for project: 'DeltaSpike'
  1. DeltaSpike
  2. DELTASPIKE-838

SchedulerExtension: Multiple Job-Classes found with name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.1
    • 1.3.0
    • Scheduler
    • None

    Description

      I just had a weird issue today. After adding a single @Scheduled to one of my beans, the application failed with this error during startup:

      IllegalStateException: Multiple Job-Classes found with name MyBean
      

      I debugged this a bit. It looks like Weld is sending multiple ProcessAnnotatedType events for the same type. I guess this is caused by the fact that the application I'm working on has two beans.xml files. One in src/main/resources/META-INF and one in src/main/webapp/WEB-INF. I know this setup is "not portable" according to the spec. However, the application is working absolutely fine. Just the SchedulerExtension fails.

      We could work around such issues simply by changing the type of the foundManagedJobClasses field from List to Set. I think this should be fine and prevents errors in such scenarios.

      Thoughts?

      Attachments

        Activity

          People

            chkal Christian Kaltepoth
            chkal Christian Kaltepoth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: