You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jeremy Levy <je...@gmail.com> on 2009/07/01 18:41:09 UTC

Re: Mysterious NullPointerException

I'm trying this, what do you think?
        if (e == null) {
            log.error("The exception was null, dumping Stack");
            Thread.dumpStack();
        }

            StackTraceElement[] out = e.getStackTrace();
            StringBuffer sb = new StringBuffer();

            for (StackTraceElement ex : out) {
                sb.append(ex.toString() + "\n");
            }

            if (out.length == 0) {
                log.error("The exception had a length of 0, dumping Stack");
                Thread.dumpStack();
            }


What I have seen so far is that e.getStackTrace() has a length of 0, so I
added the thread dump...

Jeremy
On Mon, Jun 29, 2009 at 4:26 PM, Igor Vaynberg <ig...@gmail.com>wrote:

> even if the exception was not being chained it should have still had
> some sort of a stacktrace.
>
> -igor
>
> On Mon, Jun 29, 2009 at 11:39 AM, Martijn
> Reuvers<ma...@gmail.com> wrote:
> > Likely the message or stacktrace(s) (the actual cause) is throwing the
> > nullpointer, in which case that is all you can see when logging. You
> > might wanna try: log.error("whatever here",e.getCause()), generally
> > the latter is what you're interested in anyway. You might also try:
> >
> >
> >  @Override
> >  protected void logRuntimeException(RuntimeException e) {
> >        //super.logRuntimeException(e); // Turn this one off as
> > somewhere the error seems to occur
> >        log.error("whatever, but NOT the message",e);
> >   }
> >
> > Finally, I'd personally attempt to write it all to a custom file to
> > see if you can get anything useful into it.
> >
> > On Mon, Jun 29, 2009 at 6:49 PM, Igor Vaynberg<ig...@gmail.com>
> wrote:
> >> log.runtimeexception is already doing log.error(e.getMessage(), e);
> >> and he is still not seeing the stacktrace...
> >>
> >> -igor
> >>
> >> On Mon, Jun 29, 2009 at 9:41 AM, mbrictson<ma...@55minutes.com> wrote:
> >>>
> >>> If you simply call log.error(e), your log will only contain
> e.toString(),
> >>> which does not include the stack trace. You need to use the 2-arg
> version of
> >>> log.error() if you want the full trace.
> >>>
> >>> Try this:
> >>>
> >>> log.error("An uncaught runtime exception occurred", e);
> >>>
> >>>
> >>> jelevy wrote:
> >>>>
> >>>> Igor,
> >>>> Can you give me some direction on how to go about getting the "e".
> >>>>
> >>>> In my own RequestCycle I've done the following:
> >>>>
> >>>>  @Override
> >>>>     protected void logRuntimeException(RuntimeException e) {
> >>>>         super.logRuntimeException(e);
> >>>>         log.error(e);
> >>>>     }
> >>>>
> >>>>
> >>> --
> >>> View this message in context:
> http://www.nabble.com/Mysterious-NullPointerException-tp24094116p24257631.html
> >>> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >>> For additional commands, e-mail: users-help@wicket.apache.org
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Jeremy Levy

See my location in real-time:
http://seemywhere.com/jeremy

Re: Mysterious NullPointerException

Posted by Jeremy Levy <je...@gmail.com>.
Hmm, looking at that again, it looks just like the dump...

On Mon, Jul 13, 2009 at 8:55 AM, Jeremy Levy <je...@gmail.com> wrote:

