Jump to content
Changes to the Jaspersoft community edition download ×

EOFException problem when I try to load with loadObject


Recommended Posts

Hi. I have an EOFException problem when I try to load with loadObject. The problem arises when I try to load an ImputStream from the compiled report for the second time. I am implementing the possibility of having loaded in memory the compiled file of the report so that each time the report has to be generated, it searches in memory if it is already executed once. The first time the report is executed correctly the loadObject and fillReport function correctly. But the second time I try to re-show the report it generates EOFException. Obviously I assumed that the ImputStream was left with the pointer at the end after the first reading and that's why I put a mark (0) so that before reading the ImputStream a second time to do a reset and put it back at the beginning of the ImputStream. But I still have the same problem. I pass them the exception that is generated.


net.sf.jasperreports.engine.JRException: Error loading object from InputStream.
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:282)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:262)
    at libClass.rpt.ReportsJRXML.generarJASPER(ReportsJRXML.java:95)
    at libClass.rpt.ReportsJRXML.ejecutar(ReportsJRXML.java:173)
    at libClass.swing.toolBar.tasks.TaskPreviewReport.lambda$doInBackground$316(TaskPreviewReport.java:91)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.io.EOFException
    at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2335)
    at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2804)
    at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:802)
    at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)
    at net.sf.jasperreports.engine.util.ContextClassLoaderObjectInputStream.<init>(ContextClassLoaderObjectInputStream.java:57)
    at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:277)
    ... 18 more

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...