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 151649 - [65cat] [xml] Unable to generate XML Document from XSD Schema
Summary: [65cat] [xml] Unable to generate XML Document from XSD Schema
Status: RESOLVED INCOMPLETE
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker with 2 votes (vote)
Assignee: Samaresh Panda
URL:
Keywords:
: 151650 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-10-28 23:17 UTC by esmithbss
Modified: 2009-08-06 04:16 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Log File (49.66 KB, text/plain)
2008-10-28 23:18 UTC, esmithbss
Details
Log File (49.66 KB, text/plain)
2008-10-28 23:19 UTC, esmithbss
Details
RC-1 Message Log (ignore others) (150.14 KB, text/plain)
2008-10-28 23:26 UTC, esmithbss
Details
no root message (21.30 KB, image/png)
2008-11-04 21:41 UTC, Samaresh Panda
Details
stacktrace (7.76 KB, text/plain)
2009-05-18 15:39 UTC, Exceptions Reporter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description esmithbss 2008-10-28 23:17:30 UTC
[ BUILD # : RC1 ]
[ JDK VERSION : 1.6.0_07 ]

I have just tried to generate an XML Document from a well formed XSD
schema.  I step through all pages of the New File Wizard until I get
to the "XML Model Generation Options" page.

On this page, I click the "Finish" button, but nothing happens.
Comment 1 esmithbss 2008-10-28 23:18:13 UTC
Created attachment 72805 [details]
Log File
Comment 2 esmithbss 2008-10-28 23:19:27 UTC
Created attachment 72806 [details]
Log File
Comment 3 esmithbss 2008-10-28 23:22:29 UTC
Also see Exception 133653.
Comment 4 esmithbss 2008-10-28 23:26:52 UTC
Created attachment 72808 [details]
RC-1 Message Log (ignore others)
Comment 5 esmithbss 2008-10-28 23:28:47 UTC
There was an error attaching log files.  Correct log file for this issue is
http://www.netbeans.org/nonav/issues/showattachment.cgi/72808/messages.log
Comment 6 esmithbss 2008-10-28 23:37:30 UTC
Possibly related to the schema file not having a root node, 
then subsequently being edited to add the root node.

Attempts to generate the file before the schema had a root node were canceled.

NPE occurred on first and all subsequent attempts to generate XML file from XSD schema.
Comment 7 Samaresh Panda 2008-10-29 15:48:24 UTC
In fact, when the schema doesn't have a root element, you'll not be able to go to "model generation option" page. The
next button in "schema option" panel gets enabled only when user selects a root node. You can try this by first creating
a new schema file.

OTOH, if I have a good schema, with top-level elements, I'm able to generate XML. So I do not think this qualifies to be
a P1, unless you have a use-case that clearly doesn't work.

Are you able to reproduce it? If yes, will you be able to share your schema?
Comment 8 Samaresh Panda 2008-10-29 16:50:55 UTC
*** Issue 151650 has been marked as a duplicate of this issue. ***
Comment 9 esmithbss 2008-11-02 05:56:08 UTC
The issue is that I used the NetBeans XSD Editor to create the schema file using the following steps:

1) New XML Schema File

2) Create New Complex Element

3) Add Two Elements to the sequence within the Complex Element

4) Now try to create an XML file from the schema.  At this point, the IDE is unable to create a new file because the XML
Schema doesn't have a root element.
Comment 10 Jiri Kovalsky 2008-11-04 21:14:27 UTC
Samaresh, any update on this? Is Eric's usecase invalid or you can't reproduce it? Thanks for your evaluation!
Comment 11 Samaresh Panda 2008-11-04 21:40:28 UTC
When the schema doesn't have a top-level elements, IDE throws a message as shown in picture and this is what I'm getting.
Comment 12 Samaresh Panda 2008-11-04 21:41:47 UTC
Created attachment 73251 [details]
no root message
Comment 13 Samaresh Panda 2008-11-04 21:45:07 UTC
I'm not sure what build Eric is using, but I'm using RC1. Let me add Tony, Michael and Sonali. They may be able to help
ius out.
Comment 14 Samaresh Panda 2008-11-13 19:16:21 UTC
Eric, we've not been able to reproduce this as per your steps. So unless you provide more info on how to reproduce, I'll
have to mark this as invalid.
Comment 15 esmithbss 2008-12-31 10:12:48 UTC
I'm currently using 6.5 final with patches and it appears that the wizard has been fixed to keep the buttons disabled
when the XSD file has no root element.

Is there anything in the XSD editor that forces the inclusion of a root element on a well formed document?
Comment 16 debopamg 2008-12-31 10:28:52 UTC
i am also using 6.5 final version. I have a freeform java project, and in the project folder, there is a "schemas"
folder containing quite a few schemas. All the schemas are related to each other. Now, I try to create a XML document
through the following steps:
1> Select "XML Schema-Constrained Document" in the wizard.
2> Press "Next" to go to "Schema Options"
3> Click on the browse button, and select the required schema "By Namespace"
4> Click "Ok" to return to "Schema Options" screen
5> In the given table, under the "Primary" column, select the schema which was browsed earlier
6> Change the prefix to something meaningful (ns1 does not make any sense)
7> Click "Next"
8> No changes made to "XML Model Generations Options" screen. all default values used.
9> Clicking on "Finish" produces the said error.
Comment 17 Exceptions Reporter 2009-05-18 15:39:22 UTC
Build: NetBeans IDE 6.5.1 (Build 200903060201)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.2-b01, Java(TM) SE Runtime Environment, 1.6.0_12-b04
OS: Linux, 2.6.26-2-amd64, amd64

User Comments: 


Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.xml.wizard.XMLGeneratorVisitor.generateXML(XMLGeneratorVisitor.java:111)
        at org.netbeans.modules.xml.wizard.XMLGeneratorVisitor.generateXML(XMLGeneratorVisitor.java:138)
        at org.netbeans.modules.xml.wizard.impl.XMLWizardIterator.generateXMLBody(XMLWizardIterator.java:518)
        at org.netbeans.modules.xml.wizard.impl.XMLWizardIterator.writeXMLFile(XMLWizardIterator.java:654)
        at org.netbeans.modules.xml.wizard.impl.XMLWizardIterator.instantiate(XMLWizardIterator.java:238)
        at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:588)
Comment 18 Exceptions Reporter 2009-05-18 15:39:26 UTC
Created attachment 82323 [details]
stacktrace
Comment 19 Exceptions Reporter 2009-06-14 21:02:19 UTC
This issue already has 8 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=133653
Comment 20 Exceptions Reporter 2009-08-06 04:16:55 UTC
This issue already has 9 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=133653