How to solve org.apache.jasper.JasperException: java.lang.NullPointerException ??

0

 All,

Often when I make a slight mistake in a report query or in a input control I always get the below error in JasperServer.

 

How can I tell JasperServer to throw a usable message so i know what is actually wrong in my report rather then trying to guess at it?

 

Ries

 

HTTP Status 500 -


type Exception report

message

descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: java.lang.NullPointerException

root cause

java.lang.NullPointerException

note The full stack traces of the exception and its root causes are available in the Sun Java System Application Server 9.1_01 logs.


Sun Java System Application Server 9.1_01

riesvantwisk's picture
Joined: Feb 21 2008 - 8:09am
Last seen: 2 years 3 months ago

5 Answers:

0

Hi,

That is basically comes from JAVA, you can tune so that it wont appear on the screen but this is nothing to do with JS. Its fall back to JAVA itself and usually bases on the error message we can identify what is actuall problem.

anandharaj's picture
Joined: Oct 18 2006 - 5:02pm
Last seen: 5 years 5 months ago
0

Anandharaj Subramaniam
Wrote:

Hi,

That is basically comes from JAVA, you can tune so that it wont appear on the screen but this is nothing to do with JS. Its fall back to JAVA itself and usually bases on the error message we can identify what is actuall problem.

 

Of course this comes from Java.... However it seems to happen when I make a mistake in a control or datasource or 'something'. However shouldn't JasperServer not catch ALL exceptions and tell me what is wrong rather then ignore the exception and bail out.

Of course I can take a look at the glassfish logfile and see where/why it happens and in what module but honestly it's JasperServer that should give me a good message what is wrong.

Ries

riesvantwisk's picture
Joined: Feb 21 2008 - 8:09am
Last seen: 2 years 3 months ago
0
Hi, Normally this "NullPoiterException" is because of mission resource / input. To make it usefull error, perhaps Jasper team can come out with own error handling which will give a user-friendly message.
anandharaj's picture
Joined: Oct 18 2006 - 5:02pm
Last seen: 5 years 5 months ago
0

The default behavior is to show that there was an exception and "Show Details" to see the stack trace, which I know is not friendly, but it is hard to deal with all errors.

There may be some Glassfish specific issues that we do not catch, and so you are seeing more errors than what Tomcat installations would be seeing. Could you give us some examples of what is causing the errors?

 

Sherman

Jaspersoft

swood's picture
2347
Joined: Jun 21 2006 - 12:48pm
Last seen: 6 years 5 months ago
0

Like what anandharaj was saying, it's mostly resources that are un-available.

It's currently kinda hard to explain to our client what they are seeing is really there fault. They have questions how to get back (back button doesn't always work in that case), and they have questions why it cannot tell us what was wrong.

I can currently think of two solutions:

 

1) Don't run the report in the web context, but seperate so that the exception can be caught and shown within the application rather then the application bailing out completely,

2) Do a pre-flight check on the jrxml to see if everything is available to run the report. If not show a message of what was wrong.

 

So far it seems to be only a case of missing re-sources though.

 

Ries

riesvantwisk's picture
Joined: Feb 21 2008 - 8:09am
Last seen: 2 years 3 months ago
Feedback