> Take a look at this one:
> 2009-07-12 11:03:11,865 ERROR Web [RequestCycle]
> : java.lang.NullPointerException
> 2009-07-12 11:03:11,879 ERROR Web [MMRequestCycle] : The exception had a
> length of 0, dumping Stack
> 2009-07-12 11:03:11,885 ERROR Web [MMRequestCycle] : Logging:
>
> com.mdate.web.customcomponents.MMRequestCycle.logRuntimeException(MMRequestCycle.java:90)
> org.apache.wicket.RequestCycle.step(RequestCycle.java:1339)
> org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399)
> org.apache.wicket.RequestCycle.request(RequestCycle.java:529)
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:201)
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
>
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
> org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
>
> org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
> java.lang.Thread.run(Thread.java:619)
>
>
>
>
> On Wed, Jul 1, 2009 at 6:48 PM, Johan Compagner <jc...@gmail.com>wrote:
>
>> Thats just a dumpstack of the current line in the onRuntimeException.
>>
>> Cant you just debug it somehow an break on exception?
>>
>> Or call fillstacktrace or something on it? Its weird that the
>> exception it self just wont generate a stack..
>>
>> On 01/07/2009, Jeremy Levy <je...@gmail.com> wrote:
>> > Okay, I was able to get a thread dump for when this mysterious exception
>> > happens, see my prior message for the code the code that I am using to
>> print
>> >this out:
>> > 2009-07-01 16:42:59,155 ERROR Web [RequestCycle] :
>> > java.lang.NullPointerException
>> > 2009-07-01 16:42:59,250 ERROR Web [MMRequestCycle] : The exception had a
>> > length of 0, dumping Stack
>> > 2009-07-01 16:42:59,263 ERROR Web [STDERR] : java.lang.Exception: Stack
>> > trace
>> > 2009-07-01 16:42:59,273 ERROR Web [STDERR] :    at
>> > java.lang.Thread.dumpStack(Thread.java:1206)
>> > 2009-07-01 16:42:59,280 ERROR Web [STDERR] :    at
>> >
>> com.mdate.web.customcomponents.MMRequestCycle.logRuntimeException(MMRequestCycle.java:95)
>> > 2009-07-01 16:42:59,288 ERROR Web [STDERR] :    at
>> > org.apache.wicket.RequestCycle.step(RequestCycle.java:1339)
>> > 2009-07-01 16:42:59,297 ERROR Web [STDERR] :    at
>> > org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399)
>> > 2009-07-01 16:42:59,307 ERROR Web [STDERR] :    at
>> > org.apache.wicket.RequestCycle.request(RequestCycle.java:529)
>> > 2009-07-01 16:42:59,317 ERROR Web [STDERR] :    at
>> >
>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
>> > 2009-07-01 16:42:59,339 ERROR Web [STDERR] :    at
>> >
>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:201)
>> > 2009-07-01 16:42:59,356 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> > 2009-07-01 16:42:59,363 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> > 2009-07-01 16:42:59,372 ERROR Web [STDERR] :    at
>> >
>> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>> > 2009-07-01 16:42:59,380 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> > 2009-07-01 16:42:59,389 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> > 2009-07-01 16:42:59,398 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>> > 2009-07-01 16:42:59,407 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>> > 2009-07-01 16:42:59,414 ERROR Web [STDERR] :    at
>> >
>> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
>> > 2009-07-01 16:42:59,423 ERROR Web [STDERR] :    at
>> >
>> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
>> > 2009-07-01 16:42:59,429 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>> > 2009-07-01 16:42:59,435 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>> > 2009-07-01 16:42:59,442 ERROR Web [STDERR] :    at
>> >
>> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
>> > 2009-07-01 16:42:59,451 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>> > 2009-07-01 16:42:59,464 ERROR Web [STDERR] :    at
>> >
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
>> > 2009-07-01 16:42:59,484 ERROR Web [STDERR] :    at
>> > org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
>> > 2009-07-01 16:42:59,492 ERROR Web [STDERR] :    at
>> >
>> org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
>> > 2009-07-01 16:42:59,500 ERROR Web [STDERR] :    at
>> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
>> > 2009-07-01 16:42:59,507 ERROR Web [STDERR] :    at
>> > java.lang.Thread.run(Thread.java:619)
>> >
>> >
>> >
>> >
>> > On Wed, Jul 1, 2009 at 12:41 PM, Jeremy Levy <je...@gmail.com> wrote:
>> >
>> >> I'm trying this, what do you think?
>> >>         if (e == null) {
>> >>             log.error("The exception was null, dumping Stack");
>> >>             Thread.dumpStack();
>> >>         }
>> >>
>> >>             StackTraceElement[] out = e.getStackTrace();
>> >>             StringBuffer sb = new StringBuffer();
>> >>
>> >>             for (StackTraceElement ex : out) {
>> >>                 sb.append(ex.toString() + "\n");
>> >>             }
>> >>
>> >>             if (out.length == 0) {
>> >>                 log.error("The exception had a length of 0, dumping
>> >> Stack");
>> >>                 Thread.dumpStack();
>> >>             }
>> >>
>> >>
>> >> What I have seen so far is that e.getStackTrace() has a length of 0, so
>> I
>> >> added the thread dump...
>> >>
>> >>  Jeremy
>> >>
>> >> On Mon, Jun 29, 2009 at 4:26 PM, Igor Vaynberg
>> >> <ig...@gmail.com>wrote:
>> >>
>> >>> even if the exception was not being chained it should have still had
>> >>> some sort of a stacktrace.
>> >>>
>> >>> -igor
>> >>>
>> >>> On Mon, Jun 29, 2009 at 11:39 AM, Martijn
>> >>> Reuvers<ma...@gmail.com> wrote:
>> >>> > Likely the message or stacktrace(s) (the actual cause) is throwing
>> the
>> >>> > nullpointer, in which case that is all you can see when logging. You
>> >>> > might wanna try: log.error("whatever here",e.getCause()), generally
>> >>> > the latter is what you're interested in anyway. You might also try:
>> >>> >
>> >>> >
>> >>> >  @Override
>> >>> >  protected void logRuntimeException(RuntimeException e) {
>> >>> >        //super.logRuntimeException(e); // Turn this one off as
>> >>> > somewhere the error seems to occur
>> >>> >        log.error("whatever, but NOT the message",e);
>> >>> >   }
>> >>> >
>> >>> > Finally, I'd personally attempt to write it all to a custom file to
>> >>> > see if you can get anything useful into it.
>> >>> >
>> >>> > On Mon, Jun 29, 2009 at 6:49 PM, Igor Vaynberg<
>> igor.vaynberg@gmail.com>
>> >>> wrote:
>> >>> >> log.runtimeexception is already doing log.error(e.getMessage(), e);
>> >>> >> and he is still not seeing the stacktrace...
>> >>> >>
>> >>> >> -igor
>> >>> >>
>> >>> >> On Mon, Jun 29, 2009 at 9:41 AM, mbrictson<ma...@55minutes.com>
>> wrote:
>> >>> >>>
>> >>> >>> If you simply call log.error(e), your log will only contain
>> >>> e.toString(),
>> >>> >>> which does not include the stack trace. You need to use the 2-arg
>> >>> version of
>> >>> >>> log.error() if you want the full trace.
>> >>> >>>
>> >>> >>> Try this:
>> >>> >>>
>> >>> >>> log.error("An uncaught runtime exception occurred", e);
>> >>> >>>
>> >>> >>>
>> >>> >>> jelevy wrote:
>> >>> >>>>
>> >>> >>>> Igor,
>> >>> >>>> Can you give me some direction on how to go about getting the
>> "e".
>> >>> >>>>
>> >>> >>>> In my own RequestCycle I've done the following:
>> >>> >>>>
>> >>> >>>>  @Override
>> >>> >>>>     protected void logRuntimeException(RuntimeException e) {
>> >>> >>>>         super.logRuntimeException(e);
>> >>> >>>>         log.error(e);
>> >>> >>>>     }
>> >>> >>>>
>>
>>


-- 
Jeremy Levy

See my location in real-time:
http://seemywhere.com/jeremy

Re: Mysterious NullPointerException

Posted by Jeremy Levy <je...@gmail.com>.
Take a look at this one:
2009-07-12 11:03:11,865 ERROR Web [RequestCycle]
: java.lang.NullPointerException
2009-07-12 11:03:11,879 ERROR Web [MMRequestCycle] : The exception had a
length of 0, dumping Stack
2009-07-12 11:03:11,885 ERROR Web [MMRequestCycle] : Logging:
com.mdate.web.customcomponents.MMRequestCycle.logRuntimeException(MMRequestCycle.java:90)
org.apache.wicket.RequestCycle.step(RequestCycle.java:1339)
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399)
org.apache.wicket.RequestCycle.request(RequestCycle.java:529)
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:201)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
java.lang.Thread.run(Thread.java:619)




