Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Service Component Architecture (SCA) Tools » Load an SCA composite model programmatically
Load an SCA composite model programmatically [message #574067] Wed, 04 February 2009 15:08
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 770
Registered: July 2009
Location: Grenoble, France
Senior Member
Hi all,

I'm trying to load an SCA model programmatically to get data form a
..composite file by navigating in the EMF objects instead of using a ugly
XPath resolver. I'm using SCA editor and metamodel v1.0.1

However, when using the classic EMF code to load a Resource:
// Create a resource set.
ResourceSet resourceSet = new ResourceSetImpl();
// Register the default resource factory -- only needed for
// stand-alone!
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION,
new XMIResourceFactoryImpl());
// Get the URI of the model file.
URI fileURI = URI.createFileURI(new
File(scaApp.getCompositeFile()).getAbsolutePath());
// Demand load the resource for this file.
Resource resource = resourceSet.getResource(fileURI, true);
Composite compositeModel = (Composite)resource.getContents().get(0);

on a composite file generated with the sca modeler (so conform to the
SCA metamodel), I got the following error:

org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'composite' not
found.
(file:/home/mistria/runtime-EclipseApplication/test/default. composite,
2, 78)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2229)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2220)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1318)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1454)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:83)
....

When looking at variables when the exception is raised, it seems like
the ScaFactory is found and used to unserialize model (a good point!)...


Do you have any idea of why this ScaFactory cannot resolve "composite"???


Regards,
Mickael
Previous Topic:SCA and business processes
Next Topic:Load an SCA composite model programmatically
Goto Forum:
  


Current Time: Fri Nov 28 13:56:42 GMT 2014

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

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