Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-2589

javax.enterprise.inject.scan.implicit breaks bean archive scanning within classpath entries in JARs

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Minor
    • 3.1.2.Final
    • 3.1.1.Final
    • Java SE Support
    • None

    Description

      I have a Weld SE application.
      I played with the need for having beans.xml files present as I read they are not necessary anymore since CDI 1.1.
      I also found that for Weld SE, beans.xml are still mandatory except if you set the system property javax.enterprise.inject.scan.implicit to true or the same property as container property like SeContainerInitializer.newInstance().addProperty("javax.enterprise.inject.scan.implicit", TRUE).initialize();.

      This works for normal usage.
      But if I enable in IntelliJ IDEA the "JAR manifest" command line shortener there is a problem.
      What this does is, it adds all libraries and also the project classes as Classpath manifest attribute to a dummy JAR and adds this dummy JAR to the classpath solely.

      This works fine if you do not enable javax.enterprise.inject.scan.implicit and have beans.xml files in your archives.

      But as soon as you enable javax.enterprise.inject.scan.implicit either way, you get

      java.lang.IllegalStateException: WELD-ENV-002009: Weld SE container cannot be initialized - no bean archives found
      	at org.jboss.weld.environment.se.Weld.createDeployment(Weld.java:984) ~[weld-se-core-3.1.1.Final.jar:3.1.1.Final]
      	at org.jboss.weld.environment.se.Weld.initialize(Weld.java:777) ~[weld-se-core-3.1.1.Final.jar:3.1.1.Final]
      	at org.jboss.weld.environment.se.Weld.initialize(Weld.java:176) ~[weld-se-core-3.1.1.Final.jar:3.1.1.Final]
      	at ...
      

      No matter whether there are beans.xml files or not.
      Even the archives that have explicit beans.xml files are suddenly not found anymore.
      Using the javax.enterprise.inject.scan.implicit mode without the JAR classpath commandline shortener works fine.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Vampire0 Björn Kautler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: