Updating my ear dependencies to match modules of new Wildfly version - wildfly

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.

Related

Dynamic Web project in Eclipse Neon not including jars from Ear APP-INF/lib

I have a set of projects I am working on in eclipse. An ear with a number of jars in APP_INF/lib and several projects for the wars under the ear. They are all Dynamic web projects. In Kepler and Mars the jars in APP-INF/lib show up as a library in the war projects.
Now I am moving to Neon. I have pulled in the ear and one of the wars and the classes in the war won't compile because the jars from APP-INF/lib are not in the classpath of the war.
Did something change? Is there a settings change I need to make?
I even created a new dynamic web project. I added it the the ear as part of creation. But it too does not contain a library from the ear.
I am running the web app on JBOSS EAP 6.4
Neon.2 Release (4.6.2) Build id: 20161208-0600
I am not sure why it wasn't automatically included, but in the build path, I needed to add the Ear library.

How can I load Java EE application dependency from WildFly modules

I am migrating my JBoss from 4.0.5 to WildFly 9.0.2 release, and my application has some dependency from JRE/lib/rt.jar, but when I deploy that application on WildFly, application gives error like ClassNotFoundException. If I add rt.jar as dependency in lib directory then application works.
So does anyone knows how to overcome from this problem.
Eg.
javax.xml.parsers.SAXParser.class which is available in rt.jar.

Issue deploying EAR project from eclipse to EAP 6.2.0 using JBoss Tools Plugin

I have a maven EAR project, which contains a couple of WAR and JAR files. I'm using Spring STS IDE with JBoss Tools 1.6.0 (latest).
When I try to deploy my EAR to JBoss EAP 6.2.0 with JBoss Tools from STS i'm facing the following issues.
My Jars (external jars and project jar) are getting copied into WEB-INF/lib and EAR/lib, where i expected it to be only in EAR/lib.
EAR application.xml is not getting copied into EAR/META-INF/ folder
But when i use terminal to build my project and deploy EAR, i'm not experiencing these issue and JBoss starts without any problem
Here's its solved JBIDE-19047 The main issues are,
jars are getting copied into WEB-INF/lib due to skinnywar not supported by eclipse m2e-wtp plugin and this can be solved by adding <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> in war plugin configuration.
application.xml not getting copied into ear/META-INF/ folder, if you have any unresolved dependency in any of the pom then this would occur, so make sure all jar dependencies are available.

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.

EAR with EJB and WAR modules fails to deploy WAR dependencies

I have an EAR that has many EJB modules and one WAR. The WAR dependencies are not picked up. There are only 3 of the WAR dependencies that are not already included in the EAR. These are ones that break the deployment. The target web logic server starts in Eclipse but the app fails to publish. As a test, when I add the missing WAR dependencies to any of the EJB modules they are picked up.
The problem was with certain versions of the m2eclipse plugin from Sonatype.
Some versions of the plugin do not correctly propogate the dependencies for the web project (WAR).
The plugin that works is the one that is installed in version 3.6.2 of eclipse. The one in 3.6.0 doesn't work.
Once I woved to version 3.6.2 of eclipse the problem went away.
Granted the issue may also have been tied to the plugin verions PLUS the version of eclipse.
Here are the maven plugin and eclipse details:
Works:
m2eclipse - 0.12.1.20110112-1712 running in Eclipse Java EE IDE for Web Developers Helios Service Release 2 Build id: 20110218-0911
Doesn't work:
m2eclipse - 0.12.0.20101115-1102 running in Eclipse Java EE Version: 3.6.0 Build id: I20100608-0911