Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » References in multiple ecores using . giving exception
References in multiple ecores using . giving exception [message #418044] Thu, 03 April 2008 15:16 Go to next message
Eclipse UserFriend
Originally posted by: hkumar.agrawal.gmail.com

Hi,

We have a functionality where we generate multiple ecores with one ecore referring the other. The ecores are loaded fine into the resource set. If the reference has a relative path (i.e. of the form ./second.ecore#//second) then we get the following exception while generating the genmodel (during its initialization):

java.lang.NullPointerException
at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.h asExtendedMetaData(GenPackageImpl.java:3984)
at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.i nitialize(GenPackageImpl.java:2473)
at org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl.ini tialize(GenModelImpl.java:1927)

Digging a bit into the code, we run into a TreeIterator which was difficult to follow after a point !

Note that if we change the reference to be an absolute project path (i.e. /project/folder/second.ecore#//second) then the error goes away and everything is fine.

Is there something that we are missing here ? Do we have set some property during the generation / initialization of the genmodel ?

Thanks in advance.

-Hemant
Re: References in multiple ecores using . giving exception [message #418046 is a reply to message #418044] Thu, 03 April 2008 15:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Hemant,

You should use platform:/resource/project/whatever.genmodel to load your
resource, not "/project/whatever.genmodel", otherwise all relative URIs
won't resolve properly. I.e., it's best to use
URI.createPlatformResourceURI when creating a URI for something in the
workspace.


Hemant wrote:
> Hi,
>
> We have a functionality where we generate multiple ecores with one ecore referring the other. The ecores are loaded fine into the resource set. If the reference has a relative path (i.e. of the form ./second.ecore#//second) then we get the following exception while generating the genmodel (during its initialization):
>
> java.lang.NullPointerException
> at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.h asExtendedMetaData(GenPackageImpl.java:3984)
> at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.i nitialize(GenPackageImpl.java:2473)
> at org.eclipse.emf.codegen.ecore.genmodel.impl.GenModelImpl.ini tialize(GenModelImpl.java:1927)
>
> Digging a bit into the code, we run into a TreeIterator which was difficult to follow after a point !
>
> Note that if we change the reference to be an absolute project path (i.e. /project/folder/second.ecore#//second) then the error goes away and everything is fine.
>
> Is there something that we are missing here ? Do we have set some property during the generation / initialization of the genmodel ?
>
> Thanks in advance.
>
> -Hemant
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: References in multiple ecores using . giving exception [message #418196 is a reply to message #418046] Fri, 04 April 2008 16:23 Go to previous message
Eclipse UserFriend
Originally posted by: hkumar.agrawal.gmail.com

Hi Ed,

Thanks for this. It works.

-Hemant
Previous Topic:Memory leak in UndoActionWrapper / RedoActionWrapper
Next Topic:Aliasing model features
Goto Forum:
  


Current Time: Sat Apr 20 03:11:12 GMT 2024

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

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

Back to the top