Error: java.lang.NullPointerException [message #1012424] |
Thu, 21 February 2013 09:39  |
Eclipse User |
|
|
|
Hi,
I am new to using eclipse and tomcat. I am trying to get my web application working server side. I am getting a strange error message "Error: java.lang.NullPointerException" when I run a query in my deployed web application from the server. The server runs Apache web server 2.2, tomcat 5.5.27, and Java 1.6.0_26 and MySQL version 5.0.95. The web application runs fine locally within eclipse. However deployed on the server (via an war export and upload through lamda probe) it suddenly throws an excepction. I have checked web.xml, servlet config, properties files all seem ok. I feel like I have exhauseted every possible option but I am completely stumped as to why this issue is occuring. I know this is rather specific but if anyone can help or point me in the right direction I would be really grateful. Also if posting any config files etc would help then I can do that also. Hope someone can help!
Cheers
|
|
|
|
|
|
|
Re: Error: java.lang.NullPointerException [message #1012941 is a reply to message #1012851] |
Fri, 22 February 2013 08:54   |
Eclipse User |
|
|
|
On 02/22/2013 03:30 AM, Nadeem B wrote:
> Thank you for your advice. Okay so I had a look at the log file you
> mentioned. Seems there is two being used..
>
> The stack trace for catalina.out show this :-
>
> java.lang.NullPointerException
> at java.io.StringReader.(StringReader.java:33)
> at
> org.ngrl.alignment.blast.BLASTReportParser.parseToBioJavaResults(BLASTReportParser.java:64)
>
> at
> org.ngrl.alignment.blast.BLASTReportParser.parse(BLASTReportParser.java:77)
> at org.ngrl.alignment.blast.BLASTProgram.singleRun(BLASTProgram.java:130)
> at org.ngrl.snpcheck.SNPCheck.performCheckOnExistingPair(SNPCheck.java:160)
> at org.ngrl.snpcheck.SNPCheck.performCheckOnExistingPair(SNPCheck.java:136)
> at
> org.ngrl.snpcheck.service.SNPCheckRemote.getResultDto(SNPCheckRemote.java:130)
>
> at
> org.ngrl.snpcheck.service.SNPCheckRemote.performCheckOnExistingPair(SNPCheckRemote.java:79)
>
> [snip]
>
> I hope the above is clear I tried to copy and past the relevant part
> from the trace I felt was the cause of the issue. However I still don't
> get whats going on. Can you shed any light? Hope you can help :)
First, catalina.out contains what you were reporting. The second entry
you posted is from an "archived log"; Tomcat rolls this log and only
writes actively to catalina.out. It's so you can do as you wish to older
entries (delete those files, archive them somewhere else, scrape them
for reports using Splunk, etc.).
Second, this isn't an Eclipse forum question, but a beginning Java one.
I'll try to help a bit anyway.
You're not missing anything or you'd get a ClassNotFound error. I was
thinking of something else yesterday when I answered the first time. CNF
is the first thing to think of when there's a discrepancy between how
something behaves outside of Eclipse versus inside.
In the way you're calling StringReader, something's wrong. If method
BLASTReportParser.parseToBioJavaResults() is under your control, or you
have the source to it, line 64 is the call in StringReader. Look there
and/or crawl back up the stack (which is illustrated by the stack trace
in reverse order, deepest to most shallow for the thread) examining the
lines numbered in the trace. Ask yourself why something you're providing
to StringReader is either null or its effect causes this class to
attempt to manipulate an object that's null because of what you pass.
You should be able to intuit your problem, which would include
formulating a theory on why this occurs in natural deployment and not
when under Eclipse's control.
I hope this helps.
|
|
|
Re: Error: java.lang.NullPointerException [message #1012947 is a reply to message #1012858] |
Fri, 22 February 2013 08:59  |
Eclipse User |
|
|
|
On 02/22/2013 03:43 AM, Nadeem B wrote:
> and I also found this bit I should add in catalina.out :-
>
> 2013-02-22 10:36:46,879 WARN
> [org.directwebremoting.dwrp.BaseCallMarshaller] - <--Erroring:
> batchId[0] message[java.lang.NullPointerException]>
> Feb 22, 2013 10:37:37 AM org.apache.catalina.loader.WebappClassLoader
> loadClass
> INFO: Illegal access: this web application instance has been stopped
> already. Could not load org.apache.log4j.Appender. The eventual
> following stack trace is caused by an error thrown for debugging
> purposes as well as to attempt to terminate the thread which caused the
> illegal access, and has no functional impact.
> java.lang.IllegalStateException
Is log4j-nnn.jar in your deployment? Is log4j.properties doing what you
want even when running under Eclipse?
Etc.
Ultimately, why is BaseCallMarshaller only warning of a NPE. That class
probably belongs to you.
It's bewildering at first, but perserverence will make you more
comfortable with finding and fixing errors using the stack trace.
|
|
|
Powered by
FUDForum. Page generated in 0.31577 seconds