Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » NewXMLGenerator.createCMDocument() returns null
NewXMLGenerator.createCMDocument() returns null [message #723478] Thu, 08 September 2011 12:20 Go to next message
gegtot Missing name is currently offline gegtot Missing name
Messages: 6
Registered: September 2011
Junior Member
Hi all,

Just found out that NewXMLGenerator would be a great solution for me to create empty xml skeletons based on schemas.

However, the code snippet below returns cmDocument = null no matter what I do. Am I missing something really obvious here, or is this a bug?

schemaFileName = "file:///home/.../workspace3/xmlgeneratorplugin/myxsd.xsd";
CMDocument cmDocument = NewXMLGenerator.createCMDocument(schemaFileName, errorInfo);


The errorInfo[0] is empty, which strangely implies that all went fine.

I've tried different ways of passing the path including the IFile way...

Thanks,
Georg
Re: NewXMLGenerator.createCMDocument() returns null [message #723784 is a reply to message #723478] Fri, 09 September 2011 09:08 Go to previous messageGo to next message
gegtot Missing name is currently offline gegtot Missing name
Messages: 6
Registered: September 2011
Junior Member
i found the problem. forgot to add the required plugins in the dependencies section...

my bad..
Re: NewXMLGenerator.createCMDocument() returns null [message #878608 is a reply to message #723784] Tue, 29 May 2012 11:45 Go to previous messageGo to next message
Maria Arsuaga is currently offline Maria Arsuaga
Messages: 3
Registered: May 2012
Junior Member
Please, could you tell me, which are those plugins dependencies?

Thanks!
Re: NewXMLGenerator.createCMDocument() returns null [message #879168 is a reply to message #878608] Wed, 30 May 2012 12:43 Go to previous messageGo to next message
Maria Arsuaga is currently offline Maria Arsuaga
Messages: 3
Registered: May 2012
Junior Member
I have the same problem and I added this plugin dependencies

org.eclipse.core.runtime,
org.eclipse.core.resources;
org.eclipse.wst.common.uriresolver;
org.eclipse.wst.sse.core;
org.eclipse.wst.xml.core;
org.eclipse.wst.xml.ui;
org.eclipse.xsd;
com.ibm.icu;
org.eclipse.wst.xsd.core;
org.eclipse.wst.xsd.ui;
org.eclipse.emf.ecore;

Please, could you tell me if I am forgetting something? The CMDocumentFactoryRegistryReader.java:43 is returning null, when I'm creating the CMDocument cmDocument = NewXMLGenerator.createCMDocument(schemaFileName, null);



java.lang.NullPointerException
at org.eclipse.wst.xml.core.internal.contentmodel.factory.CMDocumentFactoryRegistryReader.readRegistry(CMDocumentFactoryRegistryReader.java:43)
at org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager.getCMDocumentFactoryRegistry(ContentModelManager.java:63)
at org.eclipse.wst.xml.core.internal.contentmodel.ContentModelManager.createCMDocument(ContentModelManager.java:55)
Re: NewXMLGenerator.createCMDocument() returns null [message #879409 is a reply to message #879168] Thu, 31 May 2012 03:10 Go to previous messageGo to next message
gegtot Missing name is currently offline gegtot Missing name
Messages: 6
Registered: September 2011
Junior Member
Hello Maria,

Unfortunately, I don't remember which plugins I added. It's been a long time since I had the problem. My approach has changed as well. I now modify the original eclipse xsd plugin to serve my purposes. In this approach all dependencies are solved when importing the plugin. Maybe this is the easiest way out for you too?

Really sloppy of me not to list the plugin dependencies that solved my problem. Sorry about that! Embarrassed

Here is the list on my dependencies tab.

org.eclipse.ui.ide;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.views;bundle-version="[3.4.0,4.0.0)",
org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)",
org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)",
org.eclipse.wst.sse.ui;bundle-version="[1.2.0,1.4.0)",
org.eclipse.wst.sse.core;bundle-version="[1.1.500,1.2.0)",
org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.wst.common.uriresolver;bundle-version="[1.1.301,1.2.0)",
org.eclipse.wst.xml.core;bundle-version="[1.1.500,1.2.0)",
org.eclipse.wst.common.ui;bundle-version="[1.1.400,1.2.0)",
org.eclipse.wst.validation;bundle-version="[1.2.100,1.3.0)",
org.eclipse.core.expressions;bundle-version="[3.4.100,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.3.0,2.0.0)",


Good luck!
Re: NewXMLGenerator.createCMDocument() returns null [message #879455 is a reply to message #879409] Thu, 31 May 2012 05:00 Go to previous message
Maria Arsuaga is currently offline Maria Arsuaga
Messages: 3
Registered: May 2012
Junior Member
Thanks a lot!!! Now it is working correctly!!!
Previous Topic:JSF - More tool support
Next Topic:Plain Java Project Web Service Client
Goto Forum:
  


Current Time: Sat Jul 26 03:07:05 EDT 2014

Powered by FUDForum. Page generated in 0.04680 seconds