Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » xmi id being overwritten by href
xmi id being overwritten by href [message #555165] Wed, 25 August 2010 16:41 Go to next message
Alan  is currently offline Alan Friend
Messages: 4
Registered: August 2010
Junior Member
Hi guys,

Have a strange one I was hoping someone could help with.
Object A has a non-containment reference to Object B and they are in seperate resources.
When I close the editor Object A is in the resource gets unloaded.
I then open a seperate editor which causes Object A's resource to get reloaded.
eSetProxyURI gets called on Object B as a result (see full trace below)
The xml before reloading the resource of Object A is

<apples xsi:type="B" xmi:id="_ZJK0ILBcEd-r0ZqroBIVug"/>

And after is

<apples xsi:type="B" href="#_ZJK0ILBcEd-r0ZqroBIVug"/>

As you can see the xmi id is removed and a href added.

Any ideas whats going on ?

thanks,
Alan






at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleProxy(XMLHan dler.java:2869)

at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAtt ribs(SAXXMIHandler.java:73)

at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFa ctory(XMLHandler.java:2178)

at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTy peName(XMLHandler.java:2081)

at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa ndler.java:2016)

at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa ndler.java:131)

at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH andler.java:1825)

at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1023)

at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)

at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)

at org.eclipse.emf.ecore.xmi.impl.SAXWrapper.startElement(SAXWr apper.java:98)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume ntParser.emptyElement(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.scanStartElement(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner Impl.next(Unknown Source)

at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown Source)

at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown Source)

at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown Source)

at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown Source)

at javax.xml.parsers.SAXParser.parse(Unknown Source)

at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)

Re: xmi id being overwritten by href [message #555199 is a reply to message #555165] Wed, 25 August 2010 19:24 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Alan,

Comments below.


Alan wrote:
> Hi guys,
>
> Have a strange one I was hoping someone could help with.
> Object A has a non-containment reference to Object B and they are in
> seperate resources.
> When I close the editor Object A is in the resource gets unloaded.
> I then open a seperate editor which causes Object A's resource to get
> reloaded.
> eSetProxyURI gets called on Object B as a result (see full trace below)
B isn't being loaded though is it? This doesn't sound possible, i.e.,
load only sets proxy URIs on newly created objects.
> The xml before reloading the resource of Object A is
> <apples xsi:type="B" xmi:id="_ZJK0ILBcEd-r0ZqroBIVug"/>
You're saying B is contained in the same resource?
>
> And after is
>
> <apples xsi:type="B" href="#_ZJK0ILBcEd-r0ZqroBIVug"/>
You're showing XML here though, but talking about the in memory instances...
>
> As you can see the xmi id is removed and a href added.
In the XML, but I didn't here you talk about a save that would have
changed any XML.
> Any ideas whats going on ?
I'm confused by the description.
>
> thanks,
> Alan
>
>
>
>
>
>
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleProxy(XMLHan
> dler.java:2869)
And then it's setting the proxy URI of that new object...
>
> at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAtt
> ribs(SAXXMIHandler.java:73)
>
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFa
> ctory(XMLHandler.java:2178)
>
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTy
> peName(XMLHandler.java:2081)
See, it's creating a new object.
>
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHa
> ndler.java:2016)
>
> at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHa
> ndler.java:131)
>
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLH
> andler.java:1825)
>
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML
> Handler.java:1023)
>
> at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI
> Handler.java:87)
>
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
> ndler.java:1001)
>
> at org.eclipse.emf.ecore.xmi.impl.SAXWrapper.startElement(SAXWr
> apper.java:98)
>
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
> .startElement(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocume
> ntParser.emptyElement(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner
> Impl.scanStartElement(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl$FragmentContentDriver.next(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm
> pl.next(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScanner
> Impl.next(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl.scanDocument(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
> n.parse(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
> n.parse(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U
> nknown Source)
>
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
> .parse(Unknown Source)
>
> at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA
> XParser.parse(Unknown Source)
>
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.
> java:181)
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: xmi id being overwritten by href [message #555272 is a reply to message #555199] Thu, 26 August 2010 07:33 Go to previous message
Alan  is currently offline Alan Friend
Messages: 4
Registered: August 2010
Junior Member
Apologies for the confusion. Let me try and answer your questions directly. If that still doesn't help I can restate from the start.



Ed Merks wrote on Wed, 25 August 2010 15:24
Alan,

Comments below.


Alan wrote:
> Hi guys,
>
> Have a strange one I was hoping someone could help with.
> Object A has a non-containment reference to Object B and they are in
> seperate resources.
> When I close the editor Object A is in the resource gets unloaded.
> I then open a seperate editor which causes Object A's resource to get
> reloaded.
> eSetProxyURI gets called on Object B as a result (see full trace below)
B isn't being loaded though is it? This doesn't sound possible, i.e.,
load only sets proxy URIs on newly created objects.

No B is already loaded. It seems to me that it is setting the proxy URI on a pre-existing object. Any reason it would do this ? resolveProxies was left as default everywhere

> The xml before reloading the resource of Object A is
> <apples xsi:type="B" xmi:id="_ZJK0ILBcEd-r0ZqroBIVug"/>
You're saying B is contained in the same resource?

No Object A is in resource 1 and Object B is in resource 2


>
> And after is
>
> <apples xsi:type="B" href="#_ZJK0ILBcEd-r0ZqroBIVug"/>
You're showing XML here though, but talking about the in memory instances...

Ya sorry about that.
Let me say this. If I don't unload Resource A and then reload it during the same session the xmi id in the xml when I shutdown is fine.

If I unload resource A and reload it when I shutdown my xmi id is gone from my xml to be replaced by the href

No problems are noticed during the current running session either way
But if I reload the project after the href replaces the xmi id I get problems




>
> As you can see the xmi id is removed and a href added.
In the XML, but I didn't here you talk about a save that would have
changed any XML.

I save all resources to disk on shutdown and that is when I notice that the href has replaced the xmi id in the xml of Resource 2 (where Object B lives)
As I say it causes no issues in memory.

Resource 1 always looks fine in that Object A has a correctly formed href pointing to Object B.




>

Previous Topic:[Teneo] org.hibernate.TransientObjectException: object references an unsaved transient instance
Next Topic:[CDO] CDOSession will be closed without identifyable reason
Goto Forum:
  


Current Time: Fri Apr 19 21:12:13 GMT 2024

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

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

Back to the top