Jump to content

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


Recommended Posts


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?




HTTP Status 500 -

type Exception report


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


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


root cause



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



Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Anandharaj Subramaniam


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.


Link to comment
Share on other sites

  • 2 weeks later...


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?




Link to comment
Share on other sites

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.



Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...