executon of atl with java program :Problem with =loading BPMN resource [message #1791523] |
Sun, 01 July 2018 18:11  |
Eclipse User |
|
|
|
Hi guys,
I try to execute an ATL program with a java class that aims to transform an bpmn model into an other model. The execution of the file .ATL is incorrectly executed but when I run the class java the following errors are appeared in the console:
org.eclipse.m2m.atl.core.ATLCoreException: Error loading Models/process_1.bpmn: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'definitions' is not found or is abstract. (file:///C:/Users/Desktop/Nouveau%20dossier%20(5)/tuto1/Models/process_1.bpmn, 2, 370)
at org.eclipse.m2m.atl.core.emf.EMFInjector.inject(EMFInjector.java:70)
at org.eclipse.m2m.atl.core.emf.EMFInjector.inject(EMFInjector.java:84)
at com.BPMN2BPMNSUC.loadModels(BPMN2BPMNSUC.java:163)
at com.BPMN2BPMNSUC.main(BPMN2BPMNSUC.java:84)
Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'definitions' is not found or is abstract. (file:///C:/Users/aljia/Desktop/Nouveau%20dossier%20(5)/tuto1/Models/process_1.bpmn, 2, 370)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.m2m.atl.core.emf.EMFInjector.inject(EMFInjector.java:65)
... 3 more
Caused by: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'definitions' is not found or is abstract. (file:///C:/Users/aljia/Desktop/Nouveau%20dossier%20(5)/tuto1/Models/process_1.bpmn, 2, 370)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2251)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2242)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1339)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1475)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:77)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1008)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:719)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:163)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.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:175)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 5 more
Any help pleaase
|
|
|
|
Re: executon of atl with java program :Problem with =loading BPMN resource [message #1792471 is a reply to message #1791916] |
Wed, 18 July 2018 07:20   |
Eclipse User |
|
|
|
Hi:
I am having the same problem with a BPMN model created with BPMN2Modeler, but using the model as an input for an Acceleo project in this case.
When I try to create a module file in the Acceleo project, the metamodels that the model is conformant to have to be added. The graphical interface allows to choose among the registered metamodels, including:
http ://www. omg. org/spec/BPMN/20100524/DI
http ://www. omg. org/spec/BPMN/20100524/DI-XMI
http ://www. omg. org/spec/BPMN/20100524/MODEL
http ://www. omg. org/spec/BPMN/20100524/MODEL-XMI
http ://www. omg. org/spec/DD/20100524/DC
http ://www. omg. org/spec/DD/20100524/DC-XMI
http ://www. omg. org/spec/DD/20100524/DI
http ://www. omg. org/spec/DD/20100524/DI-XMI
that were registered when BPMN2Modeler was installed.
If I try to choose the metamodels not ending in -XMI, the graphical interface does not add them to the module file and doesn't yield any error message. On the other hand, if I choose the metamodels ending in -XMI, they are added to the module file.
However, when I try to run an example (both an example of mine or the example base.bmpn provided by Gonzalo López) the execution fails with the same error message that Alijia Bouzidi gets:
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'definitions' is not found or is abstract. (file:/Users/jmalvarez/workspaces/photon-mod-dsl-workspace/org.eclipse.acceleo.gonzalo.lopez.sample/models/base.bpmn, 3, 541)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:391)
at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:356)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:488)
at org.eclipse.acceleo.gonzalo.lopez.sample.common.Generate.<init>(Generate.java:90)
at org.eclipse.acceleo.gonzalo.lopez.sample.common.Generate.main(Generate.java:144)
Caused by: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'definitions' is not found or is abstract. (file:/Users/jmalvarez/workspaces/photon-mod-dsl-workspace/org.eclipse.acceleo.gonzalo.lopez.sample/models/base.bpmn, 3, 541)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.validateCreateObjectFromFactory(XMLHandler.java:2298)
. . . many more lines
I have tried another approach, changing manually the metamodels in the module file, specifying the metamodels not ending in -XMI, but the same error happens.
I guess the underlying reason for the failure is the same than in Aljia Bouzidi's case with ATL.
I would like to clarify that I have chosen the above mentioned metamodels because they are referenced in the model file (see attached file) in the bpmn2:definitions element, in paticular the fields xmlns:xsi, xmlns:bpmn2, xmlns:bpmndi, xmlns:dc and xmlns:di, but I admit that I do not know if they are the metamodels that have to be referenced.
Thanks in advance for any help.
Attachment: base.bpmn
(Size: 1.83KB, Downloaded 269 times)
|
|
|
|
|
|
Re: executon of atl with java program :Problem with =loading BPMN resource [message #1817011 is a reply to message #1791523] |
Wed, 13 November 2019 14:23  |
Eclipse User |
|
|
|
Hi, I come with my solution maeby a little late. I was having the same problem while trying to transform a BPMN model (.bpmn extension file) into Java code. Here's my solution to this problem.
Acceleo 3.7.8 and latest versions generate a Main.java class automatically which is used as the Acceleo text generator. Find that class and locate the registerPackages and registerResourceFactories methods.
Inside the "registerPackages" method add this snippet:
if (!isInWorkspace(Bpmn2Package.class)) {
resourceSet.getPackageRegistry().put(Bpmn2Package.eNS_URI, Bpmn2Package.eINSTANCE);
}
Then, inside the "registerResourceFactories" add this:
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("bpmn", new Bpmn2ResourceFactoryImpl());
You'll need to import the "org.eclipse.bpmn2" package in order to use these classes. After that, Acceleo worked successfully for me.
Good luck!
|
|
|
Powered by
FUDForum. Page generated in 0.05478 seconds