Problem resolving reference to another ecore file (null fields) [SOLVED] [message #703269] |
Wed, 27 July 2011 11:24 |
Lukas Zaruba Messages: 8 Registered: January 2010 |
Junior Member |
|
|
Hi, I ran into the problem with EMF which is kind of over my head, so I will appreciate any advice.
I am loading resource on some URI on resource set. This resource has reference to another resource (xmi file). I have been using this construct for two years with no problems on different platforms. But now when I load the resource, content of the reference on the eobject is some proxy (so far so good) but it contains no data (only nulls everywhere except from parent object reference).
Strange is that if I create the resource (if it doesn't exist), fill it with default configuration, save it and than load it (using the same code as discribed before), it works. But after restart of the application (files are now ready) it fails with the previous problem (those nulls).
It happens on the Windows server 2008 64bit with java 1.6 latest version. Same build of the application works properly everywhere else.
Do somebody please know, what is going on there?
Thank you
Best
LZ
[Updated on: Thu, 28 July 2011 10:02] Report message to a moderator
|
|
|
Re: Problem resolving reference to another ecore file (null fields) [message #703453 is a reply to message #703269] |
Wed, 27 July 2011 15:07 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Lukas,
Comments below.
On 27/07/2011 4:24 AM, Lukas Zaruba wrote:
> Hi, I ran into the problem with EMF which is kind of over my head, so
> I will appreciate any advice. I am loading resource on some URI on
> resource set. This resource has reference to another resource (xmi file).
Hopefully you're using an absolute URI to load the resource....
> I have been using this construct for two years with no problems on
> different platforms. But now when I load the resource, content of the
> reference on the eobject is some proxy (so far so good) but it
> contains no data (only nulls everywhere except from parent object
> reference).
An unresolved proxy...
> Strange is that if I create the resource (if it doesn't exist), fill
> it with default configuration, save it and than load it (using the
> same code as discribed before), it works. But after restart of the
> application (files are now ready) it fails with the previous problem
> (those nulls). It happens on the Windows server 2008 64bit with java
> 1.6 latest version. Same build of the application works properly
> everywhere else.
>
> Do somebody please know, what is going on there?
It's not entirely clear, but here's what you should consider. Determine
the proxy URI of the object: you can cast to InternalEObject to call
eProxyURI or better, look at the value in the debugger. Does that URI
look right? When an attempt is made to resolve the proxy, the resource
set will try to load the resource. Even if that fails, you should see a
corresponding resource in the resource set with that URI (with the
fragment trimmed off). Do you see that resource? Is it empty? If it
entirely failed to load, you should see a reason for the failure
recorded in Resource.getErrors().
>
> Thank you
>
> Best
>
> LZ
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02727 seconds