Question

Is it possible to use CDI 1.1 with JBoss 7.1.1?

I have a single test war and would like to deploy this war together with weld 2.0.
I disabled the automatically loading of the weld module with the jboss-deployment-structure File:

<jboss-deployment-structure>
    <deployment>
        <exclusions>
            <module name="org.jboss.weld.core" />
        </exclusions>
    </deployment>
</jboss-deployment-structure>

I also tried to add a extra slot in the jboss/module folder:

<jboss-deployment-structure>
  <deployment>
    <exclusions>
      <module name="org.jboss.weld.core" />
      <module name="org.jboss.weld.api" />
      <module name="org.jboss.weld.spi" />
    </exclusions>
    <dependencies>
      <module name="org.jboss.weld.core" slot="2.0" />
      <module name="org.jboss.weld.api" slot="2.0" />
      <module name="org.jboss.weld.spi" slot="2.0" />
    </dependencies>
  </deployment>
</jboss-deployment-structure>

The deployment failed in both cases because JBoss apparently needs weld for the deployment.

So is it possible to use CDI 1.1 with JBoss 7.1.1 and how?

Was it helpful?

Solution

No, it's not possible. You could try weld-servlet from 2.0 but it won't work with EJB and will get quite confused. The app server integration is different in weld 2.0, so it won't work with AS7.

OTHER TIPS

JBoss Weld community has an installation script to update JBoss AS Weld Subsystem to Weld 2.0; https://github.com/weld/as7-weld-subsystem . Wildfly is currently in Alpha4 so this may be a better option at this time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top