Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » failed to read genmodel
failed to read genmodel [message #389593] Mon, 29 November 2004 19:34 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
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/
Re: failed to read genmodel [message #1856529 is a reply to message #389594] Wed, 14 December 2022 09:01 Go to previous messageGo to next message
Arnault Bonafos is currently offline Arnault BonafosFriend
Messages: 5
Registered: November 2022
Junior Member
Hello,

Do you have pointers as to where I can find the FAQ about running standalone ?

Thanks.
Re: failed to read genmodel [message #1856533 is a reply to message #1856529] Wed, 14 December 2022 10:34 Go to previous message
Arnault Bonafos is currently offline Arnault BonafosFriend
Messages: 5
Registered: November 2022
Junior Member
To answer my own question, this is part of a bigger FAQ:
https://wiki.eclipse.org/EMF/FAQ#How_do_I_use_EMF_in_standalone_applications_.28such_as_an_ordinary_main.29.3F

HTH.
Previous Topic:load model from xmi file
Next Topic:modifying xmi model file
Goto Forum:
  


Current Time: Thu May 02 09:02:07 GMT 2024

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

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

Back to the top