aspose file tools*
The moose likes Product and Other Certifications and the fly likes jasper reports -Plz help me out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "jasper reports -Plz help me out" Watch "jasper reports -Plz help me out" New topic
Author

jasper reports -Plz help me out

Manmath Waghmare
Greenhorn

Joined: May 29, 2005
Posts: 1
Hello experts,
currently i am doing the jasper reports,
i am getting the following problem

is there any one to solve problem

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import net.sf.jasperreports.engine.*;

public class jasperexample {

private Connection connection;

private static Connection getConnection() {

String driver = "COM.ibm.db2.jdbc.app.DB2Driver";
String connectString = "jdbc b2:ETRF";
String user = "admin";
String password = "iflex1234$";

try {
Class.forName(driver);
Connection conn = DriverManager.getConnection(connectString, user, password);
return conn;
} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
}

return null;
}

public static void main( String args[]) {
Map parameters = new HashMap();

parameters.put("report", "Manmath");
try {
JasperCompileManager.compileReportToFile("Report.jrxml");

JasperFillManager.fillReportToFile("Report.jasper", parameters, getConnection());

JasperExportManager.exportReportToPdfFile("Report.jrprint");
} catch (JRException e) {
e.printStackTrace();
}
}
}

------------------------------------------
Errors


java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; local class incompatible: stream classdesc serialVersionUID = 607, local class serialVersionUID = 606
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:86)
at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:90)
at jasperexample.main(jasperexample.java:42)

NESTED BY :
java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; local class incompatible: stream classdesc serialVersionUID = 607, local class serialVersionUID = 606
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:86)
at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:90)
at jasperexample.main(jasperexample.java:42)

NESTED BY :
net.sf.jasperreports.engine.JRException: Error loading object from file : Report.jasper
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:90)
at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:90)
at jasperexample.main(jasperexample.java:42)
Caused by: java.io.InvalidClassException: net.sf.jasperreports.engine.base.JRBaseReport; local class incompatible: stream classdesc serialVersionUID = 607, local class serialVersionUID = 606
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:463)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:86)
... 2 more
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
just a guess

investigate serialization related topics:
local class incompatible: stream classdesc serialVersionUID = 607, local class serialVersionUID = 606


java amateur
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jasper reports -Plz help me out