[logback-user] NullPointer in PropertySetter.computeContainmentTpye
Ceki Gulcu
listid at qos.ch
Fri May 4 12:08:44 CEST 2007
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
More information about the Logback-user
mailing list