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

deserialize jasperprint = NoClassDefFoundError


cjd888
Go to solution Solved by lucianc,

Recommended Posts

Hi everyone,

 

I have an web client application that de-serialises a JasperPrint object (that was generated and passed down from the server) and displays it on screen in a JRViewer and utilises the jasperreports-1.3.3-applet.jar

 

This works fine until I have a chart in the report where I get the stack trace below:

 

I thought that as the chart is already filled I wouldn't need to include jfreechart in the client. I have barcodes too but they work fine without needing extra jars

 

Is this a bug perhaps? or am I barking up the wrong tree. I can include jfreechart in the client but would rather not if at all possible

 

thanks in advance

Chris

 

[update]

I tried including jfreechart.jar in my client but then I needed jcommon too, so I included that and now need net.sf.jasperreports.renderers.JRCategoryChartImageMapRenderer

 

Does this mean that to just view reports with charts you must have all the jasper/ireport jars in the classpath?

 

 

Code:
java.lang.NoClassDefFoundError: org/jfree/chart/labels/StandardCategoryItemLabelGenerator
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.io.ObjectInputStream.resolveClass(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.skipCustomData(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.util.ArrayList.readObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.util.ArrayList.readObject(Unknown Source)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at dcsclient.advancedprinting.AdvancedPrintRunTask.downloadCompletedReport(AdvancedPrintRunTask.java:707)
at dcsclient.advancedprinting.AdvancedPrintViewer.loadReport(AdvancedPrintViewer.java:271)
at dcsclient.advancedprinting.AdvancedPrintViewer.loadReport(AdvancedPrintViewer.java:292)
at dcsclient.reportselection.ReportMonitor.defaultSelectedStatusTab(ReportMonitor.java:535)
at dcsclient.reportselection.ReportMonitor.refreshMonitorDetails(ReportMonitor.java:492)

Post edited by: cjd888, at: 2007/06/06 16:31

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

When you have a chart in a report, the generated JasperPrint objects includes a JRRenderable instance that contains the data required by JFreeChart to render the chart. Hence JFreeChart is needed at report render/export time, not only at fill time.

 

It's not a bug, this is how the chart functionality was designed. This approach enables vector rendering for report charts; if pixel image data would be kept for the charts they would look worse when rendered.

 

If you don't want JFreeChart when rendering the filled report, I guess there are ways to process the report and replace the JFreeChart renderers with pixel images.

 

HTH,

Lucian

Link to comment
Share on other sites

Thanks for clearing that up I thought I was maybe doing something wrong.

 

I shall probably just include jfreechart in the client although unfortunately it seems you need the full jasperreport.jar too as it has the required renderers. I tried just adding them to the jasperreport-applet.jar but then ended up needing printhyperlink.class and who knows what else, so I gave up that route.

 

Of course what would be really handy is if Jasper/iReport had a "render as image" option for charts, is there any chance of that happening?

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