Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8355

classes in WEB-INF/beans.xml file cannot be found when the war file is inside an ear

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • 6.0.0.M4
    • Weld/CDI
    • None
    • Hide

      The problem can be reproduced with the attached Maven project, containing two Arquillian tests. Both tests shrinkwrap a very simple war file, that just contains one bean class that has the @Alternative annotation, and a beans.xml that activates the class as an alternative bean. One of the test creates and deploys the war file on its own, the other puts it inside an ear and deploys the ear file.

      Tests can be executed as follows:
      export JAVA_HOME=<path to your Java 1.6 JDK home>
      export JBOSS_HOME=<path to your JBoss AS 6.0 M4 server>
      mvn test

      I attached the log file of the server, that shows the correct deployment of the war file and the error that occurs when the ear is getting processed.

      Show
      The problem can be reproduced with the attached Maven project, containing two Arquillian tests. Both tests shrinkwrap a very simple war file, that just contains one bean class that has the @Alternative annotation, and a beans.xml that activates the class as an alternative bean. One of the test creates and deploys the war file on its own, the other puts it inside an ear and deploys the ear file. Tests can be executed as follows: export JAVA_HOME=<path to your Java 1.6 JDK home> export JBOSS_HOME=<path to your JBoss AS 6.0 M4 server> mvn test I attached the log file of the server, that shows the correct deployment of the war file and the error that occurs when the ear is getting processed.

      A beans.xml file referring to classes (e.g. alternatives or interceptors that need to be activated) cannot be processed when it is part of a war file that is packaged inside an ear file. The error that occurs:

      org.jboss.weld.xml.WeldXmlException: WELD-001206 Could not load class nl.meandi.examples.TestBean

      The error does not occur if the war file is deployed on its own.

            marius.bogoevici Marius Bogoevici (Inactive)
            marcelkolsteren_jira Marcel Kolsteren (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: