Jump to content
We've recently updated our Privacy Statement, available here ×

ClassNotFoundException when loading object


Recommended Posts

By: dfailla - d_failla

ClassNotFoundException when loading object

2006-05-05 07:44

I am using the code below to load a compiled jasper file in the JDeveloper environment. It will run properly the first time, but when trying to load again to service a second request, a ClassNotFoundException will be thrown from the loadObject() method. The source of the problem seems to be in the deserialization of contained classes in the report such as JRBaseLine, JRBaseRectangle. Any ideas why the exception? It sees all classes the first time through.

 

File reportFile = new File("C:\WS_examples\dodimrcat1.jasper");

JasperReport jasperReport = null;

try

{

jasperReport = (JasperReport) JRLoader.loadObject (reportFile.getPath());

System.out.println("Got compiled report");

} catch(JRException jrExp){

jrExp.printStackTrace();

}

 

return(jasperReport);

 

 

 

 

 

By: develito - devel2k5

RE: ClassNotFoundException when loading objec

2006-05-05 20:01

Hi..

How do you display the report..???

Are you using a JRViewer??

 

Because I had a similar problem with a Web Application made in jDeveloper.. When the report was called by the first time the report was OK.. but the second time the report don´t work.. And this was happening because the report was visualized in a JasperViewer.. like this :

 

(new JasperViewer()).viewReport( Myjasperprint);

 

Then, in view of the mistake.. I change the viewer calling for this:

 

(new JasperViewer()).viewReport( Myjasperprint, false);

 

Look the 'false' parameters.. this parameter is for when the windows report in closed it simply hide and not exit..

 

I hope this help you..

___________________________

PD: Sorry for may English..

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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