Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jasper reports -Plz help me out

 
Manmath Waghmare
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just a guess

investigate serialization related topics:
local class incompatible: stream classdesc serialVersionUID = 607, local class serialVersionUID = 606
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic