Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem resolving reference to another ecore file (null fields) [SOLVED](Loading resource which has reference to another one loads proxy properly, but values are null)
Problem resolving reference to another ecore file (null fields) [SOLVED] [message #703269] Wed, 27 July 2011 11:24 Go to next message
Lukas Zaruba is currently offline Lukas ZarubaFriend
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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/
Re: Problem resolving reference to another ecore file (null fields) [message #704133 is a reply to message #703453] Thu, 28 July 2011 10:01 Go to previous message
Lukas Zaruba is currently offline Lukas ZarubaFriend
Messages: 8
Registered: January 2010
Junior Member
Hi,
I found the problem and it was not in ecore at all.
Somebody from support just messed up content of loaded xmi file in the strange way resulting in successful loading of the file but errors afterwards. (I didn't expect emf to load property which should be "path" from xmi when it looks like path=path="....." Smile )

About nulls and proxy resolving... After deeper debugging of the project, I finally found the place on which proxy object is replaced by real object on the first access to its data and it works just fine.

So I am sorry for wasting your precious time on this stupid mistake. And thank you for the quick reply.

Best

Lukas
Previous Topic:[CDO] query cdo objects on server side for ReadAccess
Next Topic:Teneo and EclipseLink 2.3.0
Goto Forum:
  


Current Time: Fri Apr 26 14:06:19 GMT 2024

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

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

Back to the top