Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL Pivot Setting delegates in standalone application
OCL Pivot Setting delegates in standalone application [message #901240] Fri, 10 August 2012 13:18 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
Hi,

I am writing a simple standalone class to evavluate emf model using setting delegates but i am getting following exception.

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.eclipse.ocl.examples.pivot.uml.UMLUtils.initializeContents(UMLUtils.java:221)
at org.eclipse.ocl.examples.pivot.uml.UMLUtils.initializeContents(UMLUtils.java:142)
at org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.init(EssentialOCLStandaloneSetup.java:48)
at org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.createInjectorAndDoEMFRegistration(EssentialOCLStandaloneSetup.java:73)
at org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.doSetup(EssentialOCLStandaloneSetup.java:39)
at abstractmodeller.model.prm.TestPivot.main(TestPivot.java:133)
Caused by: org.eclipse.emf.common.util.WrappedException: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'xmi' not found. (jar:file:/C:/juno/eclipse-SDK-4.2M5-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120130-1013.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore, 3, 129)
at org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17007)
at org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.init(UMLPackageImpl.java:1903)
at org.eclipse.uml2.uml.UMLPackage.<clinit>(UMLPackage.java:82)
... 6 more
Caused by: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'xmi' not found. (jar:file:/C:/juno/eclipse-SDK-4.2M5-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120130-1013.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore, 3, 129)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:77)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:185)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:240)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1505)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1284)
at org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17005)

Here is complete class

import java.io.IOException;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EFactory;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.ocl.examples.pivot.delegate.*;
import org.eclipse.ocl.examples.domain.values.Value;
import org.eclipse.ocl.examples.pivot.ExpressionInOcl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.ocl.examples.pivot.OCL;
import org.eclipse.ocl.examples.pivot.manager.MetaModelManager;
import org.eclipse.ocl.examples.pivot.model.OCLstdlib;
import org.eclipse.ocl.examples.pivot.utilities.PivotEnvironmentFactory;
import org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup;
import org.openide.util.Exceptions;

public class TestPivot {
private EPackage modelPackage = null;
private EClass eClass = null;
private EAttribute eAttribute = null;
private EFactory iModelPackage = null;
private EObject eObject = null;
private String oclDelegateURI = OCLDelegateDomain.OCL_DELEGATE_URI_PIVOT;
private ResourceSet ecoreResourceSet;
private ResourceSet xmiResourceSet;

public TestPivot() {
org.eclipse.ocl.examples.pivot.OCL.initialize(null);
EOperation.Internal.InvocationDelegate.Factory.Registry.INSTANCE.put
(oclDelegateURI, new OCLInvocationDelegateFactory.Global());
EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put
(oclDelegateURI, new OCLSettingDelegateFactory.Global());
makeMataModel();
createModel();
}
private void makeMataModel() {
modelPackage = EcoreFactory.eINSTANCE.createEPackage();
modelPackage.setName("temp");
modelPackage.setNsPrefix("Test");
modelPackage.setNsURI("http://www.eclipse.org/mdt/ocl/oclinecore/tutorial");
EAnnotation mainOCLAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
mainOCLAnnotation.setSource("http://www.eclipse.org/emf/2002/Ecore");
mainOCLAnnotation.getDetails().put("invocationDelegates", oclDelegateURI);
mainOCLAnnotation.getDetails().put("settingDelegates", oclDelegateURI);
mainOCLAnnotation.getDetails().put("validationDelegates", oclDelegateURI);
modelPackage.getEAnnotations().add(mainOCLAnnotation);
eClass = EcoreFactory.eINSTANCE.createEClass();
eClass.setName("TestClass");
eAttribute= EcoreFactory.eINSTANCE.createEAttribute();
eAttribute.setName("test");
eAttribute.setUpperBound(1);
eAttribute.setLowerBound(1);
eAttribute.setEType(EcorePackage.eINSTANCE.getELongObject());
eAttribute.setDerived(true);
eAttribute.setVolatile(true);
EAnnotation driveAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
driveAnnotation.setSource(oclDelegateURI);
driveAnnotation.getDetails().put("derivation", "2*2");
eAttribute.getEAnnotations().add(driveAnnotation);
eClass.getEStructuralFeatures().add(eAttribute);
modelPackage.getEClassifiers().add(eClass);
URI uri1 = URI.createFileURI("test.ecore");
ecoreResourceSet = new ResourceSetImpl();
ecoreResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
Resource resource = ecoreResourceSet.createResource(uri1);
resource.getContents().add(modelPackage);

try {
resource.save(null);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}

}

private void createModel() {
iModelPackage = modelPackage.getEFactoryInstance();
eObject = iModelPackage.create(eClass);
URI uri = URI.createFileURI("test.xmi");
xmiResourceSet = new ResourceSetImpl();
xmiResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());
Resource resource = xmiResourceSet.createResource(uri);
resource.getContents().add(iModelPackage);
resource.getContents().add(eObject);

}


