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

ClassNotFoundException for JRDataSource


roped

Recommended Posts

Hi @all,

I made some reports and with JasperReports version 5.0.4 printing / viewing works fine both running in IDE (Eclipse) and running with Java WebStart.
When using 5.5.1 and 5.6.0 it still works in Eclipse but when running with Webstart I get a ClassNotFoundException for JRDataSource (when I import JRException in my JavaClass I get the classNotFoun on JRException).

findJar says that JRDataSource is contained in jasperreports-x.x.x.jar

So I checked the libraries I load in Webstart more than once and I import the same jars both in Eclipse and my Webstart-JNLP-file. But in Eclipse it works, with Webstart it doesn't.
When using jasperreports-5.0.4 everything works fine in both so I don't assume that JRDataSource / JRException moved to another jar meanwhile.

The exception is:

ERROR 16:37:38,902 [WorkerThread-5]:  de.rzfnrw.dez35.hkrtv3.gui.masken.ZPAnzeigeMaskeAenderungen$7@5300f35c
java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JRDataSource
    at de.rzfnrw.dez35.hkrtv3.client.DruckGUI.ausgabeJRAnordnung(DruckGUI.java:148)
    at de.rzfnrw.dez35.hkrtv3.client.DruckGUI.druckeAkzAen(DruckGUI.java:134)
    at de.rzfnrw.dez35.hkrtv3.client.DruckGUI.druckeAkzAen(DruckGUI.java:104)
    at de.rzfnrw.dez35.hkrtv3.gui.masken.ZPAnzeigeMaskeAenderungen$7.construct(ZPAnzeigeMaskeAenderungen.java:305)
    at de.rzfnrw.dez35.hkrtv3.gui.AbstractSwingWorker$1.run(AbstractSwingWorker.java:82)
    at de.rzfnrw.dez35.allgemeines.WorkerQueue$WorkerThread.run(WorkerQueue.java:156)
Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.JRDataSource
    at java.net.URLClassLoader$1.run(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 com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 6 more

In my jnlp-file I use

    for JR 5.0.4:

        <jar href="jasperreports-5.0.4.jar" />

    for JR 5.5.1:

         <jar href="jasperreports-5.5.1.jar" />

I also tried

        <jar href="jasperreports-5.5.1.jar" />
        <jar href="jasperreports-fonts-5.5.1.jar" />
        <jar href="jasperreports-functions-5.5.1.jar" />
        <jar href="joda-time-2.3.jar" />

    for JR 5.6.0:

        <jar href="jasperreports-5.6.0.jar" />
        <jar href="jasperreports-fonts-5.6.0.jar" />
        <jar href="joda-time-2.3.jar" />

Has anyone an idea what could be the reason and how to fix it?

Thanks a lot in advance,

Roland

Link to comment
Share on other sites

  • 1 month later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 6 months later...

Hi,

sorry, till now i didn't find any solution. My application still runs with JasperReports 5.0.4.
JR 5.5.x and JR 6.0.0 both show the same problem. When i change the order of the jars referenced in the jnlp-file, i sometimes get the noClassDefFoundError for JRException. Perhaps that's a hint for searching, but still i didn't find an appropriate order.

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