This week's giveaway is in the Spring forum.
We're giving away four copies of liveProject: Protecting User Data with Spring Security and OAuth2 and have Laurentiu Spilca on-line!
See this thread for details.
Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

jasper reports -Plz help me out

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just a guess

investigate serialization related topics:

local class incompatible: stream classdesc serialVersionUID = 607, local class serialVersionUID = 606

 
Did you just should on me? You should read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic