Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-13641

WFLYWELD0055: Could not index class [Someclass] from an external bean archive: vfs:/somepath/myear.ear/myejb-0.0.1.jar/META-INF/beans.xml

XMLWordPrintable

    • Hide

      1. Create an ear with a jar and a beans.xml with discovery mode annotated

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
       bean-discovery-mode="annotated" version="2.0">
      </beans>

      2. Deploy in a directory picked up by deployment scanner
      3. Create a war with a reference to the jar via jboss-deployment-structure.xml

      <?xml version="1.0"?>
      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <ear-subdeployments-isolated>false</ear-subdeployments-isolated>
      <deployment>
       <dependencies>
       <module name="deployment.myear.ear.myjar.jar"/>
       </dependencies>
      </deployment>
      </jboss-deployment-structure>

      4. Deploy the war separately outside the ear to a directory watched by deployment scanner
      5. See a warning for every class contained in the jar

      Tried to workaround the issue by generating a jandex index via maven plugin but this completely fails the deployment

      Show
      1. Create an ear with a jar and a beans.xml with discovery mode annotated <?xml version= "1.0" encoding= "UTF-8" ?> <beans xmlns= "http: //xmlns.jcp.org/xml/ns/javaee" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http: //xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd" bean-discovery-mode= "annotated" version= "2.0" > </beans> 2. Deploy in a directory picked up by deployment scanner 3. Create a war with a reference to the jar via jboss-deployment-structure.xml <?xml version= "1.0" ?> <jboss-deployment-structure xmlns= "urn:jboss:deployment-structure:1.2" xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" > <ear-subdeployments-isolated> false </ear-subdeployments-isolated> <deployment> <dependencies> <module name= "deployment.myear.ear.myjar.jar" /> </dependencies> </deployment> </jboss-deployment-structure> 4. Deploy the war separately outside the ear to a directory watched by deployment scanner 5. See a warning for every class contained in the jar Tried to workaround the issue by generating a jandex index via maven plugin but this completely fails the deployment

      When referencing a jar with CDI scan mode "annotaded" inside an ear from an external war via jboss-deployment-structure.xml a warning will be printed for every class:

      WFLYWELD0055: Could not index class [Someclass] from an external bean archive: vfs:/somepath/myear.ear/myejb-0.0.1.jar/META-INF/beans.xml

      Seems VFS cannot get hold of the classes.
      The warning is logged in ExternalBeanArchiveProcessor which catches an EOFException from the inputstream loading the class. (Line 284). Seems the input stream is not able to load a single byte from the class

              manovotn Matěj Novotný
              jens.viebig@vitec.com Jens Viebig (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: