This appears to be a bug in jboss 4.0.5 and 4.2.x series.
The only one solution (ugly solution) was to remove log4j.jar from you own classpath and to be dependant to jboss one.
I have been posted this problem many times without any answer from jboss guys.
I had followed the steps mentioned in
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoaderScoping and created my own log4j.xml for my application. But when during the JBOSS4.2.1GA server startup, when the war is deployed I get the following errror
Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: log4j.test:loader=SiebelUpload.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)
and my application log4j.xml settings does not apply :-(.
How should the above be resolved?