You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Christian Kaltepoth (JIRA)" <ji...@apache.org> on 2015/02/24 17:35:04 UTC

[jira] [Created] (DELTASPIKE-838) SchedulerExtension: Multiple Job-Classes found with name

Christian Kaltepoth created DELTASPIKE-838:
----------------------------------------------

             Summary: SchedulerExtension: Multiple Job-Classes found with name
                 Key: DELTASPIKE-838
                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-838
             Project: DeltaSpike
          Issue Type: Bug
          Components: Scheduler
    Affects Versions: 1.2.1
            Reporter: Christian Kaltepoth


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:

{code}
IllegalStateException: Multiple Job-Classes found with name MyBean
{code}

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?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)