Jump to content
Changes to the Jaspersoft community edition download ×

Class Loader fails


Recommended Posts



I am developing a web application and, of course, it requires some reports.


I designed a report in iReports 1.2.8, compiled it to a .jasper file. It runs very well in iReports, when using it in my application (the .jasper file) it works very well in NetBeans 5.0 with Tomcat 5.5.9 embedded.


I am using the methods from JasperReports that return byte[] to generate a PDF report.


My problem is when I try to deploy the application to WebSphere 6.1 or Sun Application Server 8.2 both return a NullPointerException when trying to get the length of the byte[] variable because it is null.


While debugging in Sun App Svr, the method JRClassLoader.loadClassFromBytes(String className, byte[] bytecodes) is called with className = myReportName_<someNumbers>


Looking into the directory where I created the report with iReports, I found a .java file that matches the exact name (numbers included) of the invocation. My questions are:


a)Do I need to put this .java file somewhere in my project?

b)If the answer to the previous question is "yes", where do I have to put it? Because it has no package declared.

c)If the answer to question (a) is "no", then what do I do because the classLoader is not working, as if it do not find the class myReportName_<someNumbers>


Please, any help would prevent more hair from coming off because of my pulling… not to mention the hurry I am now in.


Thanks in advance and best regards.



PS. By the way, iReports is great!

Post edited by: elimercado, at: 2007/01/24 23:47

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I have only a partial answer for you: you don't have to put the .java file anywhere, the method you mentioned load a Java class from an in-memory byte array.


Unfortunately, I have no idea why this doesn't work on WebSphere or Sun App Server. I'll leave this question open for others to answer. You could also investigate this further yourself.




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...