Reputation: 15
I have a maven war project I am deploying to JBoss AS7. In maven, I have a dependency that is omitted because it conflicts with another dependency.
I was able to run this project as a jar as a java app with a main. But when I convert to a war and run on JBoss it tries to load this conflicting dependency and its really old legacy dependencies (that require websphere runtimes). The classes in this dependency that require these offending dependencies are never actually used.
** Edit ** JBoss is not trying to unload load the omitted dependency. It is trying to load the dependency that is dependent upon the omitted library. But tries to load all the classes in the dependency but it depends on classes that are in the omitted library. Even though the classes that fail the class loading are never used at runtime.
How can I have this dependency's classes (or the entire war's classes) be loaded only when they are needed instead of when the server is initializing? Is it even possible?
Dependency Tree (Paraphrased...)
MyWar
/ \
ProprietaryJar_V2.0 AnotherProperietaryJar_V1.0
|
ProprietaryJar_V1.0 (omitted)
Upvotes: 0
Views: 110
Reputation: 1963
You have to exclude from AnotherProperietaryJar_V1.0 the dependency to ProprietaryJar_V1.0
Upvotes: 1