This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 241404

Summary: NullPointerException at com.jaspersoft.ireport.designer.JrxmlEditorSupport.saveDocument
Product: third-party Reporter: chemo
Component: -- Other --Assignee: gt78 <gt78>
Status: NEW ---    
Severity: normal CC: Alex-92, fito80, hoffrg86, rafa_master
Priority: P2    
Version: 8.0   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 161459
Attachments: stacktrace

Description chemo 2014-02-04 19:22:30 UTC
Build: NetBeans IDE 8.0 Beta (Build 201401141042)
VM: Java HotSpot(TM) Client VM, 24.51-b03, Java(TM) SE Runtime Environment, 1.7.0_51-b13
OS: Windows 8

User Comments:
GUEST: This error ocurrs when i modify an jrxml file and then i try to save it.

GUEST: vbjbvn

GUEST: save ireport

GUEST: Want to save changed repor

chemo: <Please provide a description of the problem or the steps to reproduce>no sirve guaradar cuando agrego algun dato




Stacktrace: 
java.lang.NullPointerException
   at com.jaspersoft.ireport.designer.JrxmlEditorSupport.saveDocument(JrxmlEditorSupport.java:259)
   at org.openide.text.CloneableEditorSupport.canClose(CloneableEditorSupport.java:1131)
   at org.openide.text.DataEditorSupport.canClose(DataEditorSupport.java:467)
   at org.openide.windows.CloneableOpenSupport$Listener.vetoableChange(CloneableOpenSupport.java:380)
   at org.openide.util.WeakListenerImpl$VetoableChange.vetoableChange(WeakListenerImpl.java:229)
   at java.beans.VetoableChangeSupport.fireVetoableChange(VetoableChangeSupport.java:375)
Comment 1 chemo 2014-02-04 19:22:32 UTC
Created attachment 144799 [details]
stacktrace
Comment 2 Jaroslav Havlin 2014-02-05 05:39:34 UTC
The exception is thrown from iReport plugin.
Reassigning to plugin owner. Please evaluate it. Thank you.
Comment 3 kizinfo 2014-07-09 13:18:48 UTC
This also happens to me in netbeans 7.4 under java 7. It seems to be caused by document preview which puts the document in a closed state. a workaround - after previewing (which saves the report successfully) just close and reopen the document before making any additional changes (so you can save it).

how to replicate:

1. load a report
4. switch to preview
5. switch to design
6. move an element
7. save report (JrxmlEditorSupport exception)

It seems that preview mode is somehow causing the document to be marked as closed and its losing its document reference hence JrxmlEditorSupport:saveDocument is returning null for getDocument() (line 267). it does this even if the document doesn't need to be (and isn't) saved automatically on preview. I haven't yet been able to trace how the document is getting closed on preview.