on loading emf model data: cannot obtain emf resource [message #390364] |
Wed, 05 January 2005 13:01  |
Eclipse User |
|
|
|
Originally posted by: balimis.SPAM.poczta.onet.pl
I have problem opening emf data file in RCP - can not obtain emf
Resource from file. The code I use is:
IPath path = new Path("c:/test.ext");
TestPackageImpl.init();
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Map m = reg.getExtensionToFactoryMap();
m.put("ext", new TestResourceFactoryImpl());
ResourceSet resSet = new ResourceSetImpl();
resource = resSet.getResource(URI.createFileURI(path.toString()),true);
In last line I get error:
Class 'Diagram' not found. (file:c:/test.ext,2,199)
Diagram is main model object.
It seems like xml schema for my model is not accessible by emf.
TestPackageImpl, TestResourceFactoryImpl are standard emf impl generated
classes.
what do I do wrong?
thanks in advance,
Bali
|
|
|
Re: on loading emf model data: cannot obtain emf resource [message #390375 is a reply to message #390364] |
Thu, 06 January 2005 01:05  |
Eclipse User |
|
|
|
Hi Bali,
If you generated your RCP using EMF, the model's plugin manifest file has
the registration for your factories and packages so you don't need to do it
in your code - what is required when you are running a stand-alone
application. That said, I don't believe this would be causing the error you
are seeing. Is there any other error message? Maybe in the .metadata/.log
file of yours RCP application workspace?
If you attach the ecore, genmodel and test.ext files, I can give it a try.
Regards,
Marcelo.
"Bali" <balimis@SPAM.poczta.onet.pl> wrote in message
news:crha0v$de4$1@www.eclipse.org...
>
> I have problem opening emf data file in RCP - can not obtain emf
> Resource from file. The code I use is:
>
> IPath path = new Path("c:/test.ext");
> TestPackageImpl.init();
>
> Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
> Map m = reg.getExtensionToFactoryMap();
> m.put("ext", new TestResourceFactoryImpl());
> ResourceSet resSet = new ResourceSetImpl();
> resource = resSet.getResource(URI.createFileURI(path.toString()),true);
>
> In last line I get error:
> Class 'Diagram' not found. (file:c:/test.ext,2,199)
>
> Diagram is main model object.
> It seems like xml schema for my model is not accessible by emf.
>
> TestPackageImpl, TestResourceFactoryImpl are standard emf impl generated
> classes.
>
> what do I do wrong?
>
> thanks in advance,
> Bali
|
|
|
Powered by
FUDForum. Page generated in 0.04955 seconds