On Wed, Jul 1, 2009 at 6:48 PM, Johan Compagner <jc...@gmail.com>wrote:

> Thats just a dumpstack of the current line in the onRuntimeException.
>
> Cant you just debug it somehow an break on exception?
>
> Or call fillstacktrace or something on it? Its weird that the
> exception it self just wont generate a stack..
>
> On 01/07/2009, Jeremy Levy <je...@gmail.com> wrote:
> > Okay, I was able to get a thread dump for when this mysterious exception
> > happens, see my prior message for the code the code that I am using to
> print
> >this out:
> > 2009-07-01 16:42:59,155 ERROR Web [RequestCycle] :
> > java.lang.NullPointerException
> > 2009-07-01 16:42:59,250 ERROR Web [MMRequestCycle] : The exception had a
> > length of 0, dumping Stack
> > 2009-07-01 16:42:59,263 ERROR Web [STDERR] : java.lang.Exception: Stack
> > trace
> > 2009-07-01 16:42:59,273 ERROR Web [STDERR] :    at
> > java.lang.Thread.dumpStack(Thread.java:1206)
> > 2009-07-01 16:42:59,280 ERROR Web [STDERR] :    at
> >
> com.mdate.web.customcomponents.MMRequestCycle.logRuntimeException(MMRequestCycle.java:95)
> > 2009-07-01 16:42:59,288 ERROR Web [STDERR] :    at
> > org.apache.wicket.RequestCycle.step(RequestCycle.java:1339)
> > 2009-07-01 16:42:59,297 ERROR Web [STDERR] :    at
> > org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399)
> > 2009-07-01 16:42:59,307 ERROR Web [STDERR] :    at
> > org.apache.wicket.RequestCycle.request(RequestCycle.java:529)
> > 2009-07-01 16:42:59,317 ERROR Web [STDERR] :    at
> > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
> > 2009-07-01 16:42:59,339 ERROR Web [STDERR] :    at
> >
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:201)
> > 2009-07-01 16:42:59,356 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> > 2009-07-01 16:42:59,363 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> > 2009-07-01 16:42:59,372 ERROR Web [STDERR] :    at
> >
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> > 2009-07-01 16:42:59,380 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> > 2009-07-01 16:42:59,389 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> > 2009-07-01 16:42:59,398 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
> > 2009-07-01 16:42:59,407 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> > 2009-07-01 16:42:59,414 ERROR Web [STDERR] :    at
> >
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
> > 2009-07-01 16:42:59,423 ERROR Web [STDERR] :    at
> >
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
> > 2009-07-01 16:42:59,429 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> > 2009-07-01 16:42:59,435 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> > 2009-07-01 16:42:59,442 ERROR Web [STDERR] :    at
> >
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
> > 2009-07-01 16:42:59,451 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> > 2009-07-01 16:42:59,464 ERROR Web [STDERR] :    at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
> > 2009-07-01 16:42:59,484 ERROR Web [STDERR] :    at
> > org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
> > 2009-07-01 16:42:59,492 ERROR Web [STDERR] :    at
> >
> org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
> > 2009-07-01 16:42:59,500 ERROR Web [STDERR] :    at
> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
> > 2009-07-01 16:42:59,507 ERROR Web [STDERR] :    at
> > java.lang.Thread.run(Thread.java:619)
> >
> >
> >
> >
> > On Wed, Jul 1, 2009 at 12:41 PM, Jeremy Levy <je...@gmail.com> wrote:
> >
> >> I'm trying this, what do you think?
> >>         if (e == null) {
> >>             log.error("The exception was null, dumping Stack");
> >>             Thread.dumpStack();
> >>         }
> >>
> >>             StackTraceElement[] out = e.getStackTrace();
> >>             StringBuffer sb = new StringBuffer();
> >>
> >>             for (StackTraceElement ex : out) {
> >>                 sb.append(ex.toString() + "\n");
> >>             }
> >>
> >>             if (out.length == 0) {
> >>                 log.error("The exception had a length of 0, dumping
> >> Stack");
> >>                 Thread.dumpStack();
> >>             }
> >>
> >>
> >> What I have seen so far is that e.getStackTrace() has a length of 0, so
> I
> >> added the thread dump...
> >>
> >>  Jeremy
> >>
> >> On Mon, Jun 29, 2009 at 4:26 PM, Igor Vaynberg
> >> <ig...@gmail.com>wrote:
> >>
> >>> even if the exception was not being chained it should have still had
> >>> some sort of a stacktrace.
> >>>
> >>> -igor
> >>>
> >>> On Mon, Jun 29, 2009 at 11:39 AM, Martijn
> >>> Reuvers<ma...@gmail.com> wrote:
> >>> > Likely the message or stacktrace(s) (the actual cause) is throwing
> the
> >>> > nullpointer, in which case that is all you can see when logging. You
> >>> > might wanna try: log.error("whatever here",e.getCause()), generally
> >>> > the latter is what you're interested in anyway. You might also try:
> >>> >
> >>> >
> >>> >  @Override
> >>> >  protected void logRuntimeException(RuntimeException e) {
> >>> >        //super.logRuntimeException(e); // Turn this one off as
> >>> > somewhere the error seems to occur
> >>> >        log.error("whatever, but NOT the message",e);
> >>> >   }
> >>> >
> >>> > Finally, I'd personally attempt to write it all to a custom file to
> >>> > see if you can get anything useful into it.
> >>> >
> >>> > On Mon, Jun 29, 2009 at 6:49 PM, Igor Vaynberg<
> igor.vaynberg@gmail.com>
> >>> wrote:
> >>> >> log.runtimeexception is already doing log.error(e.getMessage(), e);
> >>> >> and he is still not seeing the stacktrace...
> >>> >>
> >>> >> -igor
> >>> >>
> >>> >> On Mon, Jun 29, 2009 at 9:41 AM, mbrictson<ma...@55minutes.com>
> wrote:
> >>> >>>
> >>> >>> If you simply call log.error(e), your log will only contain
> >>> e.toString(),
> >>> >>> which does not include the stack trace. You need to use the 2-arg
> >>> version of
> >>> >>> log.error() if you want the full trace.
> >>> >>>
> >>> >>> Try this:
> >>> >>>
> >>> >>> log.error("An uncaught runtime exception occurred", e);
> >>> >>>
> >>> >>>
> >>> >>> jelevy wrote:
> >>> >>>>
> >>> >>>> Igor,
> >>> >>>> Can you give me some direction on how to go about getting the "e".
> >>> >>>>
> >>> >>>> In my own RequestCycle I've done the following:
> >>> >>>>
> >>> >>>>  @Override
> >>> >>>>     protected void logRuntimeException(RuntimeException e) {
> >>> >>>>         super.logRuntimeException(e);
> >>> >>>>         log.error(e);
> >>> >>>>     }
> >>> >>>>
>
>

Re: Mysterious NullPointerException

Posted by Johan Compagner <jc...@gmail.com>.
Thats just a dumpstack of the current line in the onRuntimeException.

Cant you just debug it somehow an break on exception?

Or call fillstacktrace or something on it? Its weird that the
exception it self just wont generate a stack..

On 01/07/2009, Jeremy Levy <je...@gmail.com> wrote:
> Okay, I was able to get a thread dump for when this mysterious exception
> happens, see my prior message for the code the code that I am using to print
> this out:
> 2009-07-01 16:42:59,155 ERROR Web [RequestCycle] :
> java.lang.NullPointerException
> 2009-07-01 16:42:59,250 ERROR Web [MMRequestCycle] : The exception had a
> length of 0, dumping Stack
> 2009-07-01 16:42:59,263 ERROR Web [STDERR] : java.lang.Exception: Stack
> trace
> 2009-07-01 16:42:59,273 ERROR Web [STDERR] :    at
> java.lang.Thread.dumpStack(Thread.java:1206)
> 2009-07-01 16:42:59,280 ERROR Web [STDERR] :    at
> com.mdate.web.customcomponents.MMRequestCycle.logRuntimeException(MMRequestCycle.java:95)
> 2009-07-01 16:42:59,288 ERROR Web [STDERR] :    at
> org.apache.wicket.RequestCycle.step(RequestCycle.java:1339)
> 2009-07-01 16:42:59,297 ERROR Web [STDERR] :    at
> org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399)
> 2009-07-01 16:42:59,307 ERROR Web [STDERR] :    at
> org.apache.wicket.RequestCycle.request(RequestCycle.java:529)
> 2009-07-01 16:42:59,317 ERROR Web [STDERR] :    at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
> 2009-07-01 16:42:59,339 ERROR Web [STDERR] :    at
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:201)
> 2009-07-01 16:42:59,356 ERROR Web [STDERR] :    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 2009-07-01 16:42:59,363 ERROR Web [STDERR] :    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 2009-07-01 16:42:59,372 ERROR Web [STDERR] :    at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> 2009-07-01 16:42:59,380 ERROR Web [STDERR] :    at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 2009-07-01 16:42:59,389 ERROR Web [STDERR] :    at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> 2009-07-01 16:42:59,398 ERROR Web [STDERR] :    at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
> 2009-07-01 16:42:59,407 ERROR Web [STDERR] :    at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> 2009-07-01 16:42:59,414 ERROR Web [STDERR] :    at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
> 2009-07-01 16:42:59,423 ERROR Web [STDERR] :    at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
> 2009-07-01 16:42:59,429 ERROR Web [STDERR] :    at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> 2009-07-01 16:42:59,435 ERROR Web [STDERR] :    at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> 2009-07-01 16:42:59,442 ERROR Web [STDERR] :    at
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
> 2009-07-01 16:42:59,451 ERROR Web [STDERR] :    at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> 2009-07-01 16:42:59,464 ERROR Web [STDERR] :    at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
> 2009-07-01 16:42:59,484 ERROR Web [STDERR] :    at
> org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
> 2009-07-01 16:42:59,492 ERROR Web [STDERR] :    at
> org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
> 2009-07-01 16:42:59,500 ERROR Web [STDERR] :    at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
> 2009-07-01 16:42:59,507 ERROR Web [STDERR] :    at
> java.lang.Thread.run(Thread.java:619)
>
>
>
>
> On Wed, Jul 1, 2009 at 12:41 PM, Jeremy Levy <je...@gmail.com> wrote:
>
>> I'm trying this, what do you think?
>>         if (e == null) {
>>             log.error("The exception was null, dumping Stack");
>>             Thread.dumpStack();
>>         }
>>
>>             StackTraceElement[] out = e.getStackTrace();
>>             StringBuffer sb = new StringBuffer();
>>
>>             for (StackTraceElement ex : out) {
>>                 sb.append(ex.toString() + "\n");
>>             }
>>
>>             if (out.length == 0) {
>>                 log.error("The exception had a length of 0, dumping
>> Stack");
>>                 Thread.dumpStack();
>>             }
>>
>>
>> What I have seen so far is that e.getStackTrace() has a length of 0, so I
>> added the thread dump...
>>
>>  Jeremy
>>
>> On Mon, Jun 29, 2009 at 4:26 PM, Igor Vaynberg
>> <ig...@gmail.com>wrote:
>>
>>> even if the exception was not being chained it should have still had
>>> some sort of a stacktrace.
>>>
>>> -igor
>>>
>>> On Mon, Jun 29, 2009 at 11:39 AM, Martijn
>>> Reuvers<ma...@gmail.com> wrote:
>>> > Likely the message or stacktrace(s) (the actual cause) is throwing the
>>> > nullpointer, in which case that is all you can see when logging. You
>>> > might wanna try: log.error("whatever here",e.getCause()), generally
>>> > the latter is what you're interested in anyway. You might also try:
>>> >
>>> >
>>> >  @Override
>>> >  protected void logRuntimeException(RuntimeException e) {
>>> >        //super.logRuntimeException(e); // Turn this one off as
>>> > somewhere the error seems to occur
>>> >        log.error("whatever, but NOT the message",e);
>>> >   }
>>> >
>>> > Finally, I'd personally attempt to write it all to a custom file to
>>> > see if you can get anything useful into it.
>>> >
>>> > On Mon, Jun 29, 2009 at 6:49 PM, Igor Vaynberg<ig...@gmail.com>
>>> wrote:
>>> >> log.runtimeexception is already doing log.error(e.getMessage(), e);
>>> >> and he is still not seeing the stacktrace...
>>> >>
>>> >> -igor
>>> >>
>>> >> On Mon, Jun 29, 2009 at 9:41 AM, mbrictson<ma...@55minutes.com> wrote:
>>> >>>
>>> >>> If you simply call log.error(e), your log will only contain
>>> e.toString(),
>>> >>> which does not include the stack trace. You need to use the 2-arg
>>> version of
>>> >>> log.error() if you want the full trace.
>>> >>>
>>> >>> Try this:
>>> >>>
>>> >>> log.error("An uncaught runtime exception occurred", e);
>>> >>>
>>> >>>
>>> >>> jelevy wrote:
>>> >>>>
>>> >>>> Igor,
>>> >>>> Can you give me some direction on how to go about getting the "e".
>>> >>>>
>>> >>>> In my own RequestCycle I've done the following:
>>> >>>>
>>> >>>>  @Override
>>> >>>>     protected void logRuntimeException(RuntimeException e) {
>>> >>>>         super.logRuntimeException(e);
>>> >>>>         log.error(e);
>>> >>>>     }
>>> >>>>
>>> >>>>
>>> >>> --
>>> >>> View this message in context:
>>> http://www.nabble.com/Mysterious-NullPointerException-tp24094116p24257631.html
>>> >>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>> >>>
>>> >>>
>>> >>> ---------------------------------------------------------------------
>>> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> >>> For additional commands, e-mail: users-help@wicket.apache.org
>>> >>>
>>> >>>
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> >> For additional commands, e-mail: users-help@wicket.apache.org
>>> >>
>>> >>
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> > For additional commands, e-mail: users-help@wicket.apache.org
>>> >
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>>
>> --
>> Jeremy Levy
>>
>> See my location in real-time:
>> http://seemywhere.com/jeremy
>>
>
>
>
> --
> Jeremy Levy
>
> See my location in real-time:
> http://seemywhere.com/jeremy
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Mysterious NullPointerException

Posted by Jeremy Levy <je...@gmail.com>.
Okay, I was able to get a thread dump for when this mysterious exception
happens, see my prior message for the code the code that I am using to print
this out:
2009-07-01 16:42:59,155 ERROR Web [RequestCycle] :
java.lang.NullPointerException
2009-07-01 16:42:59,250 ERROR Web [MMRequestCycle] : The exception had a
length of 0, dumping Stack
2009-07-01 16:42:59,263 ERROR Web [STDERR] : java.lang.Exception: Stack
trace
2009-07-01 16:42:59,273 ERROR Web [STDERR] :    at
java.lang.Thread.dumpStack(Thread.java:1206)
2009-07-01 16:42:59,280 ERROR Web [STDERR] :    at
com.mdate.web.customcomponents.MMRequestCycle.logRuntimeException(MMRequestCycle.java:95)
2009-07-01 16:42:59,288 ERROR Web [STDERR] :    at
org.apache.wicket.RequestCycle.step(RequestCycle.java:1339)
2009-07-01 16:42:59,297 ERROR Web [STDERR] :    at
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1399)
2009-07-01 16:42:59,307 ERROR Web [STDERR] :    at
org.apache.wicket.RequestCycle.request(RequestCycle.java:529)
2009-07-01 16:42:59,317 ERROR Web [STDERR] :    at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:356)
2009-07-01 16:42:59,339 ERROR Web [STDERR] :    at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:201)
2009-07-01 16:42:59,356 ERROR Web [STDERR] :    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2009-07-01 16:42:59,363 ERROR Web [STDERR] :    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2009-07-01 16:42:59,372 ERROR Web [STDERR] :    at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2009-07-01 16:42:59,380 ERROR Web [STDERR] :    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2009-07-01 16:42:59,389 ERROR Web [STDERR] :    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2009-07-01 16:42:59,398 ERROR Web [STDERR] :    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
2009-07-01 16:42:59,407 ERROR Web [STDERR] :    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
2009-07-01 16:42:59,414 ERROR Web [STDERR] :    at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
2009-07-01 16:42:59,423 ERROR Web [STDERR] :    at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
2009-07-01 16:42:59,429 ERROR Web [STDERR] :    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2009-07-01 16:42:59,435 ERROR Web [STDERR] :    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2009-07-01 16:42:59,442 ERROR Web [STDERR] :    at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
2009-07-01 16:42:59,451 ERROR Web [STDERR] :    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2009-07-01 16:42:59,464 ERROR Web [STDERR] :    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
2009-07-01 16:42:59,484 ERROR Web [STDERR] :    at
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
2009-07-01 16:42:59,492 ERROR Web [STDERR] :    at
org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
2009-07-01 16:42:59,500 ERROR Web [STDERR] :    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
2009-07-01 16:42:59,507 ERROR Web [STDERR] :    at
java.lang.Thread.run(Thread.java:619)




