Jump to content
We've recently updated our Privacy Statement, available here ×

Subrep:JRException Error loading object from file


giroe

Recommended Posts

Good morning, I got the strangest problem :s

I really dont know what to do anymore.

I got a masterreport and a subreport. I'm working with eclipse. When I do a dist, and extract the .war file to my tomcat I get an error:

 

 

net.sf.jasperreports.engine.JRException: Error loading object from file : C:ser

verTomcat_5.5webappsROOTWEB-INFjspReportingreportslayoutinfopersoon.jasp

er

at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:92

)

at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLo

ader.java:257)

at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubre

port.java:303)

at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFi

llElementContainer.java:274)

at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:

400)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVe

rticalFiller.java:1273)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVertic

alFiller.java:614)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRV

erticalFiller.java:209)

at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVertic

alFiller.java:109)

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:

751)

at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:

660)

at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:63

)

at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillMa

nager.java:402)

at be.goffin.reporting.jdbc.JDBCDataAccess.getExporter(JDBCDataAccess.ja

va:61)

at be.goffin.reporting.action.RLijstAction.execute(RLijstAction.java:64)

 

at org.apache.struts.action.RequestProcessor.processActionPerform(Reques

tProcessor.java:431)

at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja

va:236)

at org.apache.struts.action.ActionServlet.process(ActionServlet.java:119

6)

at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)

 

at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:252)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:173)

at com.mainsys.filter.CharsetFilter.doFilter(CharsetFilter.java:21)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:202)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:173)

at com.mainsys.filter.ProtectSessionFilter.doFilter(ProtectSessionFilter

.java:68)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:202)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF

ilterChain.java:173)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV

alve.java:213)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV

alve.java:178)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:

541)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j

ava:126)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j

ava:105)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal

ve.java:107)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav

a:148)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java

:869)

at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p

rocessConnection(Http11BaseProtocol.java:667)

at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo

int.java:527)

at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol

lowerWorkerThread.java:80)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP

ool.java:684)

at java.lang.Thread.run(Thread.java:595)

Caused by: java.io.InvalidClassException: java.util.ArrayList; local class incom

patible: stream classdesc serialVersionUID = 8664875232659988799, local class se

rialVersionUID = 8683452581122892189

at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)

at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:154

6)

at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

693)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)

at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:19

12)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)

 

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

713)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)

at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:19

12)

at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836)

 

at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1

713)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)

at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)

at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:88

)

... 41 more

 

 

I did some research on the forum, and I "thaught" that my problem was that I use a different .jar version in iReport and Eclipse. But I think I use version jasperreports-1.3.0.jar in both. BUT there is something more strange. When I just copy paste the .jasper file from my ecslipse map to my tomcat it does work! (so it seems the eclipse dist is doing something with my .jasper file?) I really hope you can help me.

 

Thanks in advance

 

EDIT: hmmm, I did some more testing. I used to compile the .jrxml files in my java code. So at the start I only had .jrxml files in my tomcat folder. And when I clicked on a report link in my IE (in the webapp) than the .jasper file was generated. Now I copied the .jasper files (that where generated with the webapplication) to my eclipse folder. And I changed my java code that only the .jasper objects must be loaded. Than I did a dist and extracted the .war file to my tomcat. And guess what, my reports dont work anymore. I always get the error:

Caused by: net.sf.jasperreports.engine.JRException: Error loading object from file : C:serverTomcat_5.5webappsROOTWEB-INFjspReportingreportslayoutagent

.jasper

(I really dont get it anymore, because those jasper files where generated by the webapplication :s)

 

Post edited by: giroe, at: 2007/07/24 08:00

Post edited by: giroe, at: 2007/07/24 08:48

Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

I'm sorry that I keep on replying here, but do you (jasperreport admins) have no clue what my problem is?

Can you still reply here if you even dont know it :)

I googled my problem, and "perhaps" its just a bug in eclipse. I read something about CVS changing binary files

Link to comment
Share on other sites

As much as we'd like to make everyone happy by solving all the problems, such a thing is not possible. This forum is not exclusively about the administrators answering user questions, it's about the entire community sharing knowledge/solutions/etc.

 

Now if you take a look at this line from your stacktrace

Caused by: java.io.InvalidClassException: java.util.ArrayList; local class incompatible: stream classdesc serialVersionUID = 8664875232659988799, local class serialVersionUID = 8683452581122892189

and you Google it a little, you would find this discussion which says that this happens when the serialized data gets decoded to text and reencoded to bytes.

 

So probably Eclipse (or another tool you are using) treats *.jasper files as a text files and messes them up. *.jasper files are binary files and should not be subject to any text/character processing. I can't tell you how to fix this, you should refer to the Eclipse/etc documentation.

 

HTH,

Lucian

Link to comment
Share on other sites

Thnx for your answer. And I did google it before your reply :) and I did find a discussion about cvs treating the some binary files as textfiles. I just thaught you guys would have a solution perhaps. Because ecslipse is well known, so if anyone tries to load .jasper object they "normally" would have the same problem as me
Link to comment
Share on other sites

We do use Eclipse and CVS but haven't encountered this problem before. Maybe a JR user recognizes the issue and has the solution for it. However I think you would have a better chance of having this question answered on a forum dedicated to the technology that actually causes the issue.

 

Note that most of the people keep the source *.jrxml files on CVS and generate the *.jasper files as part of the build process, so the scenario of *.jasper files on CVS is not common.

 

My suggestion is therefore to investigate this a little more to determine the exact moment at which the *.jasper files are altered, and refer to the documentation of the tools that's doing the file processing to see how to suppress it.

 

Regards,

Lucian

Link to comment
Share on other sites

lucianc wrote:

Note that most of the people keep the source *.jrxml files on CVS and generate the *.jasper files as part of the build process, so the scenario of *.jasper files on CVS is not common.

 

Yeah, for normal reports I also keep the *.jrxml file and compile it to *.jasper in my build proces. But for my subreport I didnt do that. But now I also do it for the subreports and it works fine, thnx for all the help

Link to comment
Share on other sites

Make sure you are using the same version of jasperreports when creating your reports and where your load your .jasper files. This means you need to take the jasperreport.jar file from the ireport directory and put that file in the classpath of the application that is loading your jasperreports.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...