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 143487 - SAX Parser generation is throwing an error
Summary: SAX Parser generation is throwing an error
Status: RESOLVED DUPLICATE of bug 129531
Alias: None
Product: xml
Classification: Unclassified
Component: Tools (show other bugs)
Version: 6.x
Hardware: PC All
: P1 blocker (vote)
Assignee: Samaresh Panda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-11 15:50 UTC by graeme_m_ross
Modified: 2008-08-12 08:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
WSFormat.dtd (3.42 KB, text/plain)
2008-08-11 16:38 UTC, graeme_m_ross
Details

Note You need to log in before you can comment on or make changes to this bug.
Description graeme_m_ross 2008-08-11 15:50:29 UTC
I was attempting to generate a SAX Parser from a dtd and I got an Internal error message. I found the following message
in the log file. It had generated the Parser and the interface but the implementation class was empty as was the binding
file. It fails in exactly the same manner in 6.5M1

This worked correctly in Netbeans 5.0 and I was trying to regenerate a parser I had generated before

SEVERE: Cannot create a QualIdent for formats.WSFormatHandler
org.openide.ErrorManager$AnnException: msg
	at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:861)
	at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:650)
	at org.openide.ErrorManager.annotate(ErrorManager.java:452)
	at org.netbeans.modules.xml.lib.GuiUtil.notifyException(GuiUtil.java:120)
	at org.netbeans.modules.xml.tools.generator.XMLGenerateAction.performAction(XMLGenerateAction.java:100)
	at org.openide.util.actions.NodeAction.performAction(NodeAction.java:289)
	at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:118)
	at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:77)
	at org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:114)
	at org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:277)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1170)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1211)
	at java.awt.Component.processMouseEvent(Component.java:6038)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
	at java.awt.Component.processEvent(Component.java:5803)
	at java.awt.Container.processEvent(Container.java:2058)
	at java.awt.Component.dispatchEventImpl(Component.java:4410)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Component.dispatchEvent(Component.java:4240)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
	at java.awt.Container.dispatchEventImpl(Container.java:2102)
	at java.awt.Window.dispatchEventImpl(Window.java:2429)
	at java.awt.Component.dispatchEvent(Component.java:4240)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
msg
Caused: java.lang.IllegalArgumentException: Cannot create a QualIdent for formats.WSFormatHandler
	at org.netbeans.modules.xml.tools.java.generator.GenerationUtils.createQualIdent(GenerationUtils.java:466)
	at org.netbeans.modules.xml.tools.java.generator.GenerationUtils.addImplementsClause(GenerationUtils.java:447)
	at org.netbeans.modules.xml.tools.java.generator.SAXGeneratorSupport$3.run(SAXGeneratorSupport.java:768)
	at org.netbeans.api.java.source.JavaSource.runModificationTask(JavaSource.java:916)
	at org.netbeans.modules.xml.tools.java.generator.SAXGeneratorSupport.generateInterfaceImpl(SAXGeneratorSupport.java:866)
	at org.netbeans.modules.xml.tools.java.generator.SAXGeneratorSupport.access$2100(SAXGeneratorSupport.java:108)
	at
org.netbeans.modules.xml.tools.java.generator.SAXGeneratorSupport$InterfaceImplGenerator.generate(SAXGeneratorSupport.java:2123)
	at org.netbeans.modules.xml.tools.java.generator.SAXGeneratorSupport.generate(SAXGeneratorSupport.java:314)
[catch] at org.netbeans.modules.xml.tools.generator.XMLGenerateAction.performAction(XMLGenerateAction.java:93)
	at org.openide.util.actions.NodeAction.performAction(NodeAction.java:289)
	at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:118)
	at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:77)
	at org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:114)
	at org.openide.util.actions.NodeAction.actionPerformed(NodeAction.java:277)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1170)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1211)
	at java.awt.Component.processMouseEvent(Component.java:6038)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
	at java.awt.Component.processEvent(Component.java:5803)
	at java.awt.Container.processEvent(Container.java:2058)
	at java.awt.Component.dispatchEventImpl(Component.java:4410)
	at java.awt.Container.dispatchEventImpl(Container.java:2116)
	at java.awt.Component.dispatchEvent(Component.java:4240)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
	at java.awt.Container.dispatchEventImpl(Container.java:2102)
	at java.awt.Window.dispatchEventImpl(Window.java:2429)
	at java.awt.Component.dispatchEvent(Component.java:4240)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
ALL [null]: Action failed due to internal error!
Comment 1 Samaresh Panda 2008-08-11 16:22:05 UTC
Unfortunately this fix didn't make to 6.1. The fix is available in 6.5.

*** This issue has been marked as a duplicate of 129531 ***
Comment 2 graeme_m_ross 2008-08-11 16:26:00 UTC
I tried this on a newly downloaded copy of 6.5M1 and it still happens, has it been fixed or is there a workaround
Comment 3 Samaresh Panda 2008-08-11 16:34:39 UTC
Are you trying this in a Java App? Can you pl. attach the DTD you're using? It'll help if you tell us the exact steps to
reproduce.

In the mean while you may want to try in one of the 6.5 nightly builds (http://bits.netbeans.org/dev/nightly/latest/).
I'm not sure why it doesn't work in 6.5M1.
Comment 4 Sonali Kochar 2008-08-11 16:35:54 UTC
Please attach the DTD for which you are seeing this issue
Comment 5 graeme_m_ross 2008-08-11 16:38:52 UTC
Created attachment 67042 [details]
WSFormat.dtd
Comment 6 graeme_m_ross 2008-08-11 16:40:40 UTC
The dtd file is in a subdirectory (ie not the default package) and I was simply, in the netbeans environment, right
clicking on the dtd file and selecting the generate sax parser option then following all the defaults 
Comment 7 Sonali Kochar 2008-08-11 17:57:22 UTC
The attached DTD works fine for me. What version of JAXP , SAX did you choose in the first screen? 
Comment 8 graeme_m_ross 2008-08-12 08:25:31 UTC
As long as the dtd is sitting in a subdirectory it throws the internal error, no matter what options I select on the
wizard for JAXP and SAX.

However if I place the dtd in the default package (top directory) it generates successfully. Strangely if I then try to
generate the Parser for the dtd in the subdirectory it works, but only when the previously top level generated parser
exists, inspection of the code shows that it is importing the top level parser and not the one that it has just generated


package tttt;

import WSFormatHandler;
import org.xml.sax.AttributeList;
import org.xml.sax.SAXException;

/**
 *
 * @author rossgr
 */
public class WSFormatHandlerImpl implements WSFormatHandler {
    public static final boolean DEBUG = false;