Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » XSDImporter.java cannot run headless
XSDImporter.java cannot run headless [message #67978] Thu, 27 April 2006 03:24 Go to next message
Scott Hendrickson is currently offline Scott HendricksonFriend
Messages: 69
Registered: July 2009
Member
When converting XSD to ECore headless, I would get a
NullPointerException in XSDImporter.java when there were errors or
warnings in my schema:

Exception in thread "main" java.lang.NullPointerException at
org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)

This was because it was trying to get the plugin instance, which is null
when running headless. Below is a patch to use a plugin id directly
"org.eclipse.xsd.ecore.importer". This seems to coincide with the
OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.

Could this patch be applied?

Thanks,
-- Scott




### Eclipse Workspace Patch 1.0
#P org.eclipse.xsd.ecore.importer
Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
============================================================ =======
RCS file:
/cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
retrieving revision 1.8
diff -u -r1.8 XSDImporter.java
--- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec 2005
08:00:01 -0000 1.8
+++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr 2006
03:14:12 -0000
@@ -139,7 +139,7 @@
List information = (List)i.next();
diagnostic.add(new BasicDiagnostic(
"error".equals(information.get(0)) ? Diagnostic.ERROR :
"warning".equals(information.get(0)) ? Diagnostic.WARNING : Diagnostic.INFO,
- XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
+ "org.eclipse.xsd.ecore.importer",
0,
(String)information.get(1),
null));
Re: XSDImporter.java cannot run headless [message #68000 is a reply to message #67978] Thu, 27 April 2006 10:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Scott,

I'm confused. The plugin instances should work properly, i.e., not be
null, when running headless, since plugin initialization will work the
same way as running in the GUI. Are you mixing up headless verses
standalone? The former involves running a registered application and
the later involves invoking directly from a main().


Scott Hendrickson wrote:
> When converting XSD to ECore headless, I would get a
> NullPointerException in XSDImporter.java when there were errors or
> warnings in my schema:
>
> Exception in thread "main" java.lang.NullPointerException at
> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)
>
>
> This was because it was trying to get the plugin instance, which is
> null when running headless. Below is a patch to use a plugin id
> directly "org.eclipse.xsd.ecore.importer". This seems to coincide with
> the OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.
>
> Could this patch be applied?
>
> Thanks,
> -- Scott
>
>
>
>
> ### Eclipse Workspace Patch 1.0
> #P org.eclipse.xsd.ecore.importer
> Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
> ============================================================ =======
> RCS file:
> /cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
>
> retrieving revision 1.8
> diff -u -r1.8 XSDImporter.java
> --- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec 2005
> 08:00:01 -0000 1.8
> +++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr 2006
> 03:14:12 -0000
> @@ -139,7 +139,7 @@
> List information = (List)i.next();
> diagnostic.add(new BasicDiagnostic(
> "error".equals(information.get(0)) ? Diagnostic.ERROR :
> "warning".equals(information.get(0)) ? Diagnostic.WARNING :
> Diagnostic.INFO,
> -
> XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
> + "org.eclipse.xsd.ecore.importer",
> 0,
> (String)information.get(1),
> null));
Re: XSDImporter.java cannot run headless [message #68021 is a reply to message #68000] Thu, 27 April 2006 16:56 Go to previous messageGo to next message
Scott Hendrickson is currently offline Scott HendricksonFriend
Messages: 69
Registered: July 2009
Member
Yes, you are right. I meant standalone. So, I guess this leads me to the
following question. Is this intended to run standalone? Or, must I
create an application to run the importer.

Thank you,
-- Scott


Ed Merks wrote:
> Scott,
>
> I'm confused. The plugin instances should work properly, i.e., not be
> null, when running headless, since plugin initialization will work the
> same way as running in the GUI. Are you mixing up headless verses
> standalone? The former involves running a registered application and
> the later involves invoking directly from a main().
>
>
> Scott Hendrickson wrote:
>> When converting XSD to ECore headless, I would get a
>> NullPointerException in XSDImporter.java when there were errors or
>> warnings in my schema:
>>
>> Exception in thread "main" java.lang.NullPointerException at
>> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)
>>
>>
>> This was because it was trying to get the plugin instance, which is
>> null when running headless. Below is a patch to use a plugin id
>> directly "org.eclipse.xsd.ecore.importer". This seems to coincide with
>> the OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.
>>
>> Could this patch be applied?
>>
>> Thanks,
>> -- Scott
>>
>>
>>
>>
>> ### Eclipse Workspace Patch 1.0
>> #P org.eclipse.xsd.ecore.importer
>> Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
>> ============================================================ =======
>> RCS file:
>> /cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
>>
>> retrieving revision 1.8
>> diff -u -r1.8 XSDImporter.java
>> --- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec 2005
>> 08:00:01 -0000 1.8
>> +++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr 2006
>> 03:14:12 -0000
>> @@ -139,7 +139,7 @@
>> List information = (List)i.next();
>> diagnostic.add(new BasicDiagnostic(
>> "error".equals(information.get(0)) ? Diagnostic.ERROR :
>> "warning".equals(information.get(0)) ? Diagnostic.WARNING :
>> Diagnostic.INFO,
>> -
>> XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
>> + "org.eclipse.xsd.ecore.importer",
>> 0,
>> (String)information.get(1),
>> null));
Re: XSDImporter.java cannot run headless [message #68042 is a reply to message #68021] Thu, 27 April 2006 17:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Scott,

I was just talking with Marcelo about this. The importer framework was
not designed to run standalone, because none of the generator stuff
worked standalone at the time the importer was designed. But in the EMF
2.2 development cycle we've made all kinds of changes so that in fact
GenModel and the generation support in general can run standalone. So
we'd like to make the importer framework work standalone too (as the new
exporter framework does), but now that we're in the RC shutdown phase,
we simply can't make all the necessary changes. If you open a feature
request, we can try to provide this support during the next cycle.


