Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » inject a meta model using eNS_URI()
inject a meta model using eNS_URI() [message #1075863] Tue, 30 July 2013 08:07 Go to next message
Kosala Yapa is currently offline Kosala YapaFriend
Messages: 159
Registered: September 2010
Senior Member
Hi there,

I need to inject a meta model using eNS_URI of the meta model.


public ResourceSet getResourceSet()
{
ResourceSet resourceSet = new ResourceSetImpl();

// Register the appropriate resource factory to handle all file extensions.
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
.put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());

// Register the package to ensure it is available during loading.
resourceSet.getPackageRegistry().put(getPackage_eNS_URI(), getPackage_eINSTANCE());

return resourceSet;
}

public void loadModels()
{
EMFModelFactory factory = new EMFModelFactory();
IInjector injector = new EMFInjector();

IReferenceModel targetMetamodel = factory.newReferenceModel();
injector.inject(targetMetamodel, getPackage_eNS_URI());
---
}

inject statement gives an error,

org.eclipse.m2m.atl.core.ATLCoreException: Error loading model: java.io.FileNotFoundException: tci/model(Access is denied).

model.ecore is in tci and getPackage_eNS_URI() is "model".


Any help/opinion is appreciated.

Cheers,
Kosala

[Updated on: Tue, 30 July 2013 08:19]

Report message to a moderator

Re: inject a meta model using eNS_URI() [message #1075873 is a reply to message #1075863] Tue, 30 July 2013 08:38 Go to previous message
Kosala Yapa is currently offline Kosala YapaFriend
Messages: 159
Registered: September 2010
Senior Member
Thanks I could solve the issue.

The issue was loadModels() could not figure out its registered information. I simply called getResourceSet() within loadModels() and it is working fine.

Cheers,

[Updated on: Tue, 30 July 2013 08:39]

Report message to a moderator

Previous Topic:cannot transform all suppliers in dependency
Next Topic:UML Testing Profile not found
Goto Forum:
  


Current Time: Fri Dec 19 14:26:28 GMT 2014

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

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