Hello,
I am trying to display a report from my java application using JasperReports, but I keep getting a Null Pointer Exception and I can't figure out what I am doing wrong. Here is the error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.ibjectInputStream$PeekInputStream.read(ObjectInputStream.java:2217)
at java.ibjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2230)
at java.ibjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2698)
at java.ibjectInputStream.readStreamHeader(ObjectInputStream.java:750)
at java.ibjectInputStream.<init>(ObjectInputStream.java:268)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:191)
at main.Request.printRequest(Request.java:162)
at GUI.RequestForm.jButton1ActionPerformed(RequestForm.java:254)
at GUI.RequestForm.access$200(RequestForm.java:13)
at GUI.RequestForm$3.actionPerformed(RequestForm.java:127)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Any help would be greatly appreciated.
I am trying to display a report from my java application using JasperReports, but I keep getting a Null Pointer Exception and I can't figure out what I am doing wrong. Here is the error:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at java.ibjectInputStream$PeekInputStream.read(ObjectInputStream.java:2217)
at java.ibjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2230)
at java.ibjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2698)
at java.ibjectInputStream.readStreamHeader(ObjectInputStream.java:750)
at java.ibjectInputStream.<init>(ObjectInputStream.java:268)
at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:191)
at main.Request.printRequest(Request.java:162)
at GUI.RequestForm.jButton1ActionPerformed(RequestForm.java:254)
at GUI.RequestForm.access$200(RequestForm.java:13)
at GUI.RequestForm$3.actionPerformed(RequestForm.java:127)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Any help would be greatly appreciated.