Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ignoring unknown entries
ignoring unknown entries [message #535919] Wed, 26 May 2010 10:51 Go to next message
Mauro Condarelli is currently offline Mauro CondarelliFriend
Messages: 428
Registered: September 2009
Senior Member
Hi,
I recently simplified my models.
As a result I have now several XML files I'm unable to read back because:

Problem loading file:/C:/Tmp/La-Missione.world
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'time' not found. (file:/C:/Tmp/La-Missione.world, 4, 73)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at it.condarelli.writer.model.world.Model.load(Model.java:55)
at it.condarelli.writer.model.world.Model.<init>(Model.java:38)
at it.condarelli.writer.editors.WorldEditor.init(WorldEditor.ja va:150)
....

Which is perfectly right (Feature 'time' was deleted from the model).

Is there some Option I can give to

resource = resourceSet.getResource(uri, true);

to simply ignore "unknown" features?

What is the standard way to handle an evolving model in the life-cycle of an application?

TiA
Mauro
Re: ignoring unknown entries [message #535977 is a reply to message #535919] Wed, 26 May 2010 14:25 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060905010804030208050809
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Mauro,

This option is useful:

/**
* This options allows you to record unknown features during
deserialization/loading.
* The default is <code>Boolean.FALSE</code> unless set to
<code>Boolean.TRUE</code> explicitly.
* The unknown features and their values can be accessed via
getEObjectToExtensionMap().
* @see #getEObjectToExtensionMap()
*/
String OPTION_RECORD_UNKNOWN_FEATURE = "RECORD_UNKNOWN_FEATURE";

Note that it doesn't just ignore them, it records them, so you'd have to
clear out the map if you don't want them saved.


Mauro Condarelli wrote:
> Hi,
> I recently simplified my models.
> As a result I have now several XML files I'm unable to read back because:
>
> Problem loading file:/C:/Tmp/La-Missione.world
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'time' not found. (file:/C:/Tmp/La-Missione.world, 4, 73)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
> at it.condarelli.writer.model.world.Model.load(Model.java:55)
> at it.condarelli.writer.model.world.Model.<init>(Model.java:38)
> at it.condarelli.writer.editors.WorldEditor.init(WorldEditor.ja va:150)
> ...
>
> Which is perfectly right (Feature 'time' was deleted from the model).
>
> Is there some Option I can give to
>
> resource = resourceSet.getResource(uri, true);
>
> to simply ignore "unknown" features?
>
> What is the standard way to handle an evolving model in the life-cycle of an application?
>
> TiA
> Mauro
>

--------------060905010804030208050809
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mauro,<br>
<br>
This option is useful:<br>
<blockquote>&nbsp; /**<br>
&nbsp;&nbsp; * This options allows you to record unknown features during
deserialization/loading.<br>
&nbsp;&nbsp; * The default is &lt;code&gt;Boolean.FALSE&lt;/code&gt; unless set
to &lt;code&gt;Boolean.TRUE&lt;/code&gt; explicitly. <br>
&nbsp;&nbsp; * The unknown features and their values can be accessed via
getEObjectToExtensionMap().<br>
&nbsp;&nbsp; * @see #getEObjectToExtensionMap()&nbsp; <br>
&nbsp;&nbsp; */<br>
&nbsp; String OPTION_RECORD_UNKNOWN_FEATURE = "RECORD_UNKNOWN_FEATURE";<br>
</blockquote>
Note that it doesn't just ignore them, it records them, so you'd have
to clear out the map if you don't want them saved.<br>
<br>
<br>
Mauro Condarelli wrote:
<blockquote cite="mid:htiug0$qpf$1@build.eclipse.org" type="cite">
<pre wrap="">Hi,
I recently simplified my models.
As a result I have now several XML files I'm unable to read back because:

Problem loading <a class="moz-txt-link-freetext" href="file:/C:/Tmp/La-Missione.world">file:/C:/Tmp/La-Missione.world </a>
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'time' not found. (<a class="moz-txt-link-freetext" href="file:/C:/Tmp/La-Missione.world">file:/C:/Tmp/La-Missione.world </a>, 4, 73)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at it.condarelli.writer.model.world.Model.load(Model.java:55)
at it.condarelli.writer.model.world.Model.&lt;init&gt;( Model.java:38)
at it.condarelli.writer.editors.WorldEditor.init(WorldEditor.ja va:150)
....

Which is perfectly right (Feature 'time' was deleted from the model).

Is there some Option I can give to

resource = resourceSet.getResource(uri, true);

to simply ignore "unknown" features?

What is the standard way to handle an evolving model in the life-cycle of an application?

TiA
Mauro
</pre>
</blockquote>
</body>
</html>

--------------060905010804030208050809--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[EMF / CDO] CDO-Workspace-Build failed - Bug?
Next Topic:[CDO] cannot provision target platform with p2 repository produced by CDO maintenance and integratio
Goto Forum:
  


Current Time: Thu Apr 25 20:44:42 GMT 2024

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

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

Back to the top