Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF compare] ExampleLauncher problem
[EMF compare] ExampleLauncher problem [message #646621] Wed, 29 December 2010 06:56 Go to next message
No real name is currently offline No real name
Messages: 42
Registered: December 2010
Member
HELP
that dosn't work
code :

final EObject model1 = ModelUtils.load(new File(" C:\\pfe\\runtime-EclipseApplication(1)\\LibraryTest\\My1.lib rary "), resourceSet1);




Loading resources.

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Class 'Library' is not found or is abstract. (file:/C:/pfe/runtime-EclipseApplication(1)/LibraryTest/My1. library, 2, 19)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLL oadImpl.java:83)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:191)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :381)
at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :278)
at org.eclipse.example.library.Test.main(Test.java:92)
Caused by: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'Library' is not found or is abstract. (file:/C:/pfe/runtime-EclipseApplication(1)/LibraryTest/My1. library, 2, 19)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2244)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObje ctFromFactory(XMLHandler.java:2235)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1332)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
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)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator. startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl$ContentDispatcher.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
... 6 more

[Updated on: Thu, 30 December 2010 03:41]

Report message to a moderator

Re: [EMF compare] ExampleLauncher problem [message #646892 is a reply to message #646621] Sun, 02 January 2011 12:26 Go to previous messageGo to next message
Philip Langer is currently offline Philip Langer
Messages: 30
Registered: July 2009
Member
Hi,

this is not an EMF Compare specific problem! It's general handling of
EMF models.

The exception indicates that you are loading an instance of a metamodel
that has not been registered yet. The metamodel package with the
specified URI "...example.eclipse.org/Library" has to be registered
before loading its instances.

That means, you must have the plug-in installed that specifies the
Library metamodel Package and its generated model code. This plug-in
should also extend the "generated_packages" extension point in order to
get its metamodel package automatically registered.

You can also register it manually before loading its instances by
calling its EPackage instance using something like:

<code>
LibraryPackage.eINSTANCE;
</code>

Of course, the LibraryPackage class must be in your build-path (e.g.,
plug-in dependency) to do so.

Hope that helps!

Cheers,

Philip


On 2010-12-29 12:56, ST wrote:
> HELP that dosn't work code :
>
> final EObject model1 = ModelUtils.load(new File("
> C:\\pfe\\runtime-EclipseApplication(1)\\LibraryTest\\My1.lib rary "),
> resourceSet1);
>
>
>
>
>
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Package with
> uri 'http://www.example.eclipse.org/Library' not found.
> (file:/C:/pfe/runtime-EclipseApplication(1)/LibraryTest/My1. library, 2,
> 73)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLL
> oadImpl.java:83)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.
> java:191)
> at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes
> ourceImpl.java:180)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour
> ceImpl.java:1494)
> at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour
> ceImpl.java:1282)
> at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :381)
> at org.eclipse.emf.compare.util.ModelUtils.load(ModelUtils.java :278)
> at org.eclipse.example.library.Test.main(Test.java:92)
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri 'http://www.example.eclipse.org/Library' not found.
> (file:/C:/pfe/runtime-EclipseApplication(1)/LibraryTest/My1. library, 2,
> 73)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X
> MLHandler.java:2591)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi
> x(XMLHandler.java:2422)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType
> (XMLHandler.java:1299)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM
> LHandler.java:1468)
> 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)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
> ndler.java:1001)
> at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa
> ndler.java:712)
> at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa
> ndler.java:169)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
> .startElement(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.
> startElement(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl.scanStartElement(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm
> pl$ContentDispatcher.scanRootElementHook(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
> at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS
> cannerImpl.scanDocument(Unknown Source)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
> n.parse(Unknown Source)
> at com.sun.org.apache.xerces.internal.parsers.XML11Configuratio
> n.parse(Unknown Source)
> at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U
> nknown Source)
> at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser
> .parse(Unknown Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.
> java:181)
> ... 6 more
>
Re: [EMF compare] ExampleLauncher problem [message #646935 is a reply to message #646892] Mon, 03 January 2011 04:32 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 42
Registered: December 2010
Member
thx, problem solved.
Re: [EMF compare] ExampleLauncher problem [message #990218 is a reply to message #646935] Tue, 11 December 2012 08:19 Go to previous messageGo to next message
Greg L is currently offline Greg L
Messages: 9
Registered: November 2012
Junior Member
Hi,

Can you provide some more detailed solution to the problem you had?
I am trying to perform HOT ATL transformations, and I have the following similar error when trying to load a resource content from the InputStream (result of a model transformation):

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Class 'Module' is not found or is abstract. (file:///C:/Users/XX/workspace/myFile.xmi, 3, 59)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:191)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:242)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1511)
	at fr.tpt.atl.hot.launcher.EModelCopyBackup.saveModels(EModelCopyBackup.java:257)
	at fr.tpt.atl.hot.launcher.EModelCopyBackup.main(EModelCopyBackup.java:108)
Caused by: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'Module' is not found or is abstract. (file://myClass.xmi, 3, 59)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2244)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2235)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1332)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1468)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1019)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:87)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1001)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:712)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:169)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
	at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:181)
	... 4 more


I run this in a standalone application, so I tried to register my metamodel manually before I will create an instance of it, in the following way:

resourceSet.getPackageRegistry().put("http://www.eclipse.org/gmt/2005/ATL", EcorePackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());


Am I missing something? Can you provide some more details on how did you solve the problem?
Thank you in advance.

Greg
Re: [EMF compare] ExampleLauncher problem [message #990225 is a reply to message #990218] Tue, 11 December 2012 08:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25948
Registered: July 2009
Senior Member
Greg,

What model does the class "Module" come from? Have you tried
registering that model, i.e.,

resourceSet.getPackageRegistry().put(XyxPackage.eNS_URI,
XyzPackage.eINSTANCE);


On 11/12/2012 2:19 PM, Greg L wrote:
> Hi,
>
> Can you provide some more detailed solution to the problem you had?
> I am trying to perform HOT ATL transformations, and I have the
> following similar error when trying to load a resource content from
> the InputStream (result of a model transformation):
>
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Class
> 'Module' is not found or is abstract.
> (file:///C:/Users/XX/workspace/myFile.xmi, 3, 59)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:191)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:242)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1511)
> at
> fr.tpt.atl.hot.launcher.EModelCopyBackup.saveModels(EModelCopyBackup.java:257)
> at
> fr.tpt.atl.hot.launcher.EModelCopyBackup.main(EModelCopyBackup.java:108)
> Caused by: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class
> 'Module' is not found or is abstract. (file://myClass.xmi, 3, 59)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2244)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2235)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1332)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1468)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1019)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:87)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1001)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:712)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:169)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown
> Source)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:181)
> ... 4 more
>
> I run this in a standalone application, so I tried to register my
> metamodel manually before I will create an instance of it, in the
> following way:
>
> resourceSet.getPackageRegistry().put("http://www.eclipse.org/gmt/2005/ATL",
> EcorePackage.eINSTANCE);
> resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore",
> new EcoreResourceFactoryImpl());
> resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi",
> new XMIResourceFactoryImpl());
>
> Am I missing something? Can you provide some more details on how did
> you solve the problem?
> Thank you in advance.
>
> Greg
Re: [EMF compare] ExampleLauncher problem [message #990421 is a reply to message #990225] Wed, 12 December 2012 07:45 Go to previous messageGo to next message
Greg L is currently offline Greg L
Messages: 9
Registered: November 2012
Junior Member
Hi Ed!

Thank you for your message. The "Module" class comes from the ATL metamodel.
However, I didn't notice that ATL.ecore contains 3 different packages, and so the registration of the ATL package should be done in the following way:

URI ecoreURI = URI.createFileURI("ATL.ecore"); 
Resource resourcePackage = resourceSet.getResource(ecoreURI, true); 
EPackage ePackage = (EPackage)resourcePackage.getContents().get(0); 
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/gmt/2005/ATL", ePackage);


So, this problem is solved.

Re: [EMF compare] ExampleLauncher problem [message #1214524 is a reply to message #646621] Wed, 27 November 2013 13:44 Go to previous messageGo to next message
Tarcísio Couto is currently offline Tarcísio Couto
Messages: 29
Registered: May 2013
Junior Member
Hello guys, I have a similiar problem, when a try to load a model in my tool, the following error happen:

!MESSAGE org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'definitions' is not found or is abstract. (file:/C:/Users/tcp/reference_process.bpmn, 2, 423)
!STACK 0

I don't know how to solve this problem, and if there is a code for this, I don't know what the code is and where to put it.
Re: [EMF compare] ExampleLauncher problem [message #1214609 is a reply to message #1214524] Wed, 27 November 2013 14:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25948
Registered: July 2009
Senior Member
If this question is about bpmn, it's best use their specific
newsgroup. Perhaps they provide a specialized resource implementation
(and associated resource factory) that you need to use...

On 27/11/2013 7:44 PM, Tarcísio Couto wrote:
> Hello guys, I have a similiar problem, when a try to load a model in
> my tool, the following error happen:
>
> !MESSAGE org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class
> 'definitions' is not found or is abstract.
> (file:/C:/Users/tcp/reference_process.bpmn, 2, 423)
> !STACK 0
>
> I don't know how to solve this problem, and if there is a code for
> this, I don't know what the code is and where to put it.
Re: [EMF compare] ExampleLauncher problem [message #1214618 is a reply to message #1214609] Wed, 27 November 2013 14:37 Go to previous messageGo to next message
Tarcísio Couto is currently offline Tarcísio Couto
Messages: 29
Registered: May 2013
Junior Member
As you can see, this is the same problem.. How to register a metamodel. So, I think that my post is the correct place.
Re: [EMF compare] ExampleLauncher problem [message #1215660 is a reply to message #1214618] Thu, 28 November 2013 01:14 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 25948
Registered: July 2009
Senior Member
Does your problem involve EMF compare?

On 27/11/2013 8:37 PM, Tarcísio Couto wrote:
> As you can see, this is the same problem.. How to register a
> metamodel. So, I think that my post is the correct place.
Previous Topic:EMF reference and referenced entities as elements in XML
Next Topic:[xcore] IndexOutOfBoundsException
Goto Forum:
  


Current Time: Fri Aug 01 04:01:06 EDT 2014

Powered by FUDForum. Page generated in 0.02190 seconds