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 143680 - SQL History: org.xml.sax.SAXParseException: Premature end of file.
Summary: SQL History: org.xml.sax.SAXParseException: Premature end of file.
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P3 blocker (vote)
Assignee: John Baker
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-12 22:21 UTC by John Baker
Modified: 2008-08-19 17:15 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 80229


Attachments
sample sql_history file with corrupted values (4.31 MB, text/xml)
2008-08-19 02:50 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Baker 2008-08-12 22:21:52 UTC
Build: NetBeans IDE Dev (Build 200807040101)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13
OS: Linux, 2.6.25.10-47.fc8, i386
User comments: 
STACKTRACE: (first 10 lines)
org.xml.sax.SAXParseException: Premature end of file.
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
        at
org.netbeans.modules.db.sql.history.SQLHistoryPersistenceManager$AtomicWriter.run(SQLHistoryPersistenceManager.java:232)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:120)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:499)
        at org.netbeans.modules.db.sql.history.SQLHistoryPersistenceManager.create(SQLHistoryPersistenceManager.java:111)
        at org.netbeans.modules.db.sql.history.SQLHistoryManager.save(SQLHistoryManager.java:111)
        at org.netbeans.modules.db.sql.execute.SQLExecuteHelper.execute(SQLExecuteHelper.java:176)
        at org.netbeans.modules.db.sql.loader.SQLEditorSupport$SQLExecutor.run(SQLEditorSupport.java:476)
Comment 1 John Baker 2008-08-12 22:26:42 UTC
I suppose if an XML exception occurs, a dialog should open informing the user of the problem and the persisted file
should be deleted and recreated.
Comment 2 John Baker 2008-08-16 00:15:25 UTC
should have a fix soon
Comment 3 John Baker 2008-08-19 02:49:18 UTC
b403b05a21a6

If there's any corruption executing SQL, such that unparsable text is saved then SQL History will report a message in the dialog, log the error in messages.log  
and reset the history file.

Comment 4 John Baker 2008-08-19 02:50:32 UTC
Created attachment 67761 [details]
sample sql_history file with corrupted values
Comment 5 John Baker 2008-08-19 02:53:11 UTC
To verify the fix, replace an existing sql_history file with this one in config/Databases/SQLHISTORY then try to open
SQL History.
Opening history again will prompt the user to execute SQL in order to show the history dialog
Comment 6 Roman Mostyka 2008-08-19 16:02:48 UTC
Verified with build 080819.
Comment 7 Quality Engineering 2008-08-19 17:15:33 UTC
Integrated into 'main-golden', available in build *200808191401* on http://bits.netbeans.org/dev/nightly/
Changeset: http://hg.netbeans.org/main/rev/b403b05a21a6
User: John Baker` <jbaker@netbeans.org>
Log: #143680 SQL History: org.xml.sax.SAXParseException: Premature end of file;  cleanup