Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » 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, away until January 8th is currently offline Mickael Istria, away until January 8thFriend
Messages: 827
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
// 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
(file:/home/mistria/runtime-EclipseApplication/test/default. composite,
2, 78)
org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(
org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (

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"???

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

Current Time: Tue Mar 20 12:05:39 GMT 2018

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

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