giroe Posted July 24, 2007 Share Posted July 24, 2007 Good morning, I got the strangest problem :sI 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:serverTomcat_5.5webappsROOTWEB-INFjspReportingreportslayoutinfopersoon.jasper at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:92) at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:257) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:303) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:274) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:400) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1273) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:614) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:209) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.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(JasperFillManager.java:402) at be.goffin.reporting.jdbc.JDBCDataAccess.getExporter(JDBCDataAccess.java:61) at be.goffin.reporting.action.RLijstAction.execute(RLijstAction.java:64) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) 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(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.mainsys.filter.CharsetFilter.doFilter(CharsetFilter.java:21) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at com.mainsys.filter.ProtectSessionFilter.doFilter(ProtectSessionFilter.java:68) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)Caused by: java.io.InvalidClassException: java.util.ArrayList; local class incompatible: stream classdesc serialVersionUID = 8664875232659988799, local class serialVersionUID = 8683452581122892189 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1912) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1836) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1713) 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:00Post edited by: giroe, at: 2007/07/24 08:48 Link to comment Share on other sites More sharing options...
giroe Posted July 25, 2007 Author Share Posted July 25, 2007 Can someone pls help me?I still think its some kind of .jar version problem, but I cant fix it.Thnx in advance Link to comment Share on other sites More sharing options...
giroe Posted July 26, 2007 Author Share Posted July 26, 2007 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 More sharing options...
lucianc Posted July 26, 2007 Share Posted July 26, 2007 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 stacktraceCaused by: java.io.InvalidClassException: java.util.ArrayList; local class incompatible: stream classdesc serialVersionUID = 8664875232659988799, local class serialVersionUID = 8683452581122892189and 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 More sharing options...
giroe Posted July 26, 2007 Author Share Posted July 26, 2007 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 More sharing options...
lucianc Posted July 26, 2007 Share Posted July 26, 2007 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 More sharing options...
giroe Posted July 27, 2007 Author Share Posted July 27, 2007 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 More sharing options...
martynhiemstra Posted July 27, 2007 Share Posted July 27, 2007 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 More sharing options...
giroe Posted July 27, 2007 Author Share Posted July 27, 2007 Yeah, I already mentioned that I certainly used the same .jar files. But it seems a java bug. Not really anything to do with jasperreports. But still thnx for trying to help Link to comment Share on other sites More sharing options...
martynhiemstra Posted July 27, 2007 Share Posted July 27, 2007 When you compile the report a .java file is created. Can you check to see if a serialuid is created in that file? If so could you post it here? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now