Scott Hendrickson wrote:
> Yes, you are right. I meant standalone. So, I guess this leads me to
> the following question. Is this intended to run standalone? Or, must I
> create an application to run the importer.
>
> Thank you,
> -- Scott
>
>
> Ed Merks wrote:
>> Scott,
>>
>> I'm confused. The plugin instances should work properly, i.e., not
>> be null, when running headless, since plugin initialization will work
>> the same way as running in the GUI. Are you mixing up headless
>> verses standalone? The former involves running a registered
>> application and the later involves invoking directly from a main().
>>
>>
>> Scott Hendrickson wrote:
>>> When converting XSD to ECore headless, I would get a
>>> NullPointerException in XSDImporter.java when there were errors or
>>> warnings in my schema:
>>>
>>> Exception in thread "main" java.lang.NullPointerException at
>>> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)
>>>
>>>
>>> This was because it was trying to get the plugin instance, which is
>>> null when running headless. Below is a patch to use a plugin id
>>> directly "org.eclipse.xsd.ecore.importer". This seems to coincide
>>> with the OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.
>>>
>>> Could this patch be applied?
>>>
>>> Thanks,
>>> -- Scott
>>>
>>>
>>>
>>>
>>> ### Eclipse Workspace Patch 1.0
>>> #P org.eclipse.xsd.ecore.importer
>>> Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
>>> ============================================================ =======
>>> RCS file:
>>> /cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
>>>
>>> retrieving revision 1.8
>>> diff -u -r1.8 XSDImporter.java
>>> --- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec
>>> 2005 08:00:01 -0000 1.8
>>> +++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr
>>> 2006 03:14:12 -0000
>>> @@ -139,7 +139,7 @@
>>> List information = (List)i.next();
>>> diagnostic.add(new BasicDiagnostic(
>>> "error".equals(information.get(0)) ? Diagnostic.ERROR
>>> : "warning".equals(information.get(0)) ? Diagnostic.WARNING :
>>> Diagnostic.INFO,
>>> -
>>> XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
>>> + "org.eclipse.xsd.ecore.importer",
>>> 0,
>>> (String)information.get(1),
>>> null));
Re: XSDImporter.java cannot run headless [message #68061 is a reply to message #68042] Thu, 27 April 2006 21:28 Go to previous message
Scott Hendrickson is currently offline Scott HendricksonFriend
Messages: 69
Registered: July 2009
Member
Thanks Ed for setting me straight on the terminology. I'm glad to hear
that this is a possibility for a future version. I'll go ahead and open
up a feature request.
-- Scott


Ed Merks wrote:
> Scott,
>
> I was just talking with Marcelo about this. The importer framework was
> not designed to run standalone, because none of the generator stuff
> worked standalone at the time the importer was designed. But in the EMF
> 2.2 development cycle we've made all kinds of changes so that in fact
> GenModel and the generation support in general can run standalone. So
> we'd like to make the importer framework work standalone too (as the new
> exporter framework does), but now that we're in the RC shutdown phase,
> we simply can't make all the necessary changes. If you open a feature
> request, we can try to provide this support during the next cycle.
>
>
> Scott Hendrickson wrote:
>> Yes, you are right. I meant standalone. So, I guess this leads me to
>> the following question. Is this intended to run standalone? Or, must I
>> create an application to run the importer.
>>
>> Thank you,
>> -- Scott
>>
>>
>> Ed Merks wrote:
>>> Scott,
>>>
>>> I'm confused. The plugin instances should work properly, i.e., not
>>> be null, when running headless, since plugin initialization will work
>>> the same way as running in the GUI. Are you mixing up headless
>>> verses standalone? The former involves running a registered
>>> application and the later involves invoking directly from a main().
>>>
>>>
>>> Scott Hendrickson wrote:
>>>> When converting XSD to ECore headless, I would get a
>>>> NullPointerException in XSDImporter.java when there were errors or
>>>> warnings in my schema:
>>>>
>>>> Exception in thread "main" java.lang.NullPointerException at
>>>> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)
>>>>
>>>>
>>>> This was because it was trying to get the plugin instance, which is
>>>> null when running headless. Below is a patch to use a plugin id
>>>> directly "org.eclipse.xsd.ecore.importer". This seems to coincide
>>>> with the OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.
>>>>
>>>> Could this patch be applied?
>>>>
>>>> Thanks,
>>>> -- Scott
>>>>
>>>>
>>>>
>>>>
>>>> ### Eclipse Workspace Patch 1.0
>>>> #P org.eclipse.xsd.ecore.importer
>>>> Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
>>>> ============================================================ =======
>>>> RCS file:
>>>> /cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
>>>>
>>>> retrieving revision 1.8
>>>> diff -u -r1.8 XSDImporter.java
>>>> --- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec
>>>> 2005 08:00:01 -0000 1.8
>>>> +++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr
>>>> 2006 03:14:12 -0000
>>>> @@ -139,7 +139,7 @@
>>>> List information = (List)i.next();
>>>> diagnostic.add(new BasicDiagnostic(
>>>> "error".equals(information.get(0)) ? Diagnostic.ERROR
>>>> : "warning".equals(information.get(0)) ? Diagnostic.WARNING :
>>>> Diagnostic.INFO,
>>>> -
>>>> XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
>>>> + "org.eclipse.xsd.ecore.importer",
>>>> 0,
>>>> (String)information.get(1),
>>>> null));
Re: XSDImporter.java cannot run headless [message #598042 is a reply to message #67978] Thu, 27 April 2006 10:08 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Scott,

I'm confused. The plugin instances should work properly, i.e., not be
null, when running headless, since plugin initialization will work the
same way as running in the GUI. Are you mixing up headless verses
standalone? The former involves running a registered application and
the later involves invoking directly from a main().


Scott Hendrickson wrote:
> When converting XSD to ECore headless, I would get a
> NullPointerException in XSDImporter.java when there were errors or
> warnings in my schema:
>
> Exception in thread "main" java.lang.NullPointerException at
> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)
>
>
> This was because it was trying to get the plugin instance, which is
> null when running headless. Below is a patch to use a plugin id
> directly "org.eclipse.xsd.ecore.importer". This seems to coincide with
> the OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.
>
> Could this patch be applied?
>
> Thanks,
> -- Scott
>
>
>
>
> ### Eclipse Workspace Patch 1.0
> #P org.eclipse.xsd.ecore.importer
> Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
> ============================================================ =======
> RCS file:
> /cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
>
> retrieving revision 1.8
> diff -u -r1.8 XSDImporter.java
> --- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec 2005
> 08:00:01 -0000 1.8
> +++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr 2006
> 03:14:12 -0000
> @@ -139,7 +139,7 @@
> List information = (List)i.next();
> diagnostic.add(new BasicDiagnostic(
> "error".equals(information.get(0)) ? Diagnostic.ERROR :
> "warning".equals(information.get(0)) ? Diagnostic.WARNING :
> Diagnostic.INFO,
> -
> XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
> + "org.eclipse.xsd.ecore.importer",
> 0,
> (String)information.get(1),
> null));


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSDImporter.java cannot run headless [message #598047 is a reply to message #68000] Thu, 27 April 2006 16:56 Go to previous message
Scott Hendrickson is currently offline Scott HendricksonFriend
Messages: 69
Registered: July 2009
Member
Yes, you are right. I meant standalone. So, I guess this leads me to the
following question. Is this intended to run standalone? Or, must I
create an application to run the importer.

Thank you,
-- Scott


Ed Merks wrote:
> Scott,
>
> I'm confused. The plugin instances should work properly, i.e., not be
> null, when running headless, since plugin initialization will work the
> same way as running in the GUI. Are you mixing up headless verses
> standalone? The former involves running a registered application and
> the later involves invoking directly from a main().
>
>
> Scott Hendrickson wrote:
>> When converting XSD to ECore headless, I would get a
>> NullPointerException in XSDImporter.java when there were errors or
>> warnings in my schema:
>>
>> Exception in thread "main" java.lang.NullPointerException at
>> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)
>>
>>
>> This was because it was trying to get the plugin instance, which is
>> null when running headless. Below is a patch to use a plugin id
>> directly "org.eclipse.xsd.ecore.importer". This seems to coincide with
>> the OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.
>>
>> Could this patch be applied?
>>
>> Thanks,
>> -- Scott
>>
>>
>>
>>
>> ### Eclipse Workspace Patch 1.0
>> #P org.eclipse.xsd.ecore.importer
>> Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
>> ============================================================ =======
>> RCS file:
>> /cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
>>
>> retrieving revision 1.8
>> diff -u -r1.8 XSDImporter.java
>> --- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec 2005
>> 08:00:01 -0000 1.8
>> +++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr 2006
>> 03:14:12 -0000
>> @@ -139,7 +139,7 @@
>> List information = (List)i.next();
>> diagnostic.add(new BasicDiagnostic(
>> "error".equals(information.get(0)) ? Diagnostic.ERROR :
>> "warning".equals(information.get(0)) ? Diagnostic.WARNING :
>> Diagnostic.INFO,
>> -
>> XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
>> + "org.eclipse.xsd.ecore.importer",
>> 0,
>> (String)information.get(1),
>> null));
Re: XSDImporter.java cannot run headless [message #598055 is a reply to message #68021] Thu, 27 April 2006 17:45 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Scott,

I was just talking with Marcelo about this. The importer framework was
not designed to run standalone, because none of the generator stuff
worked standalone at the time the importer was designed. But in the EMF
2.2 development cycle we've made all kinds of changes so that in fact
GenModel and the generation support in general can run standalone. So
we'd like to make the importer framework work standalone too (as the new
exporter framework does), but now that we're in the RC shutdown phase,
we simply can't make all the necessary changes. If you open a feature
request, we can try to provide this support during the next cycle.


