I have a war that uses the errai-bus, which depends on guava 14.0.1. I'm deploying the app with Jboss, but when I do, Jboss is using its weld version of guava, which is guava r6 (very old). This causes horrible class loading issues and the errai-bus completely fails to work.
Even when I declare guava 14.0.1 as a top-level dependency in my pom, it still uses guava r6. How can I stop Jboss from loading the wrong guava version for my war?
I've tried to look up info about how to do this with the class loader files in Jboss AS 6, but I can't seem to find any documentation.
You can try add the following
jboss-classloading.xml
to yourWEB-INF
folder:In this case, put the war's classloader in the
mywar_domain
which is shared with all other applications that don't define their own domain. Also choose to look at all other classes exported by other applicationsimport-all
and to expose all our classes to other classesexport-all
.What you get when you deploy this file, is that the Web application classloader will act as top-level Classloader so there will be no conflict with the same classes in the server's library.
See also:
Anyway JBoss AS 6 is out of date, and have a lot of de bugs unresolved. You would have to see the possibility of using a newer version (Wildfly or JBoss EAP 6).