Using Seam in a single legacy WAR of an otherwise Weld-enabled EAR
Asked Answered
B

2

6

We are using Wildfly 8.2.0.Final, Maven 2.2.1, Seam 2.2.0.GA, and Weld 2.2.6.Final.

We have an EAR file with a legacy WAR, a new WAR, and a bunch of other modules. The legacy WAR relies on Seam, but the new WAR and the rest of the modules in the EAR rely on Weld.

Currently, only the legacy WAR is working because we have the Weld subsystem excluded in jboss-deployment-structure.xml until we can get Seam isolated to the legacy WAR somehow. We tried to remove Seam from the EAR and move it up as a dependency of the legacy WAR, but that didn't work. To work with EJBs, it seems like it needs to be a dependency of the EAR and defined as an ejbModule in the maven-ear-plugin configuration.

Any ideas about how we can set this up?

Bautram answered 14/5, 2015 at 21:13 Comment(0)
M
1

You could try this (all happens in jboss-deployment-structure.xml):

1) Enable Weld subsystem. Basically, remove it exclusion: it's an implicit dependency, so there is no need to depend on it explicitly in any module.

2) wars should always be treated as isolated, but to be really sure you could add this:

<subsystem xmlns="urn:jboss:domain:ee:1.0" >            
  <ear-subdeployments-isolated>true</ear-subdeployments-isolated>
</subsystem>

3) For legacy war sub-deployment provide an explicit exclusion for Weld.

4) For all other modules provide an explicit exclusion for Seam.*

I think you've already checked it but: Class Loading in WildFly


*Update on module exclusion:

If it still provided as a module of AS, you should find it it modules/, check its' module.xml for module-name and then use exclusion like:

<exclusions>
    <module name="module_name" />
</exclusions>

If you provide it in your legacy war WEB-INF/lib/, then nothing should be done I think. Or you could register it as a module manually and then exclude :)

Misbeliever answered 23/5, 2015 at 12:12 Comment(1)
How do I add an exclusion for seam to a sub-deployment in jboss-deployment-structure.xml?Bautram
G
1

Why not dividing into to seperate ears? After all you are using incompatible components in your war's. So one ear has exactly the same definitions as the other except from the war file. No need to dublicate any code.

Grannia answered 28/5, 2015 at 17:23 Comment(1)
They need to share session state and authentication data.Bautram

© 2022 - 2024 — McMap. All rights reserved.