On Wed, Jul 1, 2009 at 12:41 PM, Jeremy Levy <je...@gmail.com> wrote:

> I'm trying this, what do you think?
>         if (e == null) {
>             log.error("The exception was null, dumping Stack");
>             Thread.dumpStack();
>         }
>
>             StackTraceElement[] out = e.getStackTrace();
>             StringBuffer sb = new StringBuffer();
>
>             for (StackTraceElement ex : out) {
>                 sb.append(ex.toString() + "\n");
>             }
>
>             if (out.length == 0) {
>                 log.error("The exception had a length of 0, dumping
> Stack");
>                 Thread.dumpStack();
>             }
>
>
> What I have seen so far is that e.getStackTrace() has a length of 0, so I
> added the thread dump...
>
>  Jeremy
>
> On Mon, Jun 29, 2009 at 4:26 PM, Igor Vaynberg <ig...@gmail.com>wrote:
>
>> even if the exception was not being chained it should have still had
>> some sort of a stacktrace.
>>
>> -igor
>>
>> On Mon, Jun 29, 2009 at 11:39 AM, Martijn
>> Reuvers<ma...@gmail.com> wrote:
>> > Likely the message or stacktrace(s) (the actual cause) is throwing the
>> > nullpointer, in which case that is all you can see when logging. You
>> > might wanna try: log.error("whatever here",e.getCause()), generally
>> > the latter is what you're interested in anyway. You might also try:
>> >
>> >
>> >  @Override
>> >  protected void logRuntimeException(RuntimeException e) {
>> >        //super.logRuntimeException(e); // Turn this one off as
>> > somewhere the error seems to occur
>> >        log.error("whatever, but NOT the message",e);
>> >   }
>> >
>> > Finally, I'd personally attempt to write it all to a custom file to
>> > see if you can get anything useful into it.
>> >
>> > On Mon, Jun 29, 2009 at 6:49 PM, Igor Vaynberg<ig...@gmail.com>
>> wrote:
>> >> log.runtimeexception is already doing log.error(e.getMessage(), e);
>> >> and he is still not seeing the stacktrace...
>> >>
>> >> -igor
>> >>
>> >> On Mon, Jun 29, 2009 at 9:41 AM, mbrictson<ma...@55minutes.com> wrote:
>> >>>
>> >>> If you simply call log.error(e), your log will only contain
>> e.toString(),
>> >>> which does not include the stack trace. You need to use the 2-arg
>> version of
>> >>> log.error() if you want the full trace.
>> >>>
>> >>> Try this:
>> >>>
>> >>> log.error("An uncaught runtime exception occurred", e);
>> >>>
>> >>>
>> >>> jelevy wrote:
>> >>>>
>> >>>> Igor,
>> >>>> Can you give me some direction on how to go about getting the "e".
>> >>>>
>> >>>> In my own RequestCycle I've done the following:
>> >>>>
>> >>>>  @Override
>> >>>>     protected void logRuntimeException(RuntimeException e) {
>> >>>>         super.logRuntimeException(e);
>> >>>>         log.error(e);
>> >>>>     }
>> >>>>
>> >>>>
>> >>> --
>> >>> View this message in context:
>> http://www.nabble.com/Mysterious-NullPointerException-tp24094116p24257631.html
>> >>> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>>
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >>> For additional commands, e-mail: users-help@wicket.apache.org
>> >>>
>> >>>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
> --
> Jeremy Levy
>
> See my location in real-time:
> http://seemywhere.com/jeremy
>



-- 
Jeremy Levy

See my location in real-time:
http://seemywhere.com/jeremy