public void useDelegates() {
Object eGet = eObject.eGet(eAttribute, false);
System.out.println("value = " + eGet.toString());
}

public static void main(String args[]) {
EssentialOCLStandaloneSetup.doSetup();
OCLstdlib.install();
TestPivot tp = new TestPivot();
tp.useDelegates();
}
}

Re: OCL Pivot Setting delegates in standalone application [message #901282 is a reply to message #901240] Fri, 10 August 2012 15:40 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The stack trace shows that you are using 4.2M5 (about 7 weeks after 4.2
was released).

A variety of UML initialization difficulties got sorted out at M6.

Use the official Juno release.

Regards

Ed Willink


On 10/08/2012 14:18, ModelGeek Mising name wrote:
> Hi,
>
> I am writing a simple standalone class to evavluate emf model using
> setting delegates but i am getting following exception.
>
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at
> org.eclipse.ocl.examples.pivot.uml.UMLUtils.initializeContents(UMLUtils.java:221)
> at
> org.eclipse.ocl.examples.pivot.uml.UMLUtils.initializeContents(UMLUtils.java:142)
> at
> org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.init(EssentialOCLStandaloneSetup.java:48)
> at
> org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.createInjectorAndDoEMFRegistration(EssentialOCLStandaloneSetup.java:73)
> at
> org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.doSetup(EssentialOCLStandaloneSetup.java:39)
> at abstractmodeller.model.prm.TestPivot.main(TestPivot.java:133)
> Caused by: org.eclipse.emf.common.util.WrappedException:
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature
> 'xmi' not found.
> (jar:file:/C:/juno/eclipse-SDK-4.2M5-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120130-1013.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore,
> 3, 129)
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17007)
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.init(UMLPackageImpl.java:1903)
> at org.eclipse.uml2.uml.UMLPackage.<clinit>(UMLPackage.java:82)
> ... 6 more
> Caused by: org.eclipse.emf.ecore.resource.Resource$IOWrappedException:
> Feature 'xmi' not found.
> (jar:file:/C:/juno/eclipse-SDK-4.2M5-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120130-1013.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore,
> 3, 129)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:77)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:185)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:240)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1505)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1284)
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17005)
>
> Here is complete class
>
> import java.io.IOException;
> import org.eclipse.emf.common.util.URI;
> import org.eclipse.emf.ecore.EAnnotation;
> import org.eclipse.emf.ecore.EAttribute;
> import org.eclipse.emf.ecore.EClass; import
> org.eclipse.emf.ecore.EFactory;
> import org.eclipse.emf.ecore.EObject;
> import org.eclipse.emf.ecore.EOperation;
> import org.eclipse.emf.ecore.EPackage;
> import org.eclipse.emf.ecore.EcoreFactory;
> import org.eclipse.emf.ecore.EcorePackage;
> import org.eclipse.emf.ecore.EStructuralFeature;
> import org.eclipse.ocl.examples.pivot.delegate.*;
> import org.eclipse.ocl.examples.domain.values.Value;
> import org.eclipse.ocl.examples.pivot.ExpressionInOcl;
> import org.eclipse.emf.ecore.resource.Resource;
> import org.eclipse.emf.ecore.resource.ResourceSet;
> import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
> import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
> import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
> import org.eclipse.ocl.examples.pivot.OCL;
> import org.eclipse.ocl.examples.pivot.manager.MetaModelManager;
> import org.eclipse.ocl.examples.pivot.model.OCLstdlib;
> import org.eclipse.ocl.examples.pivot.utilities.PivotEnvironmentFactory;
> import
> org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup;
> import org.openide.util.Exceptions;
>
> public class TestPivot {
> private EPackage modelPackage = null;
> private EClass eClass = null;
> private EAttribute eAttribute = null;
> private EFactory iModelPackage = null;
> private EObject eObject = null;
> private String oclDelegateURI =
> OCLDelegateDomain.OCL_DELEGATE_URI_PIVOT;
> private ResourceSet ecoreResourceSet;
> private ResourceSet xmiResourceSet;
> public TestPivot() {
> org.eclipse.ocl.examples.pivot.OCL.initialize(null);
> EOperation.Internal.InvocationDelegate.Factory.Registry.INSTANCE.put
> (oclDelegateURI, new OCLInvocationDelegateFactory.Global());
> EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put
> (oclDelegateURI, new OCLSettingDelegateFactory.Global());
> makeMataModel();
> createModel(); } private void makeMataModel() {
> modelPackage = EcoreFactory.eINSTANCE.createEPackage();
> modelPackage.setName("temp");
> modelPackage.setNsPrefix("Test");
> modelPackage.setNsURI("http://www.eclipse.org/mdt/ocl/oclinecore/tutorial");
> EAnnotation mainOCLAnnotation =
> EcoreFactory.eINSTANCE.createEAnnotation();
> mainOCLAnnotation.setSource("http://www.eclipse.org/emf/2002/Ecore");
> mainOCLAnnotation.getDetails().put("invocationDelegates",
> oclDelegateURI);
> mainOCLAnnotation.getDetails().put("settingDelegates",
> oclDelegateURI);
> mainOCLAnnotation.getDetails().put("validationDelegates",
> oclDelegateURI);
> modelPackage.getEAnnotations().add(mainOCLAnnotation);
> eClass = EcoreFactory.eINSTANCE.createEClass();
> eClass.setName("TestClass");
> eAttribute= EcoreFactory.eINSTANCE.createEAttribute();
> eAttribute.setName("test");
> eAttribute.setUpperBound(1);
> eAttribute.setLowerBound(1);
> eAttribute.setEType(EcorePackage.eINSTANCE.getELongObject());
> eAttribute.setDerived(true);
> eAttribute.setVolatile(true);
> EAnnotation driveAnnotation =
> EcoreFactory.eINSTANCE.createEAnnotation();
> driveAnnotation.setSource(oclDelegateURI);
> driveAnnotation.getDetails().put("derivation", "2*2");
> eAttribute.getEAnnotations().add(driveAnnotation);
> eClass.getEStructuralFeatures().add(eAttribute);
> modelPackage.getEClassifiers().add(eClass);
> URI uri1 = URI.createFileURI("test.ecore");
> ecoreResourceSet = new ResourceSetImpl();
> ecoreResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore",
> new EcoreResourceFactoryImpl());
> Resource resource = ecoreResourceSet.createResource(uri1);
> resource.getContents().add(modelPackage);
> try {
> resource.save(null);
> } catch (IOException ex) {
> Exceptions.printStackTrace(ex);
> }
> }
> private void createModel() {
> iModelPackage = modelPackage.getEFactoryInstance();
> eObject = iModelPackage.create(eClass);
> URI uri = URI.createFileURI("test.xmi");
> xmiResourceSet = new ResourceSetImpl();
> xmiResourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi",
> new XMIResourceFactoryImpl());
> Resource resource = xmiResourceSet.createResource(uri);
> resource.getContents().add(iModelPackage);
> resource.getContents().add(eObject);
> }
> public void useDelegates() {
> Object eGet = eObject.eGet(eAttribute, false);
> System.out.println("value = " + eGet.toString());
> }
> public static void main(String args[]) {
> EssentialOCLStandaloneSetup.doSetup();
> OCLstdlib.install();
> TestPivot tp = new TestPivot();
> tp.useDelegates();
> }
> }
>
>
Re: OCL Pivot Setting delegates in standalone application [message #901512 is a reply to message #901282] Mon, 13 August 2012 08:22 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 550
Registered: June 2011
Senior Member
I have tried the latest version but i am still getting following exception

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.eclipse.uml2.uml.resources.util.UMLResourcesUtil.init(UMLResourcesUtil.java:146)
at org.eclipse.ocl.examples.pivot.PivotStandaloneSetup.init(PivotStandaloneSetup.java:48)
at org.eclipse.ocl.examples.pivot.PivotStandaloneSetup.createInjectorAndDoEMFRegistration(PivotStandaloneSetup.java:75)
at org.eclipse.ocl.examples.pivot.PivotStandaloneSetup.doSetup(PivotStandaloneSetup.java:42)
at org.eclipse.ocl.examples.xtext.base.BaseStandaloneSetup.init(BaseStandaloneSetup.java:44)
at org.eclipse.ocl.examples.xtext.base.BaseStandaloneSetup.createInjectorAndDoEMFRegistration(BaseStandaloneSetup.java:68)
at org.eclipse.ocl.examples.xtext.base.BaseStandaloneSetup.doSetup(BaseStandaloneSetup.java:39)
at org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.init(EssentialOCLStandaloneSetup.java:43)
at org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.createInjectorAndDoEMFRegistration(EssentialOCLStandaloneSetup.java:72)
at org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.doSetup(EssentialOCLStandaloneSetup.java:38)
at abstractmodeller.model.prm.TestPivot.main(TestPivot.java:134)
Caused by: org.eclipse.emf.common.util.WrappedException: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'xmi' not found. (jar:file:/C:/eclipse-rcp-juno-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore, 3, 129)
at org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17007)
at org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.init(UMLPackageImpl.java:1903)
at org.eclipse.uml2.uml.UMLPackage.<clinit>(UMLPackage.java:82)
... 11 more
Caused by: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'xmi' not found. (jar:file:/C:/eclipse-rcp-juno-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore, 3, 129)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:77)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:185)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:240)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1505)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1284)
at org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17005)
... 13 more
Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'xmi' not found. (jar:file:/C:/eclipse-rcp-juno-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore, 3, 129)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.reportUnknownFeature(XMLHandler.java:1985)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleUnknownFeature(XMLHandler.java:1949)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.handleUnknownFeature(XMIHandler.java:145)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2703)
at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:74)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2187)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1324)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1462)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1013)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:77)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:995)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:706)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
Re: OCL Pivot Setting delegates in standalone application [message #901527 is a reply to message #901512] Mon, 13 August 2012 08:58 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Your stack trace is very odd.

UMLResourcesUtil.java:146 is just

packageRegistry.put(
"http://www.eclipse.org/uml2/2.0.0/UML",
UMLPackage.eINSTANCE); //$NON-NLS-1$

which is a rather boring initialization, made a little more exciting by
the large size of the UML model requiring construction by reading rather
than executing.

at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1505)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1284)
at
org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17005)