Scott Hendrickson wrote:
> Yes, you are right. I meant standalone. So, I guess this leads me to
> the following question. Is this intended to run standalone? Or, must I
> create an application to run the importer.
>
> Thank you,
> -- Scott
>
>
> Ed Merks wrote:
>> Scott,
>>
>> I'm confused. The plugin instances should work properly, i.e., not
>> be null, when running headless, since plugin initialization will work
>> the same way as running in the GUI. Are you mixing up headless
>> verses standalone? The former involves running a registered
>> application and the later involves invoking directly from a main().
>>
>>
>> Scott Hendrickson wrote:
>>> When converting XSD to ECore headless, I would get a
>>> NullPointerException in XSDImporter.java when there were errors or
>>> warnings in my schema:
>>>
>>> Exception in thread "main" java.lang.NullPointerException at
>>> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)
>>>
>>>
>>> This was because it was trying to get the plugin instance, which is
>>> null when running headless. Below is a patch to use a plugin id
>>> directly "org.eclipse.xsd.ecore.importer". This seems to coincide
>>> with the OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.
>>>
>>> Could this patch be applied?
>>>
>>> Thanks,
>>> -- Scott
>>>
>>>
>>>
>>>
>>> ### Eclipse Workspace Patch 1.0
>>> #P org.eclipse.xsd.ecore.importer
>>> Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
>>> ============================================================ =======
>>> RCS file:
>>> /cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
>>>
>>> retrieving revision 1.8
>>> diff -u -r1.8 XSDImporter.java
>>> --- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec
>>> 2005 08:00:01 -0000 1.8
>>> +++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr
>>> 2006 03:14:12 -0000
>>> @@ -139,7 +139,7 @@
>>> List information = (List)i.next();
>>> diagnostic.add(new BasicDiagnostic(
>>> "error".equals(information.get(0)) ? Diagnostic.ERROR
>>> : "warning".equals(information.get(0)) ? Diagnostic.WARNING :
>>> Diagnostic.INFO,
>>> -
>>> XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
>>> + "org.eclipse.xsd.ecore.importer",
>>> 0,
>>> (String)information.get(1),
>>> null));


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSDImporter.java cannot run headless [message #598061 is a reply to message #68042] Thu, 27 April 2006 21:28 Go to previous message
Scott Hendrickson is currently offline Scott HendricksonFriend
Messages: 69
Registered: July 2009
Member
Thanks Ed for setting me straight on the terminology. I'm glad to hear
that this is a possibility for a future version. I'll go ahead and open
up a feature request.
-- Scott


Ed Merks wrote:
> Scott,
>
> I was just talking with Marcelo about this. The importer framework was
> not designed to run standalone, because none of the generator stuff
> worked standalone at the time the importer was designed. But in the EMF
> 2.2 development cycle we've made all kinds of changes so that in fact
> GenModel and the generation support in general can run standalone. So
> we'd like to make the importer framework work standalone too (as the new
> exporter framework does), but now that we're in the RC shutdown phase,
> we simply can't make all the necessary changes. If you open a feature
> request, we can try to provide this support during the next cycle.
>
>
> Scott Hendrickson wrote:
>> Yes, you are right. I meant standalone. So, I guess this leads me to
>> the following question. Is this intended to run standalone? Or, must I
>> create an application to run the importer.
>>
>> Thank you,
>> -- Scott
>>
>>
>> Ed Merks wrote:
>>> Scott,
>>>
>>> I'm confused. The plugin instances should work properly, i.e., not
>>> be null, when running headless, since plugin initialization will work
>>> the same way as running in the GUI. Are you mixing up headless
>>> verses standalone? The former involves running a registered
>>> application and the later involves invoking directly from a main().
>>>
>>>
>>> Scott Hendrickson wrote:
>>>> When converting XSD to ECore headless, I would get a
>>>> NullPointerException in XSDImporter.java when there were errors or
>>>> warnings in my schema:
>>>>
>>>> Exception in thread "main" java.lang.NullPointerException at
>>>> org.eclipse.xsd.ecore.importer.XSDImporter.doComputeEPackage s(XSDImporter.java:142)
>>>>
>>>>
>>>> This was because it was trying to get the plugin instance, which is
>>>> null when running headless. Below is a patch to use a plugin id
>>>> directly "org.eclipse.xsd.ecore.importer". This seems to coincide
>>>> with the OK_INSTANCE and CANCEL_INSTANCE in Diagnostic.java.
>>>>
>>>> Could this patch be applied?
>>>>
>>>> Thanks,
>>>> -- Scott
>>>>
>>>>
>>>>
>>>>
>>>> ### Eclipse Workspace Patch 1.0
>>>> #P org.eclipse.xsd.ecore.importer
>>>> Index: src/org/eclipse/xsd/ecore/importer/XSDImporter.java
>>>> ============================================================ =======
>>>> RCS file:
>>>> /cvsroot/tools/org.eclipse.xsd/plugins/org.eclipse.xsd.ecore .importer/src/org/eclipse/xsd/ecore/importer/XSDImporter.jav a,v
>>>>
>>>> retrieving revision 1.8
>>>> diff -u -r1.8 XSDImporter.java
>>>> --- src/org/eclipse/xsd/ecore/importer/XSDImporter.java 14 Dec
>>>> 2005 08:00:01 -0000 1.8
>>>> +++ src/org/eclipse/xsd/ecore/importer/XSDImporter.java 27 Apr
>>>> 2006 03:14:12 -0000
>>>> @@ -139,7 +139,7 @@
>>>> List information = (List)i.next();
>>>> diagnostic.add(new BasicDiagnostic(
>>>> "error".equals(information.get(0)) ? Diagnostic.ERROR
>>>> : "warning".equals(information.get(0)) ? Diagnostic.WARNING :
>>>> Diagnostic.INFO,
>>>> -
>>>> XSDImporterPlugin.getPlugin().getBundle().getSymbolicName(),
>>>> + "org.eclipse.xsd.ecore.importer",
>>>> 0,
>>>> (String)information.get(1),
>>>> null));
Previous Topic:XSDImporter.java cannot run headless
Next Topic:XML Generation and element hiding
Goto Forum:
  


Current Time: Fri Apr 19 20:13:24 GMT 2024

Powered by FUDForum. Page generated in 0.04404 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top