tag:blogger.com,1999:blog-30587633.post961658827782776693..comments2022-04-26T03:37:19.740+05:30Comments on My Wiki: How do i use my own log4j properties or xml file in JBossJaikiranhttp://www.blogger.com/profile/08503182723143814781noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-30587633.post-36545127239538660142011-08-18T21:00:25.855+05:302011-08-18T21:00:25.855+05:30This article was published a long time ago... but ...This article was published a long time ago... but still find it useful with jboss 5.1.XAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-30587633.post-86410603558385991692010-09-08T13:59:49.517+05:302010-09-08T13:59:49.517+05:30Hi I have followed the article very well, it seems...Hi I have followed the article very well, it seems to work fine on war and on ear, it classes which are in jars in that ear are not loaded, works only for war inside the same ear. <br /><br />I think classloader on ear is the problem. Can anyone help on how custom log4j.properties should be set in ear. <br /><br />I am using Jboss AS 5.1Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-30587633.post-15109096989068813222010-08-10T17:59:55.857+05:302010-08-10T17:59:55.857+05:30I am using JBoss 5.0.1 and I am not able to load t...I am using JBoss 5.0.1 and I am not able to load the log4j.properties file from my application. All the settings are correct and I am sure of this.<br /><br />Regarding the classload isolation, the following properties are defined in "war-deployers-jboss-beans.xml"<br /><br />false<br /><br />false<br /><br />javax.servlet,org.apache.commons.logging<br /><br />I tried removing "org.apache.commons.logging" from filteredPackages property, however, that didn't help as well.<br /><br />Any suggestions would be highly appreciated.<br /><br />Thanks in advance.karhttps://www.blogger.com/profile/01037195419626383573noreply@blogger.comtag:blogger.com,1999:blog-30587633.post-46260454527523652042008-10-16T10:07:00.000+05:302008-10-16T10:07:00.000+05:30After I amended log4j.properties file, I must rest...After I amended log4j.properties file, I must restart JBoss application to effective the setting. Am I right ?Unknownhttps://www.blogger.com/profile/13567454700936948491noreply@blogger.comtag:blogger.com,1999:blog-30587633.post-24069607768388892172008-09-05T10:12:00.000+05:302008-09-05T10:12:00.000+05:30Hi,I am following the same procedure as you said. ...Hi,<BR/><BR/>I am following the same procedure as you said. But still my appllication is unable to find log4j.prop file in classpath.<BR/>My EAR structure is as follows<BR/>.EAR <BR/>| <BR/>|-log4j.properties <BR/>|-log4j.jar <BR/>|-myCustomJars.jar(Contains my <BR/> utils)<BR/>|-myWar.war <BR/>|-myEjbClient.jar(Contains only <BR/> interfaces)<BR/>|-META-INF <BR/> |-jboss-web.xml <BR/> |-application.xml <BR/><BR/>I am using jboss-5.0.0.CR1 <BR/>Please suggest,<BR/>-AshokAshokhttps://www.blogger.com/profile/13314165252678471115noreply@blogger.comtag:blogger.com,1999:blog-30587633.post-82210644209879638392008-07-12T22:30:00.000+05:302008-07-12T22:30:00.000+05:30Anonymous said... Hi, Could you please expla...<I> <B>Anonymous</B> said...<BR/><BR/> Hi,<BR/> Could you please explain about MyClassLoader for EAR file.<BR/></I><BR/><BR/>MyClassLoader is just any (unique) name that you can give to your classloader which will be configured and used for loading your application's classes.Jaikiranhttps://www.blogger.com/profile/08503182723143814781noreply@blogger.comtag:blogger.com,1999:blog-30587633.post-19199774397350560972008-07-12T22:28:00.000+05:302008-07-12T22:28:00.000+05:30Anonymous said... Hi, I did the same procedu...<I> <B>Anonymous</B> said...<BR/><BR/> Hi,<BR/> I did the same procedure as you told, but i use log4j.xml instead of log4j.properties. I get the following error if i place jboss-app.xml under META-INF folder.<BR/><BR/> java.lang.RuntimeException: An exception occurred initialising interceptors for class com.bally.mom.ejb.CustomerListener.onMessage<BR/>...<BR/></I><BR/><BR/>This doesn't look specific to log4j related configuration. Maybe a classloader issue which arose when you configured the classloader scoping through the xmls.Jaikiranhttps://www.blogger.com/profile/08503182723143814781noreply@blogger.comtag:blogger.com,1999:blog-30587633.post-70071592506891267622008-07-12T22:26:00.000+05:302008-07-12T22:26:00.000+05:30Maty said...Hi! i try to use log4j in a war file w...<I> <B>Maty</B> said...<BR/>Hi! i try to use log4j in a war file with my JBOSS 4.0.5 GA server but when i check in the jmx ....<BR/></I><BR/><BR/>Maty, have you enabled classloader scoping for your application through the jboss-web.xml? A detailed explanation can be found at <A HREF="http://wiki.jboss.org/wiki/ClassLoadingConfiguration" REL="nofollow">Classloader Configuration in JBoss</A>Jaikiranhttps://www.blogger.com/profile/08503182723143814781noreply@blogger.comtag:blogger.com,1999:blog-30587633.post-77124640834881776312008-07-03T02:09:00.000+05:302008-07-03T02:09:00.000+05:30Hi! i try to use log4j in a war file with my JBOSS...Hi! i try to use log4j in a war file with my JBOSS 4.0.5 GA server but when i check in the jmx console it seems to load the log4j.jar of "server/default/lib" :(. Any idea?<BR/><BR/>I put the log4j.jar file in "WEB-INF/lib" of my war file<BR/><BR/>RegardsMatyhttps://www.blogger.com/profile/12306619263811214908noreply@blogger.comtag:blogger.com,1999:blog-30587633.post-80188893533360294602008-07-01T16:52:00.000+05:302008-07-01T16:52:00.000+05:30Hi, Could you please explain about MyClassLoader f...Hi,<BR/> Could you please explain about MyClassLoader for EAR file. It was clear for war file. How to do the same for EAR file and load it.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-30587633.post-34314344823386377352008-07-01T16:00:00.000+05:302008-07-01T16:00:00.000+05:30Hi, I did the same procedure as you told, but i us...Hi,<BR/> I did the same procedure as you told, but i use log4j.xml instead of log4j.properties. I get the following error if i place jboss-app.xml under META-INF folder.<BR/><BR/>java.lang.RuntimeException: An exception occurred initialising interceptors for class com.bally.mom.ejb.CustomerListener.onMessage<BR/> at org.jboss.ejb3.interceptor.EJB3InterceptorsFactory.createPerJoinpoint(EJB3InterceptorsFactory.java:108)<BR/> at org.jboss.aop.advice.AspectFactoryDelegator.createPerJoinpoint(AspectFactoryDelegator.java:119)<BR/> at org.jboss.aop.advice.ScopedInterceptorFactory.create(ScopedInterceptorFactory.java:113)<BR/> at org.jboss.aop.Advisor.createInterceptorChain(Advisor.java:618)<BR/> at org.jboss.aop.Advisor.pointcutResolved(Advisor.java:888)<BR/> at org.jboss.aop.Advisor.resolveMethodPointcut(Advisor.java:650)<BR/> at org.jboss.aop.ClassContainer.createInterceptorChains(ClassContainer.java:248)<BR/> at org.jboss.aop.ClassContainer.rebuildInterceptors(ClassContainer.java:115)<BR/> at org.jboss.aop.ClassContainer.initializeClassContainer(ClassContainer.java:58)<BR/> at org.jboss.ejb3.EJBContainer.create(EJBContainer.java:548)<BR/> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR/> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.ejb3.ServiceDelegateWrapper.createService(ServiceDelegateWrapper.java:87)<BR/> at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)<BR/> at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)<BR/> at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)<BR/> at $Proxy0.create(Unknown Source)<BR/> at org.jboss.system.ServiceController.create(ServiceController.java:330)<BR/> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR/> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)<BR/> at $Proxy55.create(Unknown Source)<BR/> at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:119)<BR/> at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:301)<BR/> at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:362)<BR/> at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)<BR/> at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)<BR/> at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)<BR/> at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)<BR/> at $Proxy0.start(Unknown Source)<BR/> at org.jboss.system.ServiceController.start(ServiceController.java:417)<BR/> at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)<BR/> at $Proxy33.start(Unknown Source)<BR/> at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)<BR/> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR/> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<BR/> at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)<BR/> at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)<BR/> at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)<BR/> at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)<BR/> at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)<BR/> at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)<BR/> at $Proxy34.start(Unknown Source)<BR/> at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)<BR/> at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)<BR/> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)<BR/> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)<BR/> at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<BR/> at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)<BR/> at $Proxy9.deploy(Unknown Source)<BR/> at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)<BR/> at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)<BR/> at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)<BR/> at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)<BR/> at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)<BR/> at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)<BR/> at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)<BR/> at $Proxy0.start(Unknown Source)<BR/> at org.jboss.system.ServiceController.start(ServiceController.java:417)<BR/> at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)<BR/> at $Proxy4.start(Unknown Source)<BR/> at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)<BR/> at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)<BR/> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)<BR/> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)<BR/> at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)<BR/> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<BR/> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR/> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<BR/> at java.lang.reflect.Method.invoke(Unknown Source)<BR/> at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)<BR/> at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)<BR/> at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<BR/> at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)<BR/> at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)<BR/> at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)<BR/> at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)<BR/> at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)<BR/> at $Proxy5.deploy(Unknown Source)<BR/> at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)<BR/> at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)<BR/> at org.jboss.Main.boot(Main.java:200)<BR/> at org.jboss.Main$1.run(Main.java:508)<BR/> at java.lang.Thread.run(Unknown Source)<BR/>Caused by: java.lang.NullPointerException<BR/> at org.jboss.ejb3.mdb.MDB.getMessagingType(MDB.java:84)<BR/> at org.jboss.ejb3.interceptor.EJB3InterceptorsFactory.getBusinessInterfaces(EJB3InterceptorsFactory.java:167)<BR/> at org.jboss.ejb3.interceptor.EJB3InterceptorsFactory.isBusinessMethod(EJB3InterceptorsFactory.java:122)<BR/> at org.jboss.ejb3.interceptor.EJB3InterceptorsFactory.createPerJoinpoint(EJB3InterceptorsFactory.java:98)<BR/> ... 153 moreAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-30587633.post-75260340419557327542008-06-28T14:26:00.000+05:302008-06-28T14:26:00.000+05:30Happy to know, you found it useful. Per Lindberg s...Happy to know, you found it useful. <BR/><BR/><I>Per Lindberg said...<BR/><BR/>You could amend it by saying that if the EAR contains both EJBs and a webappa WAR, then you don't have to enable classload isolation (using WEB-INF/jboss-web.xml).</I><BR/><BR/>You are right. The section for configuring WAR file was for those WARs which are deployed outside an EAR. I have updated that part to be more clear. Thanks for your comments :)Jaikiranhttps://www.blogger.com/profile/08503182723143814781noreply@blogger.comtag:blogger.com,1999:blog-30587633.post-71391492188744225452008-06-27T18:08:00.000+05:302008-06-27T18:08:00.000+05:30Excellent article! I have banged my head for a wee...Excellent article! I have banged my head for a week until I found it.<BR/><BR/>You could amend it by saying that if the EAR contains both EJBs and a webappa WAR, then you don't have to enable classload isolation (using WEB-INF/jboss-web.xml).<BR/><BR/>/Per LindbergAnonymousnoreply@blogger.com