Changing the default class loading mechanism of JBoss 4.2.* and WebLogic

Application servers use different class loading/delegation mechanisms. Therefore, we should understand them when deploying enterprise applications. In most cases, we need to override the default class loading behavior of application servers.
Suppose your web application wants to load classes from its own class loader first without delegating to parent. Then the following simple configurations will help you to override default delegation pattern in BEA WebLogic (version 8.* or 10) and JBOSS 4.2.*.

In WebLogic:

Set <prefer-web-inf-classes> to true in WEB-INF/weblogic.xml of your war.

Read WebLogic Server application classloading for more information.

In JBoss:

Set java2ParentDelegation to false in WEB-INF/jboss-web.xml as follows.

<loader-repository>
org.test:loader=archive-name
<loader-repository-config>
java2ParentDelegation=false
</loader-repository-config>
</loader-repository>

For more information about JBoss class loading, have a look at JBoss classloading configuration guide

Comments

Maxence Button said…
Hi,

Using WebLogic 9 and above, you should avoid using the child-delegation class loading model. It's quite dangerous since it reverses the entire tree. It may lead to LinkageErrors.

You'd better use the FilteringClassLoader mechanism, as explained here :
http://m-button.blogspot.com/2008/08/how-to-use-weblogic-filteringclassloade.html

Regards,
Maxence.
Charitha said…
Thank you very much for the information Maxence.
Anonymous said…
Perfect!!You are a outstanding person!Have you ever wore chaussures puma,Here are the most popular puma CAT,Puma shoes store gives some preview of puma speed cat,and casual but no sweat puma basket.
http://blog.livedoor.jp/lljj332
http://shoes-puma.jugem.jp
http://poloshirts--myfashion.blogspot.com
http://blades.blogsome.com
http://gillettefusion.edublogs.org
Anonymous said…
Fantastic!God bless you!Meanwhile,you can visit my China Wholesale,we have the highest quality but the lowest price fashion products wholesale from China.Here are the most popular China Wholesale productsfor all of you.You can visit http://chinaclothes.net.Also the polo clothing is a great choice for you.
http://gilletterazor.blog126.fc2.com
http://poloclothing.blogsome.com
http://venuschinawholesale.easyjournal.com
http://pumaspeedcat.blogharbor.com

Popular posts from this blog

Working with HTTP multipart requests in soapUI

Common mistakes to avoid in WSO2 ESB - 1 - "org.apache.axis2.AxisFault: The system cannot infer the transport information from the URL"

How to deploy JSR181 annotated class in Apache Axis2