Jasper reports with Zend Server Issue

0

Hi,

I was trying to use jasper reports with zend server in windows 7. I have installed PHP-JavaBridge in the server .

When i run the report page Iam getting an error like 

Exception caught: Java Exception java.lang.ClassNotFoundException: com.mysql.jdbc.Driver java.lang.ClassNotFoundException: com.mysql.jdbc.Driver 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 java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source)

Please help me to fix this error as I am a novice in Jasper reports . Also please take me through the procedures to setup the .jar file in zend server .

Thanks in advance.

regards,

 

Sidhath Ramachandran

 

 

 

 

sidharth721's picture
Joined: Jan 8 2014 - 10:16pm
Last seen: 5 years 10 months ago

1 Answer:

1

There is not much information to go by, I really do not know what are you doing with JasperReports when the error occurs :).

It looks like JR is trying to connect to a MySQL server using JDBC (I assume that is for filling the report) and there is no MySQL JDBC driver found. Hence the error "com.mysql.jdbc.Driver " you will need to add the MySQL JDBC driver (.jar file) in the classpath of your Java environment.

In this case  JVM used by PHP-Java Bridge; I do not have  experience with the Zend Java Bridge but from the docs you will find information on where ClassPath is defined see: http://files.zend.com/help/Zend-Platform/java_bridge.htm

You can download the JDBC driver for MySQL from here http://dev.mysql.com/downloads/connector/j/

marianol's picture
4868
Joined: Sep 13 2011 - 8:04am
Last seen: 1 year 2 months ago

Thank you so much for your response.

I have fixed the lang exception error that was thrown .

Now Mysql,jasper manager all objects are created too but when i call a function from net.sf.jasperreports.engine.JasperCompileManager its again throwing an error.

this is the function name compileReport("path to the .jrxml file");

The error thrown is given below

Exception caught: Java Exception java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception
java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.Exception

Tried many ways but coudnt fix the issue.

Please help me in fixing this.

Thanks,

Sidharth

sidharth721 - 5 years 11 months ago
Feedback
randomness