Persisting EMF models via XMI [message #1385467] |
Fri, 06 June 2014 15:36 |
Thomas Zwickl Messages: 37 Registered: May 2014 |
Member |
|
|
Hello everyone,
I yet again have another problem with EMF. We are no so far that we want to save the current model in a XMI File so we can load the current settings the next time the application starts again.
I read through this tutorial which describes the necessary steps very precisely:
http://www.vogella.com/tutorials/EclipseEMFPersistence/article.html
I did everything exactly as it was described, but as soon as I press the save button and the method resource.save() is invoked I get a java.net.MalformedURLException: unknown protocol: z
Here is the complete exception stack:
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.createOutputStream(URIHandlerImpl.java:110)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:349)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:996)
In the tutorial they say that you will get an exception when you miss to add some objects, but I'm very sure that I added all objects that don't have a "contains relationship". So after trying for more than two hours to solve this problem I thought maybe someone else had a similar problem and can help me out here.
Thanks in advance for your help.
Best regards,
Tom
[Updated on: Sat, 07 June 2014 22:41] Report message to a moderator
|
|
|
Re: Persisting EMF models via XMI [message #1385470 is a reply to message #1385467] |
Fri, 06 June 2014 15:49 |
|
Le 06/06/2014 17:36, Thomas Zwickl a écrit :
> Hello everyone,
>
> I yet again have another problem with EMF. We are no so far that we want
> to save the current model in a XMI File so we can load the current
> settings the next time the application starts again.
> I read through this tutorial which describes the necessary steps very
> precisely:
> www.vogella.com/tutorials/EclipseEMFPersistence/article.html
>
> I did everything exactly as it was described, but as soon as I press the
> save button and the method resource.save() is invoked I get a
> java.net.MalformedURLException: unknown protocol: z
From that message I would guess you set the resource's URI to something
like "z:\local\path"? If that is the case, you need to create a proper
URI (starting with "file:/") using something like
URI.createFileURI(""z:\\local\\path").
Pierre-Charles David - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.03427 seconds