suggests that an XMLResource rather than a UMLResource is being read, so
I suspect you have some unwise initialization of your own in code that
you have not shared with us.

Regards

Ed Willink




On 13/08/2012 09:22, ModelGeek Mising name wrote:
> I have tried the latest version but i am still getting following
> exception
>
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at
> org.eclipse.uml2.uml.resources.util.UMLResourcesUtil.init(UMLResourcesUtil.java:146)
> at
> org.eclipse.ocl.examples.pivot.PivotStandaloneSetup.init(PivotStandaloneSetup.java:48)
> at
> org.eclipse.ocl.examples.pivot.PivotStandaloneSetup.createInjectorAndDoEMFRegistration(PivotStandaloneSetup.java:75)
> at
> org.eclipse.ocl.examples.pivot.PivotStandaloneSetup.doSetup(PivotStandaloneSetup.java:42)
> at
> org.eclipse.ocl.examples.xtext.base.BaseStandaloneSetup.init(BaseStandaloneSetup.java:44)
> at
> org.eclipse.ocl.examples.xtext.base.BaseStandaloneSetup.createInjectorAndDoEMFRegistration(BaseStandaloneSetup.java:68)
> at
> org.eclipse.ocl.examples.xtext.base.BaseStandaloneSetup.doSetup(BaseStandaloneSetup.java:39)
> at
> org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.init(EssentialOCLStandaloneSetup.java:43)
> at
> org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.createInjectorAndDoEMFRegistration(EssentialOCLStandaloneSetup.java:72)
> at
> org.eclipse.ocl.examples.xtext.essentialocl.EssentialOCLStandaloneSetup.doSetup(EssentialOCLStandaloneSetup.java:38)
> at abstractmodeller.model.prm.TestPivot.main(TestPivot.java:134)
> Caused by: org.eclipse.emf.common.util.WrappedException:
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature
> 'xmi' not found.
> (jar:file:/C:/eclipse-rcp-juno-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore,
> 3, 129)
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17007)
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.init(UMLPackageImpl.java:1903)
> at org.eclipse.uml2.uml.UMLPackage.<clinit>(UMLPackage.java:82)
> ... 11 more
> Caused by: org.eclipse.emf.ecore.resource.Resource$IOWrappedException:
> Feature 'xmi' not found.
> (jar:file:/C:/eclipse-rcp-juno-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore,
> 3, 129)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:77)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:185)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:240)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1505)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1284)
> at
> org.eclipse.uml2.uml.internal.impl.UMLPackageImpl.loadPackage(UMLPackageImpl.java:17005)
> ... 13 more
> Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature
> 'xmi' not found.
> (jar:file:/C:/eclipse-rcp-juno-win32/eclipse/plugins/org.eclipse.uml2.uml_4.0.0.v20120604-0919.jar!/org/eclipse/uml2/uml/internal/impl/uml.ecore,
> 3, 129)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.reportUnknownFeature(XMLHandler.java:1985)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleUnknownFeature(XMLHandler.java:1949)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.handleUnknownFeature(XMIHandler.java:145)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2703)
> at
> org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:74)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2187)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1324)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1462)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1013)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:77)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:995)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:706)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
> at
> org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
> at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
Previous Topic:Acceleo invoking a Java Service Wrapping OCL
Next Topic:processing AST, finding out if current parsed part is the body of the OCL expression
Goto Forum:
  


Current Time: Fri Apr 19 19:51:17 GMT 2024

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

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

Back to the top