• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

jasper reports -Plz help me out

 
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
 
Ranch Hand
Posts: 1282
  • 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

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic