NullPointer in PropertySetter.computeContainmentTpye

The follwoing logback.xml works with tomcat, but not in orion application server: <?xml version="1.0" encoding="UTF-8" ?> <configuration> <appender name="ROLLFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOG_HOME}xsvapp.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <param name="FileNamePattern" value="${LOG_HOME}xsvapp.log.%d{yyyy-MM-dd}" /> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <param name="Pattern" value="%d{HH:mm:ss} %-5level [%thread] %class{25} - %msg%n" /> </layout> </appender> <root> <level value="debug" /> <appender-ref ref="ROLLFILE" /> </root> </configuration> I get the following NPE: 04.05.07 11:00 ixmidixservweb: Error initializing servlet java.lang.ExceptionInInitializerError at com.ixmid.ixservweb.web.session.SmnResolveProxies.<clinit>(SmnResolveProxies.java:117) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at com.evermind._ay._lse(Unknown Source) at com.evermind._ay._cbd(Unknown Source) at com.evermind._ay._lze(Unknown Source) at com.evermind._ay._lme(Unknown Source) at com.evermind._ay.<init>(Unknown Source) at com.evermind._am._rvb(Unknown Source) at com.evermind._ex._rvb(Unknown Source) at com.evermind._eu._kie(Unknown Source) at com.evermind._eu._bi(Unknown Source) at com.evermind._ex._bn(Unknown Source) at com.evermind._ex._bi(Unknown Source) at com.evermind.server.ApplicationServer._gse(Unknown Source) at com.evermind.server.ApplicationServer._bi(Unknown Source) at com.evermind._csb.run(Unknown Source) at java.lang.Thread.run(Thread.java:619) at com.evermind._bf.run(Unknown Source) Caused by: java.lang.NullPointerException at ch.qos.logback.core.util.PropertySetter.computeContainmentTpye(PropertySetter.java:234) at ch.qos.logback.core.util.PropertySetter.canContainComponent(PropertySetter.java:207) at ch.qos.logback.core.joran.action.NestedComponentIA.isApplicable(NestedComponentIA.java:57) at ch.qos.logback.core.joran.spi.Interpreter.lookupImplicitAction(Interpreter.java:214) at ch.qos.logback.core.joran.spi.Interpreter.getApplicableActionList(Interpreter.java:233) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:122) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:110) at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:36) at ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:336) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:74) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:38) at com.ixmid.bas.BasLog4j.<clinit>(BasLog4j.java:68) ... 19 more any idea? (the "normal" FileAppender works with both tomcat and orion) -- View this message in context: http://www.nabble.com/NullPointer-in-PropertySetter.computeContainmentTpye-t... Sent from the Logback User mailing list archive at Nabble.com.

Matthias, The NPE thrown at line 234 is probably caused by the variable 'p' not being set correctly on line 231. 225 int computeContainmentTpye(Method setterMethod) { 226 Class[] classArray = setterMethod.getParameterTypes(); 227 if (classArray.length != 1) { 228 return X_NOT_FOUND; 229 } else { 230 Class clazz = classArray[0]; 231 Package p = clazz.getPackage(); 232 if (clazz.isPrimitive()) { 233 return X_AS_PROPERTY; 234 } else if ("java.lang".equals(p.getName())) { ... Would it be possible for you to check out logback from our SVN repository and build it? You could then modify line 234 to read: 234 } else if (p != null && "java.lang".equals(p.getName())) { Alternatively, we could also perform tests on our side using Orion. Best regards, mancereus wrote:
The follwoing logback.xml works with tomcat, but not in orion application server: <?xml version="1.0" encoding="UTF-8" ?> <configuration> <appender name="ROLLFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${LOG_HOME}xsvapp.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <param name="FileNamePattern" value="${LOG_HOME}xsvapp.log.%d{yyyy-MM-dd}" /> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <param name="Pattern" value="%d{HH:mm:ss} %-5level [%thread] %class{25} - %msg%n" /> </layout> </appender>
<root> <level value="debug" /> <appender-ref ref="ROLLFILE" /> </root> </configuration>
I get the following NPE: 04.05.07 11:00 ixmidixservweb: Error initializing servlet java.lang.ExceptionInInitializerError at com.ixmid.ixservweb.web.session.SmnResolveProxies.<clinit>(SmnResolveProxies.java:117) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at com.evermind._ay._lse(Unknown Source) at com.evermind._ay._cbd(Unknown Source) at com.evermind._ay._lze(Unknown Source) at com.evermind._ay._lme(Unknown Source) at com.evermind._ay.<init>(Unknown Source) at com.evermind._am._rvb(Unknown Source) at com.evermind._ex._rvb(Unknown Source) at com.evermind._eu._kie(Unknown Source) at com.evermind._eu._bi(Unknown Source) at com.evermind._ex._bn(Unknown Source) at com.evermind._ex._bi(Unknown Source) at com.evermind.server.ApplicationServer._gse(Unknown Source) at com.evermind.server.ApplicationServer._bi(Unknown Source) at com.evermind._csb.run(Unknown Source) at java.lang.Thread.run(Thread.java:619) at com.evermind._bf.run(Unknown Source) Caused by: java.lang.NullPointerException at ch.qos.logback.core.util.PropertySetter.computeContainmentTpye(PropertySetter.java:234) at ch.qos.logback.core.util.PropertySetter.canContainComponent(PropertySetter.java:207) at ch.qos.logback.core.joran.action.NestedComponentIA.isApplicable(NestedComponentIA.java:57) at ch.qos.logback.core.joran.spi.Interpreter.lookupImplicitAction(Interpreter.java:214) at ch.qos.logback.core.joran.spi.Interpreter.getApplicableActionList(Interpreter.java:233) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:122) at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:110) at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:36) at ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:336) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:96) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:74) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:38) at com.ixmid.bas.BasLog4j.<clinit>(BasLog4j.java:68) ... 19 more
any idea? (the "normal" FileAppender works with both tomcat and orion)
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch

