You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Marshall Crocker <cr...@cavs.msstate.edu> on 2010/05/07 17:26:32 UTC

Problem with log4j and geronimo 2.1.1

I'm having a problem getting geronimo 2.1.1 to use my log4j.properties.  It works fine with geronimo 2.1.4 but our production server is still at 2.1.1.

My webapp deploys fine but when starting I get this error:


19100:  2010-05-07 10:06:47,882 ERROR [runtime.GBeanInstanceState] - Error while starting; GBean is now in the FAILED state: abstractName="org.test/mywebapp/1.0/war?J2EEApplication=null,WebModule=org.test/mywebapp/1.0/war,j2eeType=SystemLog,name=DirectoryLog4jConfiguration"
19101:  java.lang.NullPointerException
19102:  at org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean.<init>(ApplicationLog4jConfigurationGBean.java:52)
19103:  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
19104:  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
19105:  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
19106:  at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
19107:  at org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:948)
19108:  at org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:268)
19109:  at org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
19110:  at org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124)
19111:  at org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:555)
19112:  at org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
19113:  at org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456)
19114:  at org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:187)
19115:  at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:549)
19116:  at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:530)
19117:  at sun.reflect.GeneratedMethodAccessor495.invoke(Unknown Source)
19118:  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
19119:  at java.lang.reflect.Method.invoke(Method.java:585)
19120:  at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
19121:  at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
19122:  at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832)
19123:  at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
19124:  at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
19125:  at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
19126:  at org.apache.geronimo.kernel.config.EditableConfigurationManager$$EnhancerByCGLIB$$2b316b2d.startConfiguration(<generated>)
19127:  at org.apache.geronimo.deployment.plugin.local.StartCommand.run(StartCommand.java:67)
19128:  at java.lang.Thread.run(Thread.java:595)

In my geronimo-web.xml I have

    <dep:gbean name="DirectoryLog4jConfiguration" class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean">
     <dep:attribute name="log4jResource">META-INF/log4j.properties</dep:attribute>
    </dep:gbean>

And my log4j.properties file is in WEB-INF/classes/META-INF/

This exception isn't very helpful and the fact that it works with 2.1.4 makes me think that its a bug in geronimo 2.1.1.  

Any ideas on how to make it work without upgrading?

Thanks,
Marshall


Re: Problem with log4j and geronimo 2.1.1

Posted by Kevan Miller <ke...@gmail.com>.
On May 7, 2010, at 11:26 AM, Marshall Crocker wrote:

> I'm having a problem getting geronimo 2.1.1 to use my log4j.properties.  It works fine with geronimo 2.1.4 but our production server is still at 2.1.1.
> 
<snip>
> And my log4j.properties file is in WEB-INF/classes/META-INF/
> 
> This exception isn't very helpful and the fact that it works with 2.1.4 makes me think that its a bug in geronimo 2.1.1.  
> 
> Any ideas on how to make it work without upgrading?

See https://issues.apache.org/jira/browse/GERONIMO-4286

Applying this patch would fix your problem, I think:

http://svn.apache.org/viewvc/geronimo/server/branches/2.1/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/log4j/ApplicationLog4jConfigurationGBean.java?p2=%2Fgeronimo%2Fserver%2Fbranches%2F2.1%2Fframework%2Fmodules%2Fgeronimo-system%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fgeronimo%2Fsystem%2Flogging%2Flog4j%2FApplicationLog4jConfigurationGBean.java&p1=%2Fgeronimo%2Fserver%2Fbranches%2F2.1%2Fframework%2Fmodules%2Fgeronimo-system%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fgeronimo%2Fsystem%2Flogging%2Flog4j%2FApplicationLog4jConfigurationGBean.java&r1=698597&r2=698596&view=diff&pathrev=698597

Alternatively, use the "log4jFile" property, instead of "log4jResource" (you'd have to move your log configuration file out of your app...).

--kevan