Jboss EAP 7.4 class loading isolation - jboss

We are deploying 3 war files in Jboss EAP 7.4. All 3 war files have a dependency on a module which contains spring, hibernate and lots of other jar files. Is there a way to have complete isolation between classloading of the war files as we think module classes are shared between wars and causing issue. Thanks

Modules are loaded in their own class loader which will be shared across all its dependents. If you need Spring to be in a unique class loader for each WAR your best options is to include Spring in each WAR.

Related

Updating my ear dependencies to match modules of new Wildfly version

We have an ear deployed in Wildfly. We are updating the version of Wildfly to the latest. Wildfly has lots of jars in its modules directory, for example, apache commons-collections. Some of these jars are also in our ear/lib. Do I have to change the versions of the jars in our ear to match the versions of the same jars in the Wildfly modules?
No you do not need to upgrade any dependencies you provide in your EAR. That said you should make sure you're not providing any Jakarta EE/Java EE dependencies that are provided by WildFly in your EAR.

Generate war or ear

I have a spring project include java project and a web project, and I don't know which packaging to generate EAR or WAR, this choice it depend on the application server or on the project?
EAR is used to package web projects together with enterprise java beans so they can be deployed as a single bundle.
Since you use Spring I assume you don't have EJBs in your project so you can package everything as a single war file containing the jar of you java beans project and the spring libraries (with all their dependencies) in its WEB-INF/lib folder.
Most (if not all) of the application servers which accept EAR files also accept standalone WAR files.

Autopatch with EAR applicaton on jboss

Has anyone deployed autopatch (the database upgrade tool) in an ear application (on jboss server). Autopatch supports war kind of applications out of the box but for ear kind of applications it would need some extensions.
Moreover I am unable to provide the .sql files inside the ejb jar inside the ear as the location to look for patches to autopatch. Jboss 5 uses VFS and hence there is no reliable way to know the full URL to the jars.
Thanks in advance.

How do I use a Portable CDI Extension in an EAR on JBoss AS7?

We have a web application WAR that includes portable CDI extensions (seam-spring-core, activity-cdi) as JARs in the WEB-INF/lib, which works as expected on JBoss AS7.1.1.
However, when we package the WAR in an EAR the service discovery mechanism seams to fail. The class loader does not find the respective resource files in META-INF/services any more.
We have tried to put the portable CDI extensions into (JBoss) modules, however this stops the CDI annotations from being processed. We have also tried to put the JARs inside the EAR's lib directory, with the same result.
Where is the right place for portable CDI extensions within an EAR? Should portable CDI extensions within the WAR work - as it does without the EAR? Is this a JBoss AS7.1.1 issue?
That should work (jars in ear's lib) do you have beans.xml in ear? It's possible it's needed to dice into the jars.

HSQL DB Conflicts with JBoss

I would like to use a custom version of the HSQL DB in an application that I am deploying in JBoss. However, JBoss already contains an HSQLDB.jar. The JBoss jar is being resolved by my application instead of the custom jar in my ear.
How can I use a different version of HSQL in my web application from the one that JBoss uses internally?
Can I remove the HSQLDB.jar included with JBoss without negatively impacting the Application Server?
The custom version it's just a newer version? If it's that the case than you can simply replace the jar in the Jboss lib folder. Jboss uses HSQLDB as far as I know for queue persistence.