thanks, i patched my logback-0.9.5. source distribution, and everything works now. -- View this message in context: http://www.nabble.com/NullPointer-in-PropertySetter.computeContainmentTpye-t... Sent from the Logback User mailing list archive at Nabble.com.

Hi Matthias, I am glad to hear that the patch suggested previously works. We are trying to reproduce the problem on our side. Which version of Orion are you using? Which JDK? Cheers, mancereus wrote:
thanks,
i patched my logback-0.9.5. source distribution, and everything works now.
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch

Hi Ceki, 1) I've tested the problem with jdk5 and jdk6 and orion application server 2.0.5. 2) Last week i used MDC to seperate weblog and servicelog in my application. logback is great stuff. thanks. 3) i use an simple Wrapper for getLogger(): BasLog4j.java: public static Logger getInstance() { String c = new Exception().getStackTrace()[1].getClassName(); return LoggerFactory.getLogger(c); } So i don't have to set the classname and can write in any class: private static org.slf4j.Logger log = BasLog4j.getInstance(); Ceki Gulcu-2 wrote:
Hi Matthias,
I am glad to hear that the patch suggested previously works. We are trying to reproduce the problem on our side. Which version of Orion are you using? Which JDK?
Matthias. -- View this message in context: http://www.nabble.com/NullPointer-in-PropertySetter.computeContainmentTpye-t... Sent from the Logback User mailing list archive at Nabble.com.

Hello Ceki, the patch is lost in logback0.9.7. Could you please insert it again. Ceki Gulcu-2 wrote:
Hi Matthias,
I am glad to hear that the patch suggested previously works. We are trying to reproduce the problem on our side. Which version of Orion are you using? Which JDK?
Cheers,
mancereus wrote:
thanks,
i patched my logback-0.9.5. source distribution, and everything works now.
-- View this message in context: http://www.nabble.com/NullPointer-in-PropertySetter.computeContainmentTpye-t... Sent from the Logback User mailing list archive at Nabble.com.

Bummer. I'll look into it. mancereus wrote:
Hello Ceki,
the patch is lost in logback0.9.7. Could you please insert it again.
Ceki Gulcu-2 wrote:
Hi Matthias,
I am glad to hear that the patch suggested previously works. We are trying to reproduce the problem on our side. Which version of Orion are you using? Which JDK?
Cheers,
mancereus wrote:
thanks,
i patched my logback-0.9.5. source distribution, and everything works now.
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch

OK, patch merged into the trunk. Thanks for reporting this. I suspect we never committed this change into SVN or did we? Ceki Gulcu wrote:
Bummer. I'll look into it.
mancereus wrote:
Hello Ceki,
the patch is lost in logback0.9.7. Could you please insert it again.
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch
participants (2)
-
Ceki Gulcu
-
mancereus