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 195773 - SAXParseException when creating glassfish resource
Summary: SAXParseException when creating glassfish resource
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.0
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: Vince Kraemer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-21 16:34 UTC by Kenneth Ganfield
Modified: 2011-02-24 17:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
glassfish-resources.xml (710 bytes, application/xml)
2011-02-22 11:21 UTC, Kenneth Ganfield
Details
zipped enterprise app (15.27 KB, application/zip)
2011-02-22 11:26 UTC, Kenneth Ganfield
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Ganfield 2011-02-21 16:34:02 UTC
Product Version: NetBeans IDE Dev (Build 201102200501)
Java: 1.6.0_22; Java HotSpot(TM) 64-Bit Server VM 17.1-b03-307
System: Mac OS X version 10.5.8 running on x86_64; MacRoman; en_US (nb)
Userdir: /Applications/NetBeans/userdirs/7.0-20110220

When using the new JMS resource wizard in a project that already has a glassfish-resources.xml.

To reproduce, 
1. create ejb module, target GF 3.1 b43
2. create glassfish-resources.xml by creating eg a JMS resource. 
3. use wizard to create a new JMS resource

The following exception occurs:


INFO [glassfish-javaee]: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1414)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$TrailingMiscDriver.next(XMLDocumentScannerImpl.java:1423)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
	at org.netbeans.modules.glassfish.spi.TreeParser.readXml(TreeParser.java:91)
Caused: java.lang.IllegalStateException
	at org.netbeans.modules.glassfish.spi.TreeParser.readXml(TreeParser.java:96)
[catch] at org.netbeans.modules.glassfish.javaee.db.Hk2DatasourceManager.readDatasources(Hk2DatasourceManager.java:210)
	at org.netbeans.modules.glassfish.javaee.db.Hk2DatasourceManager.getDatasources(Hk2DatasourceManager.java:149)
	at org.netbeans.modules.glassfish.javaee.Three1Configuration.getDatasources(Three1Configuration.java:91)
	at org.netbeans.modules.glassfish.javaee.ModuleConfigurationImpl.getDatasources(ModuleConfigurationImpl.java:142)
	at org.netbeans.modules.j2ee.deployment.config.ConfigSupportImpl.getDatasources(ConfigSupportImpl.java:398)
	at org.netbeans.modules.j2ee.common.ui.BrokenDatasourceSupport.getBrokenDatasources(BrokenDatasourceSupport.java:156)
	at org.netbeans.modules.j2ee.common.project.ui.AbstractLogicalViewProvider.hasBrokenDataSource(AbstractLogicalViewProvider.java:829)
	at org.netbeans.modules.j2ee.common.project.ui.AbstractLogicalViewProvider.access$1200(AbstractLogicalViewProvider.java:118)
	at org.netbeans.modules.j2ee.common.project.ui.AbstractLogicalViewProvider$4.run(AbstractLogicalViewProvider.java:339)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
Comment 1 Vince Kraemer 2011-02-21 17:20:52 UTC
please attach the glassfish-resources.xml file.
Comment 2 Vince Kraemer 2011-02-21 17:59:51 UTC
You need to give me a bit more details... I followed your steps to reproduce and was not able to...

Standard questions: 
new or old userdir? 
did you import settings from 6.9?  
how did you create the ejb jar project? 
maven or ant based project?

please attach project as a zip file so I can inspect it in detail.
Comment 3 Kenneth Ganfield 2011-02-22 11:21:26 UTC
Created attachment 106281 [details]
glassfish-resources.xml

attaching glassfish-resources.xml file
Comment 4 Kenneth Ganfield 2011-02-22 11:26:24 UTC
Created attachment 106282 [details]
zipped enterprise app

attaching zip archive of project

fresh user dir with no imported settings
project is an Ant projected and the EJB module was created as part of the new Enterprise Application wizard
Comment 5 Kenneth Ganfield 2011-02-22 12:25:59 UTC
Vince, 
After looking at the problem again, this is probably not your area.

Looks like the glassfish-resources.xml is malformed for when using the mdb wizard. Validation fails. But when you fix the incorrect closed resource tag generated by the wizard the file validates.

Reducing the priority to P3 because of the easy fix and reassigning to java ee
Comment 6 Vince Kraemer 2011-02-22 16:52:02 UTC
ken...

Please provide a more detailed description of how to reproduce this issue.  Step-by-step, object/operation oriented would be 'best'

If you are following a tutorial or some-such a reference to that tutorial would be helpful.

Since the plugin is what writes the glassfish-resources.xml file, this is bound to come back to me... so I have retaken it.
Comment 7 Kenneth Ganfield 2011-02-22 18:13:11 UTC
I encountered it by following this tutorial

http://netbeans.org/kb/docs/javaee/maven-entapp.html

which is a maven tutorial but I was able to also reproduce on an ant project.

Basically, if I have a new EJB project with no glassfish-resources.xml file and I use the MDB wizard to create the bean and use the Add Message Destination dialog in the wizard to create the resource, the glassfish-resources.xml file that is then generated by the IDE fails to validate because of a <resources /> tag at the beginning of the file, before the <admin-object-resource> tag. If I remove the "/" from the first resources tag, the file will validate and the resources will be created correctly on the server. The rest of the tutorial functions with recent builds that contain your fix for 195470.
Comment 8 Vince Kraemer 2011-02-22 19:49:59 UTC
can replicate...
Comment 9 Quality Engineering 2011-02-24 05:34:27 UTC
Integrated into 'main-golden', will be available in build *201102240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7eb65259a61e
User: Vince Kraemer <vkraemer@netbeans.org>
Log: #195773 : copy paste error cases SAXParseException