-
1. Re: Failed to deploy smcfs.ear in JBoss AS
andey Apr 20, 2017 6:09 AM (in response to rahughos652)The Linkage error occurs when the same class is loaded from two different locations, sounds like a classloader hierarchy problem or you can say when included a library twice. For example:
LinkageError is what you'll get in a classic case where you have a class C loaded by more than one classloader and those classes are being used together in the same code (compared, cast, etc). It doesn't matter if it is the same Class name or even if it's loaded from the identical jar - a Class from one classloader is always treated as a different Class if loaded from another classloader
-
2. Re: Failed to deploy smcfs.ear in JBoss AS
rahughos652 Apr 20, 2017 9:55 AM (in response to andey)Hi Anup,
Thanks for reply. How to avoid linkage issue. Is it possible to activate only one classloader instead of multiple. Please advice.
best regards
Rahul Ghosh
-
3. Re: Failed to deploy smcfs.ear in JBoss AS
andey Apr 20, 2017 11:12 AM (in response to rahughos652)Hi Rahul,
By default the web application class loader works different from the Java2 delegation model: when a web application's needs a class first it will look in the local repositories (that is the classes and libraries in the wEB-INF/classes or WEB-INF/libs directories) instead of delegating. So, the configuration you're proposing will work without any problem.
But since both wars will contain the same class, have you considered packaging this class in a jar and place it in the jboss instance lib directory? This way you wouldn't need to include it in all the web applications you deploy in the instance.
Take a look at : JBoss Web - Class Loader HOW-TO http://docs.jboss.org/jbossweb/2.1.x/class-loader-howto.html
Also you can refer: Class Loading in AS7 - JBoss AS 7.1 - Project Documentation Editor