PDA

View Full Version : Null Pointer Exception



Anonymous
04-22-2002, 08:06 AM
I'm getting the following Exception when I create the PreviewFrame.
The PreviewFrame appears with nothing inside it.
I noticed that the PreviewFrame creates a ReportPane with a new G2OutputTarget.
ReportPane calls processPage with the G2OutputTarget and not a OutputTarget as required in the JFreeReport.
Perhaps this is causing the Exception.
Any ideas?

Exception occurred during event dispatching:
java.lang.NullPointerException
at com.jrefinery.report.JFreeReport.advanceState(Unknown Source)
at com.jrefinery.report.JFreeReport.processPage(Unknown Source)
at com.jrefinery.report.ReportPane.repaginate(Unknown Source)
at com.jrefinery.report.ReportPane.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception occurred during event dispatching:
java.lang.NullPointerException
at com.jrefinery.report.JFreeReport.advanceState(Unknown Source)
at com.jrefinery.report.JFreeReport.processPage(Unknown Source)
at com.jrefinery.report.ReportPane.repaginate(Unknown Source)
at com.jrefinery.report.ReportPane.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JViewport.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JLayeredPane.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
at java.awt.Container.paint(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Finished target(s).

Anonymous
04-22-2002, 08:52 AM
Regarding my previous email, I ran some tests and noticed that the error I was getting was somehow related to the xml file and the AbstractTableModel I was using.
Perhaps porting the xml file is not as simple as I thought?
My TableModel has the following data:
Column Names - type
Reference no - String
Surname - String
First Name - String
Initials - String
Application grade - String
Enrollment year - String

I don't need any Groups so I have left that blank. I only have the following:
<groups>
</groups>

In items I have the following:
<items height="10" fontname="Monospaced" fontstyle="plain" fontsize="8">
<string-field name="GlobalID Element" x="0" y="0" width="76" height="8" alignment="left">Reference no</string-field>
<string-field name="Surname Element" x="100" y="0" width="76" height="8" alignment="left">Surname</string-field>
<string-field name="FirstName Element" x="200" y="0" width="76" height="8" alignment="left">First Name</string-field>
<string-field name="Initials Element" x="300" y="0" width="76" height="8" alignment="left">Initials</string-field>
<string-field name="Grade Element" x="400" y="0" width="76" height="8" alignment="left">Application grade</string-field>
<string-field name="EnrolYear Element" x="500" y="0" width="76" height="8" alignment="left">Enrollment year</string-field>
</items>
What could be causing the problem?

Anonymous
04-22-2002, 09:14 AM
Ignore my previous two emails, cos I managed to get it working now.

Anonymous
04-25-2002, 03:44 PM
Just for the logs: Using version 0.7.0 requires at least an empty group.
This issue is fixed in the ongoing release.