0
votes

I want to share a jar file for two war in the same instance.

For test, I make the jboss folder and war file like this.

1)JBoss Folder

server/default

-- deploy/

 -- myApp.war

-- lib/

 -- test_1.2.jar(only one method to output "1.2")

2)WAR

myApp.war

-- META-INF/

-- WEB-INF/

 -- class/

    -- myservlet(reference class test to output the version)

 -- lib/

    -- test_1.1.jar(only one method to output "1.1")

I hope the shared library could override the jar file in WAR,

but i still get the version "1.1".

it means that the jar file in WAR worked, but not the jar in the "server/default/lib".

1
I Know, I need to set <class-loading java2ClassLoadingCompliance="true"> to change the ClassLoader. - user2927622

1 Answers

0
votes

Have you considered packing both WARs into an EAR and moving to JAR to the lib/ folder in the EAR? This makes it portable and will also work on JBoss AS 7 and later.