Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF external reference issue
EMF external reference issue [message #1276425] Mon, 24 March 2014 14:47 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,

I am storing a model over several XMI based resources.


In one specific case, I have a non-containment reference from an object
in Resource A [1] to an object from Resource B. [2]

Now I am accessing an attribute which is clearly set in Resource B (and
also persisted as <messages name="INVITE"/> ), but the call
objectA.eGet(FEATURE_NAME) returns null.


Any idea why this would be?

Thx Christophe

[1] Resource A: (The message element refers to an object in Resource B).

<?xml version="1.0" encoding="ASCII"?>
<services:ServiceFlow xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:services="http://www.netxforge.com/06032012/services" name="Basic
SIP Flow">
<serviceFlowRelationships direction="LEFT_TO_RIGHT">
<referenceRelationship href="library.library#//@refRelationships.0"/>
<protocol href="protocols.protocols#/0"/>
<message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
</serviceFlowRelationships>
<serviceFlowRelationships>
<referenceRelationship href="library.library#//@refRelationships.1"/>
<protocol href="protocols.protocols#/0"/>
<message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
</serviceFlowRelationships>
</services:ServiceFlow>


[2] Resource B:


<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:protocols="http://www.netxforge.com/06032012/protocols">
<protocols:Protocol name="SIP">
<procedures name="ALL">
<messages name="INVITE"/>
<messages name="RINGING"/>
<messages name="OK"/>
<messages name="TRYING"/>
</procedures>
</protocols:Protocol>
<protocols:Protocol name="ISUP"/>
</xmi:XMI>
Re: EMF external reference issue [message #1276429 is a reply to message #1276425] Mon, 24 March 2014 14:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Christophe,

Comments below.

On 24/03/2014 7:47 AM, Christophe Bouhier wrote:
> Hi,
>
> I am storing a model over several XMI based resources.
>
>
> In one specific case, I have a non-containment reference from an
> object in Resource A [1] to an object from Resource B. [2]
>
> Now I am accessing an attribute which is clearly set in Resource B
> (and also persisted as <messages name="INVITE"/> ), but the call
> objectA.eGet(FEATURE_NAME) returns null.
>
>
> Any idea why this would be?
It sounds like an unresolved proxy. What URIs did you use at the point
when you saved? (Hopefully absolute URIs with an absolute path.) What
URI did you use the load the model later? Again, hopefully an absolute
URI with an absolute path. In the code where the proxy fails to
resolve, what resources exist in the resource set, what URIs do they
have, and do any of them have clues in their Resource.getErrors()?
>
> Thx Christophe
>
> [1] Resource A: (The message element refers to an object in Resource B).
>
> <?xml version="1.0" encoding="ASCII"?>
> <services:ServiceFlow xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:services="http://www.netxforge.com/06032012/services"
> name="Basic SIP Flow">
> <serviceFlowRelationships direction="LEFT_TO_RIGHT">
> <referenceRelationship href="library.library#//@refRelationships.0"/>
> <protocol href="protocols.protocols#/0"/>
> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
> </serviceFlowRelationships>
> <serviceFlowRelationships>
> <referenceRelationship href="library.library#//@refRelationships.1"/>
> <protocol href="protocols.protocols#/0"/>
> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
> </serviceFlowRelationships>
> </services:ServiceFlow>
>
>
> [2] Resource B:
>
>
> <?xml version="1.0" encoding="ASCII"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:protocols="http://www.netxforge.com/06032012/protocols">
> <protocols:Protocol name="SIP">
> <procedures name="ALL">
> <messages name="INVITE"/>
> <messages name="RINGING"/>
> <messages name="OK"/>
> <messages name="TRYING"/>
> </procedures>
> </protocols:Protocol>
> <protocols:Protocol name="ISUP"/>
> </xmi:XMI>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF external reference issue [message #1276450 is a reply to message #1276429] Mon, 24 March 2014 15:21 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Ed,
See inline below.

On 24-03-14 15:54, Ed Merks wrote:
> Christophe,
>
> Comments below.
>
> On 24/03/2014 7:47 AM, Christophe Bouhier wrote:
>> Hi,
>>
>> I am storing a model over several XMI based resources.
>>
>>
>> In one specific case, I have a non-containment reference from an
>> object in Resource A [1] to an object from Resource B. [2]
>>
>> Now I am accessing an attribute which is clearly set in Resource B
>> (and also persisted as <messages name="INVITE"/> ), but the call
>> objectA.eGet(FEATURE_NAME) returns null.
>>
>>
>> Any idea why this would be?
> It sounds like an unresolved proxy. What URIs did you use at the point
> when you saved? (Hopefully absolute URIs with an absolute path.)
All my resources are created with absolute URI

/user.home/package.extension with URI.createFileURI(path/package.extension).

they all end up in the same ResourceSet. Shoudn't the HRef in the
persisted model also use absolute URI's?

What
> URI did you use the load the model later? Again, hopefully an absolute
> URI with an absolute path.
Loading uses the same mechanim:
/user.home/package.extenstion with URI.createFileURI
they all end up in the same ResourceSet



In the code where the proxy fails to
> resolve, what resources exist in the resource set,
I notice the 2nd resource is not in the resource set when loading the
first resource. The first resource has URI:

file:/Users/Christophe/services.services


I have tried loading resource B first, but this doesn't solve the
problem. In this case the set is loaded with both resources with both
absolute URI's.

com.netxforge.netxstudio.protocols.util.ProtocolsResourceImpl@4df42219
uri='file:/Users/Christophe/protocols.protocols'

com.netxforge.netxstudio.services.util.ServicesResourceImpl@fc54456
uri='file:/Users/Christophe/services.services'

> what URIs do they
> have, and do any of them have clues in their Resource.getErrors()?
No Errors...
>>
>> Thx Christophe
>>
>> [1] Resource A: (The message element refers to an object in Resource B).
>>
>> <?xml version="1.0" encoding="ASCII"?>
>> <services:ServiceFlow xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:services="http://www.netxforge.com/06032012/services"
>> name="Basic SIP Flow">
>> <serviceFlowRelationships direction="LEFT_TO_RIGHT">
>> <referenceRelationship href="library.library#//@refRelationships.0"/>
>> <protocol href="protocols.protocols#/0"/>
>> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>> </serviceFlowRelationships>
>> <serviceFlowRelationships>
>> <referenceRelationship href="library.library#//@refRelationships.1"/>
>> <protocol href="protocols.protocols#/0"/>
>> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>> </serviceFlowRelationships>
>> </services:ServiceFlow>
>>
>>
>> [2] Resource B:
>>
>>
>> <?xml version="1.0" encoding="ASCII"?>
>> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:protocols="http://www.netxforge.com/06032012/protocols">
>> <protocols:Protocol name="SIP">
>> <procedures name="ALL">
>> <messages name="INVITE"/>
>> <messages name="RINGING"/>
>> <messages name="OK"/>
>> <messages name="TRYING"/>
>> </procedures>
>> </protocols:Protocol>
>> <protocols:Protocol name="ISUP"/>
>> </xmi:XMI>
>>
>
Re: EMF external reference issue [message #1276460 is a reply to message #1276450] Mon, 24 March 2014 15:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Christophe,

Comments below.

On 24/03/2014 8:21 AM, Christophe Bouhier wrote:
> Ed,
> See inline below.
>
> On 24-03-14 15:54, Ed Merks wrote:
>> Christophe,
>>
>> Comments below.
>>
>> On 24/03/2014 7:47 AM, Christophe Bouhier wrote:
>>> Hi,
>>>
>>> I am storing a model over several XMI based resources.
>>>
>>>
>>> In one specific case, I have a non-containment reference from an
>>> object in Resource A [1] to an object from Resource B. [2]
>>>
>>> Now I am accessing an attribute which is clearly set in Resource B
>>> (and also persisted as <messages name="INVITE"/> ), but the call
>>> objectA.eGet(FEATURE_NAME) returns null.
>>>
>>>
>>> Any idea why this would be?
>> It sounds like an unresolved proxy. What URIs did you use at the point
>> when you saved? (Hopefully absolute URIs with an absolute path.)
> All my resources are created with absolute URI
>
> /user.home/package.extension with
> URI.createFileURI(path/package.extension).
>
> they all end up in the same ResourceSet. Shoudn't the HRef in the
> persisted model also use absolute URI's?
No, they'll generally be made relative if there is a relative path
between the two absolute paths...
>
> What
>> URI did you use the load the model later? Again, hopefully an absolute
>> URI with an absolute path.
> Loading uses the same mechanim:
> /user.home/package.extenstion with URI.createFileURI
> they all end up in the same ResourceSet
>
>
>
> In the code where the proxy fails to
>> resolve, what resources exist in the resource set,
> I notice the 2nd resource is not in the resource set when loading the
> first resource. The first resource has URI:
>
> file:/Users/Christophe/services.services
>
>
> I have tried loading resource B first, but this doesn't solve the
> problem. In this case the set is loaded with both resources with both
> absolute URI's.
>
> com.netxforge.netxstudio.protocols.util.ProtocolsResourceImpl@4df42219
> uri='file:/Users/Christophe/protocols.protocols'
>
> com.netxforge.netxstudio.services.util.ServicesResourceImpl@fc54456
> uri='file:/Users/Christophe/services.services'
>
> > what URIs do they
>> have, and do any of them have clues in their Resource.getErrors()?
> No Errors...
Is it a proxy resolving reference? You can debug how you retrieve
objectA. If it's a proxy, there should be an attempt to resolve it.
That should normally, at a minimum, result in a resource being loaded
into the resource set. But you say even that doesn't occur. You'll need
to look closely why...
>>>
>>> Thx Christophe
>>>
>>> [1] Resource A: (The message element refers to an object in Resource
>>> B).
>>>
>>> <?xml version="1.0" encoding="ASCII"?>
>>> <services:ServiceFlow xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:services="http://www.netxforge.com/06032012/services"
>>> name="Basic SIP Flow">
>>> <serviceFlowRelationships direction="LEFT_TO_RIGHT">
>>> <referenceRelationship
>>> href="library.library#//@refRelationships.0"/>
>>> <protocol href="protocols.protocols#/0"/>
>>> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>>> </serviceFlowRelationships>
>>> <serviceFlowRelationships>
>>> <referenceRelationship
>>> href="library.library#//@refRelationships.1"/>
>>> <protocol href="protocols.protocols#/0"/>
>>> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>>> </serviceFlowRelationships>
>>> </services:ServiceFlow>
>>>
>>>
>>> [2] Resource B:
>>>
>>>
>>> <?xml version="1.0" encoding="ASCII"?>
>>> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:protocols="http://www.netxforge.com/06032012/protocols">
>>> <protocols:Protocol name="SIP">
>>> <procedures name="ALL">
>>> <messages name="INVITE"/>
>>> <messages name="RINGING"/>
>>> <messages name="OK"/>
>>> <messages name="TRYING"/>
>>> </procedures>
>>> </protocols:Protocol>
>>> <protocols:Protocol name="ISUP"/>
>>> </xmi:XMI>
>>>
>>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF external reference issue [message #1276468 is a reply to message #1276460] Mon, 24 March 2014 15:52 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
" Is it a proxy resolving reference? You can debug how you retrieve
objectA. If it's a proxy, there should be an attempt to resolve it.
That should normally, at a minimum, result in a resource being loaded
into the resource set. But you say even that doesn't occur. You'll need
to look closely why... "

I would expect it to be a proxy resolve, but I have not configured
anything (purposely I mean), but indeed JDT Is my friend :-) What would
be a good starting point for debugging? XMILoadImpl? Or perhaps the
attributes get() method?


On 24-03-14 16:35, Ed Merks wrote:
> Christophe,
>
> Comments below.
>
> On 24/03/2014 8:21 AM, Christophe Bouhier wrote:
>> Ed,
>> See inline below.
>>
>> On 24-03-14 15:54, Ed Merks wrote:
>>> Christophe,
>>>
>>> Comments below.
>>>
>>> On 24/03/2014 7:47 AM, Christophe Bouhier wrote:
>>>> Hi,
>>>>
>>>> I am storing a model over several XMI based resources.
>>>>
>>>>
>>>> In one specific case, I have a non-containment reference from an
>>>> object in Resource A [1] to an object from Resource B. [2]
>>>>
>>>> Now I am accessing an attribute which is clearly set in Resource B
>>>> (and also persisted as <messages name="INVITE"/> ), but the call
>>>> objectA.eGet(FEATURE_NAME) returns null.
>>>>
>>>>
>>>> Any idea why this would be?
>>> It sounds like an unresolved proxy. What URIs did you use at the point
>>> when you saved? (Hopefully absolute URIs with an absolute path.)
>> All my resources are created with absolute URI
>>
>> /user.home/package.extension with
>> URI.createFileURI(path/package.extension).
>>
>> they all end up in the same ResourceSet. Shoudn't the HRef in the
>> persisted model also use absolute URI's?
> No, they'll generally be made relative if there is a relative path
> between the two absolute paths...
>>
>> What
>>> URI did you use the load the model later? Again, hopefully an absolute
>>> URI with an absolute path.
>> Loading uses the same mechanim:
>> /user.home/package.extenstion with URI.createFileURI
>> they all end up in the same ResourceSet
>>
>>
>>
>> In the code where the proxy fails to
>>> resolve, what resources exist in the resource set,
>> I notice the 2nd resource is not in the resource set when loading the
>> first resource. The first resource has URI:
>>
>> file:/Users/Christophe/services.services
>>
>>
>> I have tried loading resource B first, but this doesn't solve the
>> problem. In this case the set is loaded with both resources with both
>> absolute URI's.
>>
>> com.netxforge.netxstudio.protocols.util.ProtocolsResourceImpl@4df42219
>> uri='file:/Users/Christophe/protocols.protocols'
>>
>> com.netxforge.netxstudio.services.util.ServicesResourceImpl@fc54456
>> uri='file:/Users/Christophe/services.services'
>>
>> > what URIs do they
>>> have, and do any of them have clues in their Resource.getErrors()?
>> No Errors...
> Is it a proxy resolving reference? You can debug how you retrieve
> objectA. If it's a proxy, there should be an attempt to resolve it.
> That should normally, at a minimum, result in a resource being loaded
> into the resource set. But you say even that doesn't occur. You'll need
> to look closely why...
>>>>
>>>> Thx Christophe
>>>>
>>>> [1] Resource A: (The message element refers to an object in Resource
>>>> B).
>>>>
>>>> <?xml version="1.0" encoding="ASCII"?>
>>>> <services:ServiceFlow xmi:version="2.0"
>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>> xmlns:services="http://www.netxforge.com/06032012/services"
>>>> name="Basic SIP Flow">
>>>> <serviceFlowRelationships direction="LEFT_TO_RIGHT">
>>>> <referenceRelationship
>>>> href="library.library#//@refRelationships.0"/>
>>>> <protocol href="protocols.protocols#/0"/>
>>>> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>>>> </serviceFlowRelationships>
>>>> <serviceFlowRelationships>
>>>> <referenceRelationship
>>>> href="library.library#//@refRelationships.1"/>
>>>> <protocol href="protocols.protocols#/0"/>
>>>> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>>>> </serviceFlowRelationships>
>>>> </services:ServiceFlow>
>>>>
>>>>
>>>> [2] Resource B:
>>>>
>>>>
>>>> <?xml version="1.0" encoding="ASCII"?>
>>>> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>>> xmlns:protocols="http://www.netxforge.com/06032012/protocols">
>>>> <protocols:Protocol name="SIP">
>>>> <procedures name="ALL">
>>>> <messages name="INVITE"/>
>>>> <messages name="RINGING"/>
>>>> <messages name="OK"/>
>>>> <messages name="TRYING"/>
>>>> </procedures>
>>>> </protocols:Protocol>
>>>> <protocols:Protocol name="ISUP"/>
>>>> </xmi:XMI>
>>>>
>>>
>>
>
Re: EMF external reference issue [message #1276471 is a reply to message #1276468] Mon, 24 March 2014 15:59 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 24-03-14 16:52, Christophe Bouhier wrote:
>
> " Is it a proxy resolving reference? You can debug how you retrieve
> objectA. If it's a proxy, there should be an attempt to resolve it.
> That should normally, at a minimum, result in a resource being loaded
> into the resource set. But you say even that doesn't occur. You'll need
> to look closely why... "
>
> I would expect it to be a proxy resolve, but I have not configured
> anything (purposely I mean), but indeed JDT Is my friend :-) What would
> be a good starting point for debugging? XMILoadImpl? Or perhaps the
> attributes get() method?

which made me think about this feature .... "Resolve Proxies...".
I turned it on for this EReference and bang... My attributes are loaded... !
Bummer, working with CDO for years I forgot about this. Do I really need
to turn this on all ERef's which are external? Isn't there a default for
this? (Coudn't find option in the .genmodel or package.).


>
>
> On 24-03-14 16:35, Ed Merks wrote:
>> Christophe,
>>
>> Comments below.
>>
>> On 24/03/2014 8:21 AM, Christophe Bouhier wrote:
>>> Ed,
>>> See inline below.
>>>
>>> On 24-03-14 15:54, Ed Merks wrote:
>>>> Christophe,
>>>>
>>>> Comments below.
>>>>
>>>> On 24/03/2014 7:47 AM, Christophe Bouhier wrote:
>>>>> Hi,
>>>>>
>>>>> I am storing a model over several XMI based resources.
>>>>>
>>>>>
>>>>> In one specific case, I have a non-containment reference from an
>>>>> object in Resource A [1] to an object from Resource B. [2]
>>>>>
>>>>> Now I am accessing an attribute which is clearly set in Resource B
>>>>> (and also persisted as <messages name="INVITE"/> ), but the call
>>>>> objectA.eGet(FEATURE_NAME) returns null.
>>>>>
>>>>>
>>>>> Any idea why this would be?
>>>> It sounds like an unresolved proxy. What URIs did you use at the point
>>>> when you saved? (Hopefully absolute URIs with an absolute path.)
>>> All my resources are created with absolute URI
>>>
>>> /user.home/package.extension with
>>> URI.createFileURI(path/package.extension).
>>>
>>> they all end up in the same ResourceSet. Shoudn't the HRef in the
>>> persisted model also use absolute URI's?
>> No, they'll generally be made relative if there is a relative path
>> between the two absolute paths...
>>>
>>> What
>>>> URI did you use the load the model later? Again, hopefully an absolute
>>>> URI with an absolute path.
>>> Loading uses the same mechanim:
>>> /user.home/package.extenstion with URI.createFileURI
>>> they all end up in the same ResourceSet
>>>
>>>
>>>
>>> In the code where the proxy fails to
>>>> resolve, what resources exist in the resource set,
>>> I notice the 2nd resource is not in the resource set when loading the
>>> first resource. The first resource has URI:
>>>
>>> file:/Users/Christophe/services.services
>>>
>>>
>>> I have tried loading resource B first, but this doesn't solve the
>>> problem. In this case the set is loaded with both resources with both
>>> absolute URI's.
>>>
>>> com.netxforge.netxstudio.protocols.util.ProtocolsResourceImpl@4df42219
>>> uri='file:/Users/Christophe/protocols.protocols'
>>>
>>> com.netxforge.netxstudio.services.util.ServicesResourceImpl@fc54456
>>> uri='file:/Users/Christophe/services.services'
>>>
>>> > what URIs do they
>>>> have, and do any of them have clues in their Resource.getErrors()?
>>> No Errors...
>> Is it a proxy resolving reference? You can debug how you retrieve
>> objectA. If it's a proxy, there should be an attempt to resolve it.
>> That should normally, at a minimum, result in a resource being loaded
>> into the resource set. But you say even that doesn't occur. You'll need
>> to look closely why...
>>>>>
>>>>> Thx Christophe
>>>>>
>>>>> [1] Resource A: (The message element refers to an object in Resource
>>>>> B).
>>>>>
>>>>> <?xml version="1.0" encoding="ASCII"?>
>>>>> <services:ServiceFlow xmi:version="2.0"
>>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>>> xmlns:services="http://www.netxforge.com/06032012/services"
>>>>> name="Basic SIP Flow">
>>>>> <serviceFlowRelationships direction="LEFT_TO_RIGHT">
>>>>> <referenceRelationship
>>>>> href="library.library#//@refRelationships.0"/>
>>>>> <protocol href="protocols.protocols#/0"/>
>>>>> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>>>>> </serviceFlowRelationships>
>>>>> <serviceFlowRelationships>
>>>>> <referenceRelationship
>>>>> href="library.library#//@refRelationships.1"/>
>>>>> <protocol href="protocols.protocols#/0"/>
>>>>> <message href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>>>>> </serviceFlowRelationships>
>>>>> </services:ServiceFlow>
>>>>>
>>>>>
>>>>> [2] Resource B:
>>>>>
>>>>>
>>>>> <?xml version="1.0" encoding="ASCII"?>
>>>>> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>>>> xmlns:protocols="http://www.netxforge.com/06032012/protocols">
>>>>> <protocols:Protocol name="SIP">
>>>>> <procedures name="ALL">
>>>>> <messages name="INVITE"/>
>>>>> <messages name="RINGING"/>
>>>>> <messages name="OK"/>
>>>>> <messages name="TRYING"/>
>>>>> </procedures>
>>>>> </protocols:Protocol>
>>>>> <protocols:Protocol name="ISUP"/>
>>>>> </xmi:XMI>
>>>>>
>>>>
>>>
>>
>
Re: EMF external reference issue [message #1276498 is a reply to message #1276471] Mon, 24 March 2014 16:52 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Christophe,

The default for EReference.resolveProxies is true.

On 24/03/2014 8:59 AM, Christophe Bouhier wrote:
> On 24-03-14 16:52, Christophe Bouhier wrote:
>>
>> " Is it a proxy resolving reference? You can debug how you retrieve
>> objectA. If it's a proxy, there should be an attempt to resolve it.
>> That should normally, at a minimum, result in a resource being loaded
>> into the resource set. But you say even that doesn't occur. You'll need
>> to look closely why... "
>>
>> I would expect it to be a proxy resolve, but I have not configured
>> anything (purposely I mean), but indeed JDT Is my friend :-) What would
>> be a good starting point for debugging? XMILoadImpl? Or perhaps the
>> attributes get() method?
>
> which made me think about this feature .... "Resolve Proxies...".
> I turned it on for this EReference and bang... My attributes are
> loaded... !
> Bummer, working with CDO for years I forgot about this. Do I really
> need to turn this on all ERef's which are external? Isn't there a
> default for this? (Coudn't find option in the .genmodel or package.).
>
>
>>
>>
>> On 24-03-14 16:35, Ed Merks wrote:
>>> Christophe,
>>>
>>> Comments below.
>>>
>>> On 24/03/2014 8:21 AM, Christophe Bouhier wrote:
>>>> Ed,
>>>> See inline below.
>>>>
>>>> On 24-03-14 15:54, Ed Merks wrote:
>>>>> Christophe,
>>>>>
>>>>> Comments below.
>>>>>
>>>>> On 24/03/2014 7:47 AM, Christophe Bouhier wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am storing a model over several XMI based resources.
>>>>>>
>>>>>>
>>>>>> In one specific case, I have a non-containment reference from an
>>>>>> object in Resource A [1] to an object from Resource B. [2]
>>>>>>
>>>>>> Now I am accessing an attribute which is clearly set in Resource B
>>>>>> (and also persisted as <messages name="INVITE"/> ), but the call
>>>>>> objectA.eGet(FEATURE_NAME) returns null.
>>>>>>
>>>>>>
>>>>>> Any idea why this would be?
>>>>> It sounds like an unresolved proxy. What URIs did you use at the
>>>>> point
>>>>> when you saved? (Hopefully absolute URIs with an absolute path.)
>>>> All my resources are created with absolute URI
>>>>
>>>> /user.home/package.extension with
>>>> URI.createFileURI(path/package.extension).
>>>>
>>>> they all end up in the same ResourceSet. Shoudn't the HRef in the
>>>> persisted model also use absolute URI's?
>>> No, they'll generally be made relative if there is a relative path
>>> between the two absolute paths...
>>>>
>>>> What
>>>>> URI did you use the load the model later? Again, hopefully an
>>>>> absolute
>>>>> URI with an absolute path.
>>>> Loading uses the same mechanim:
>>>> /user.home/package.extenstion with URI.createFileURI
>>>> they all end up in the same ResourceSet
>>>>
>>>>
>>>>
>>>> In the code where the proxy fails to
>>>>> resolve, what resources exist in the resource set,
>>>> I notice the 2nd resource is not in the resource set when loading the
>>>> first resource. The first resource has URI:
>>>>
>>>> file:/Users/Christophe/services.services
>>>>
>>>>
>>>> I have tried loading resource B first, but this doesn't solve the
>>>> problem. In this case the set is loaded with both resources with both
>>>> absolute URI's.
>>>>
>>>> com.netxforge.netxstudio.protocols.util.ProtocolsResourceImpl@4df42219
>>>> uri='file:/Users/Christophe/protocols.protocols'
>>>>
>>>> com.netxforge.netxstudio.services.util.ServicesResourceImpl@fc54456
>>>> uri='file:/Users/Christophe/services.services'
>>>>
>>>> > what URIs do they
>>>>> have, and do any of them have clues in their Resource.getErrors()?
>>>> No Errors...
>>> Is it a proxy resolving reference? You can debug how you retrieve
>>> objectA. If it's a proxy, there should be an attempt to resolve it.
>>> That should normally, at a minimum, result in a resource being loaded
>>> into the resource set. But you say even that doesn't occur. You'll
>>> need
>>> to look closely why...
>>>>>>
>>>>>> Thx Christophe
>>>>>>
>>>>>> [1] Resource A: (The message element refers to an object in Resource
>>>>>> B).
>>>>>>
>>>>>> <?xml version="1.0" encoding="ASCII"?>
>>>>>> <services:ServiceFlow xmi:version="2.0"
>>>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>>>> xmlns:services="http://www.netxforge.com/06032012/services"
>>>>>> name="Basic SIP Flow">
>>>>>> <serviceFlowRelationships direction="LEFT_TO_RIGHT">
>>>>>> <referenceRelationship
>>>>>> href="library.library#//@refRelationships.0"/>
>>>>>> <protocol href="protocols.protocols#/0"/>
>>>>>> <message
>>>>>> href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>>>>>> </serviceFlowRelationships>
>>>>>> <serviceFlowRelationships>
>>>>>> <referenceRelationship
>>>>>> href="library.library#//@refRelationships.1"/>
>>>>>> <protocol href="protocols.protocols#/0"/>
>>>>>> <message
>>>>>> href="protocols.protocols#/0/@procedures.0/@messages.0"/>
>>>>>> </serviceFlowRelationships>
>>>>>> </services:ServiceFlow>
>>>>>>
>>>>>>
>>>>>> [2] Resource B:
>>>>>>
>>>>>>
>>>>>> <?xml version="1.0" encoding="ASCII"?>
>>>>>> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
>>>>>> xmlns:protocols="http://www.netxforge.com/06032012/protocols">
>>>>>> <protocols:Protocol name="SIP">
>>>>>> <procedures name="ALL">
>>>>>> <messages name="INVITE"/>
>>>>>> <messages name="RINGING"/>
>>>>>> <messages name="OK"/>
>>>>>> <messages name="TRYING"/>
>>>>>> </procedures>
>>>>>> </protocols:Protocol>
>>>>>> <protocols:Protocol name="ISUP"/>
>>>>>> </xmi:XMI>
>>>>>>
>>>>>
>>>>
>>>
>>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[XCORE] Ecore.ecore inside the workspace with a relative path
Next Topic:[CDO] EMF ODA driver & UI compliant with CDO security manager
Goto Forum:
  


Current Time: Tue Apr 23 10:10:04 GMT 2024

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

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

Back to the top