SERIALIZATION [message #662905] |
Fri, 01 April 2011 12:45 |
ben Messages: 30 Registered: April 2011 Location: France/Bordeaux |
Member |
|
|
Hi,
Sorry for my english language.
I trying to serialize an instance of my model by using this part of java code :
ResourceSet rs = new ResourceSetImpl();
rs.getResourceFactoryRegistry().getExtensionToFactoryMap().p ut(
Resource.Factory.Registry.DEFAULT_EXTENSION,
new PerformantXMIResourceFactoryImpl());
URI uri = URI.createURI("file:/c:svn/defSerForModelVersion1.ecore");
Resource resource = rs.createResource(uri);
resource.getContents().add(table);
resource.getContents().add(lien);
try { resource.save(null);
System.out.println("saved");
}catch (IOException e)
{
System.out.println("failed to write " + uri);
}
After runninf this program, i have a xmi file called : " vdefSerForModelVersion1.ecore "
but if i want open this file with sample ecore model editor, a window appear which notice :
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://mm.data/1.0' not found. (platform:/resource/test/svn/defSerForModelVersion1.ecore, 3, 71)
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 org.eclipse.emf.ecore.presentation.EcoreEditor.createModelGe n(EcoreEditor.java:1062)
at org.eclipse.emf.ecore.presentation.EcoreEditor.createModel(E coreEditor.java:1082)
at org.eclipse.emf.ecore.presentation.EcoreEditor.createPages(E coreEditor.java:1147)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:348)
at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:289)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2863
i don't understand why i have this problem. this file is important for to build an instance of my model in GMF.
someone can helpe me please.
Best regards.
[Updated on: Fri, 01 April 2011 12:45] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: SERIALIZATION [message #663810 is a reply to message #663694] |
Wed, 06 April 2011 14:44 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Ben,
How are you installing your bundle? The p2 installer would normally
tell you if there are any problem with dependencies. Running -clean
-debug and looking at the <workspace>/.metadata/.log will show
information about whether your bundle is properly installed or has
dependency problems that disable it.
ben wrote:
> HI Ed,
>
> Thank you for your help, i start to understand where my problem.
> You have talked about the bundle which i have need to install in my IDE.
> Can you explain me please, wich bundle have i need to my install in
> my IDE.
> i show u my MANIFEST.MF. i thought that i had the necessary.
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: %pluginName
> Bundle-SymbolicName: datamodeling;singleton:=true
> Bundle-Version: 1.0.0
> Bundle-ClassPath: .
> Bundle-Vendor: %providerName
> Bundle-Localization: plugin
> Bundle-RequiredExecutionEnvironment: JavaSE-1.6
> Require-Bundle: org.eclipse.core.runtime,
> org.eclipse.emf.ecore;visibility:=reexport,
> org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
> org.eclipse.emf.ecore.xmi.source;bundle-version="2.5.0"
> Bundle-ActivationPolicy: lazy
> Import-Package: org.eclipse.emf.ecore.xmi,
> org.eclipse.emf.ecore.xmi.impl,
> org.eclipse.swt.widgets
>
> Thanh you in advance
>
> Best regards
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04474 seconds