failed to read genmodel [message #389593] |
Mon, 29 November 2004 19:34 |
Eclipse User |
|
|
|
Originally posted by: roger.wegner.web.de
Hi,
I want to read library.genmodel programmatically and tried to read it
similar to reading library.ecore. The following succeeds:
------------------------------------------------------------ ----------
Resource.Factory.Registry .put("ecore", new
XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
this.resource =
resourceSet.getResource(URI.createURI("file:///D:/.../library.ecore"),
true);
------------------------------------------------------------ ----------
But when I change this to
------------------------------------------------------------ ----------
Resource.Factory.Registry .put("genmodel", new
XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();
this.resource =
resourceSet.getResource(URI.createURI("file:///D:/.../library.genmodel"),
true);
------------------------------------------------------------ -----------
I receive an exception like:
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
'http://www.eclipse.org/emf/2002/GenModel' not found.
(file:///D:/.../library.genmodel, 7, 111)
Maybe the above approach is completely wrong. Can anybody give some hints?
Thanx,
Roger
|
|
|
Re: failed to read genmodel [message #389594 is a reply to message #389593] |
Mon, 29 November 2004 19:51 |
Ed Merks Messages: 33210 Registered: July 2009 |
Senior Member |
|
|
Roger,
It sounds like you are trying to use the org.eclipse.emf.codegen.ecore
plugin while running stand alone, but that plugin is not designed to run
standalone, so you may not be able to get it to work. Accessing
GenModel.eINSTANCE before you try to parse will help. (Check out the
FAQ about running standalone.)
Roger Wegner wrote:
> Hi,
>
> I want to read library.genmodel programmatically and tried to read it
> similar to reading library.ecore. The following succeeds:
> ------------------------------------------------------------ ----------
> Resource.Factory.Registry .put("ecore",
> new XMIResourceFactoryImpl());
>
> ResourceSet resourceSet = new ResourceSetImpl();
>
> this.resource =
> resourceSet.getResource(URI.createURI("file:///D:/.../library.ecore"),
> true);
> ------------------------------------------------------------ ----------
>
> But when I change this to
> ------------------------------------------------------------ ----------
> Resource.Factory.Registry .put("genmodel",
> new XMIResourceFactoryImpl());
>
> ResourceSet resourceSet = new ResourceSetImpl();
>
> this.resource =
> resourceSet.getResource(URI.createURI("file:///D:/.../library.genmodel"),
> true);
> ------------------------------------------------------------ -----------
> I receive an exception like:
>
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'http://www.eclipse.org/emf/2002/GenModel' not found.
> (file:///D:/.../library.genmodel, 7, 111)
>
> Maybe the above approach is completely wrong. Can anybody give some
> hints?
>
> Thanx,
>
> Roger
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: failed to read genmodel [message #389597 is a reply to message #389594] |
Mon, 29 November 2004 20:54 |
Eclipse User |
|
|
|
Originally posted by: roger.wegner.web.de
I try to generate some hibernate stuff (mapping files and other things)
with JET and hope to be able to use a GenModel instance similarly to
EMF's Class.javajet without depending on eclipse and/or it's plugins
(eclipse or plugin jar files in the classpath are ok for me).
It seems that GenModel and all those GenXXX classes provide the most
complete and convenient means to access all (or almost all) model
information for generating the mentioned things.
Do you think this is a feasible approach? Are there better alternatives?
Roger
Ed Merks wrote:
> Roger,
>
> It sounds like you are trying to use the org.eclipse.emf.codegen.ecore
> plugin while running stand alone, but that plugin is not designed to run
> standalone, so you may not be able to get it to work. Accessing
> GenModel.eINSTANCE before you try to parse will help. (Check out the
> FAQ about running standalone.)
>
>
> Roger Wegner wrote:
>
>> Hi,
>>
>> I want to read library.genmodel programmatically and tried to read it
>> similar to reading library.ecore. The following succeeds:
>> ------------------------------------------------------------ ----------
>> Resource.Factory.Registry .put("ecore",
>> new XMIResourceFactoryImpl());
>>
>> ResourceSet resourceSet = new ResourceSetImpl();
>>
>> this.resource =
>> resourceSet.getResource(URI.createURI("file:///D:/.../library.ecore"),
>> true);
>> ------------------------------------------------------------ ----------
>>
>> But when I change this to
>> ------------------------------------------------------------ ----------
>> Resource.Factory.Registry .put("genmodel",
>> new XMIResourceFactoryImpl());
>>
>> ResourceSet resourceSet = new ResourceSetImpl();
>>
>> this.resource =
>> resourceSet.getResource(URI.createURI("file:///D:/.../library.genmodel"),
>> true);
>> ------------------------------------------------------------ -----------
>> I receive an exception like:
>>
>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
>> 'http://www.eclipse.org/emf/2002/GenModel' not found.
>> (file:///D:/.../library.genmodel, 7, 111)
>>
>> Maybe the above approach is completely wrong. Can anybody give some
>> hints?
>>
>> Thanx,
>>
>> Roger
>
>
|
|
|
Re: failed to read genmodel [message #389598 is a reply to message #389597] |
Mon, 29 November 2004 22:44 |
Ed Merks Messages: 33210 Registered: July 2009 |
Senior Member |
|
|
Roger,
Since the plugins aren't designed to run standalone, I think it will
probably not work.
Can't you just treat eclipse as a really big executable? ;-) I.e.,
can't you run it headless to provide a command line utility the way we
do for all our command line support?
Roger Wegner wrote:
> I try to generate some hibernate stuff (mapping files and other
> things) with JET and hope to be able to use a GenModel instance
> similarly to EMF's Class.javajet without depending on eclipse and/or
> it's plugins (eclipse or plugin jar files in the classpath are ok for
> me).
>
> It seems that GenModel and all those GenXXX classes provide the most
> complete and convenient means to access all (or almost all) model
> information for generating the mentioned things.
>
> Do you think this is a feasible approach? Are there better alternatives?
>
> Roger
>
>
> Ed Merks wrote:
>
>> Roger,
>>
>> It sounds like you are trying to use the
>> org.eclipse.emf.codegen.ecore plugin while running stand alone, but
>> that plugin is not designed to run standalone, so you may not be able
>> to get it to work. Accessing GenModel.eINSTANCE before you try to
>> parse will help. (Check out the FAQ about running standalone.)
>>
>>
>> Roger Wegner wrote:
>>
>>> Hi,
>>>
>>> I want to read library.genmodel programmatically and tried to read
>>> it similar to reading library.ecore. The following succeeds:
>>> ------------------------------------------------------------ ----------
>>> Resource.Factory.Registry .put("ecore",
>>> new XMIResourceFactoryImpl());
>>>
>>> ResourceSet resourceSet = new ResourceSetImpl();
>>>
>>> this.resource =
>>> resourceSet.getResource(URI.createURI("file:///D:/.../library.ecore"),
>>> true);
>>> ------------------------------------------------------------ ----------
>>>
>>> But when I change this to
>>> ------------------------------------------------------------ ----------
>>> Resource.Factory.Registry
>>> .put("genmodel", new XMIResourceFactoryImpl());
>>>
>>> ResourceSet resourceSet = new ResourceSetImpl();
>>>
>>> this.resource =
>>> resourceSet.getResource(URI.createURI("file:///D:/.../library.genmodel"),
>>> true);
>>> ------------------------------------------------------------ -----------
>>> I receive an exception like:
>>>
>>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
>>> 'http://www.eclipse.org/emf/2002/GenModel' not found.
>>> (file:///D:/.../library.genmodel, 7, 111)
>>>
>>> Maybe the above approach is completely wrong. Can anybody give some
>>> hints?
>>>
>>> Thanx,
>>>
>>> Roger
>>
>>
>>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02993 seconds