Skip to main content



      Home
Home » Modeling » EMF » on loading emf model data: cannot obtain emf resource
on loading emf model data: cannot obtain emf resource [message #390364] Wed, 05 January 2005 13:01 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Editor question
Next Topic:EMF persistence using object databases
Goto Forum:
  


Current Time: Wed Aug 20 16:26:37 EDT 2025

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

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

Back to the top