Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Package NOT Found when read .umlclass file by programmatically
Package NOT Found when read .umlclass file by programmatically [message #870455] Tue, 08 May 2012 10:26
jy zhang is currently offline jy zhang
Messages: 19
Registered: May 2012
Junior Member
I want to open *.umlclass file (class diagram created by uml2tools) by prgorammatically:
EPackage p1 = NotationPackage.eINSTANCE;
EPackage p2 = UMLPackage.eINSTANCE;
		
URI uri = URI.createURI("33.umlclass");
Resource res = new GMFResourceFactory().createResource(uri);
res.load(GMFResourceFactory.getDefaultLoadOptions());


org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with uri 'http:||www.eclipse.org|gmf|runtime|1.0.2|notation' not found.
I added EPackage p1 = NotationPackage.eINSTANCE; to fix this error.

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with uri 'http:||www.eclipse.org|uml2|3.0.0|UML' not found.
I added EPackage p2 = UMLPackage.eINSTANCE; to fix this error.

But what about org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with uri 'http:||www.eclipse.org|mdt|uml2tools|gmf|notation|ext|2008' not found. (file:///E:/33.umlclass, 93, 100)
I have no idea to fix this error.
But if I delete line93
<styles xmi:type="uml2tools.notation:U2TDiagramCanonicalStyle" xmi:id="_U_jeU5jvEeG6_bluuoQvfw"/>
in 33.umlclass, I can run my code sucessfully. And it seems 33.umlclass still can open as editor by uml2tools plugin.
But I can NOT use this way to make my code run.
How can I fix this error?
Thanks a lot!
Previous Topic:Hypermodel
Next Topic:How to create a umlclass file, and create some notations and then save by programming
Goto Forum:
  


Current Time: Tue Oct 21 03:51:11 GMT 2014

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

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