Skip to content

log4j & jboss

August 3, 2007

To Use log4j.properties file in jboss for a given application.

Create your own scoped classloaders:

1. create jboss-web.xml
The log4j.war/WEB-INF/jboss-web.xml is:

<jboss-web>
<class-loading java2ClassLoadingCompliance=”false”>
<loader-repository>
log4j.test:loader=log4j.war <<YOUR OWN WAR FILE NAME OVER HERE…>>>
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>

</jboss-web>

2.copy log4j.jar in your lib
3. To use log

Rename the jboss<Server>>/conf/log4j.xml to conf/jboss-log4j.xml Change the ConfigurationURL? attribute of the Log4jService in the conf/jboss-service.xml to jboss-log4j.xml
You can refer to the site:
http://jacky640911.spaces.live.com/?_c11_BlogPart_FullView=1&_c11_BlogPart_BlogPart=blogview&_c=BlogPart&partqs=amonth%3D5%26ayear%3D2007

solve the classloader issue is by reverting the JBoss configuration to the old classloading model.
Edit the file <jboss>/server/default/jbossweb-tomcat55.sar/META-INF/jboss-service.xml
Change the following lines:
<attribute name=”Java2ClassLoadingCompliance”>true</attribute>
<attribute name=”UseJBossWebLoader”>true</attribute>

(both are default set to false in jboss-4.0.2).

http://www.jboss.org/community/wiki/ClassLoaderScopingProperties

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: