|
|
|
|
|
|
Re: Acceleo transformation [message #1786423 is a reply to message #1786416] |
Thu, 03 May 2018 04:12   |
Eclipse User |
|
|
|
Hi again
Thank you very much for your answers... I will try to explain better my purpose with this transformation. Well, I need to transform an .xml file created with EPF composer... The file is called SoftwareUnitProcess.xml (it is attached). As I understand, the file is created, based on the UMA metamodel. I have the UMA.ecore, and the uma.xsd, and even the jar org.eclipse.epf.uma_1.5.0.201611202248, from epf composer. To try to read the model, I imported the previous jar, and other jars in the referenced Libraries.
Then I modified the public void registerPackages(ResourceSet resourceSet), addign this code:
if (!isInWorkspace(org.eclipse.epf.uma.UmaPackage.class)) {
resourceSet.getPackageRegistry().put(org.eclipse.epf.uma.UmaPackage.eINSTANCE.getNsURI(), org.eclipse.epf.uma.UmaPackage.eINSTANCE);
But this error happends:
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.eclipse.org/epf/uma/1.0.6' not found. (file:/C:/Users/jcs01/Dropbox/EclipseOxigeno-workspace/org.eclipse.acceleo.module.sampleRegorousTransformation/Model/SoftwareUnitProcess.xml, 2, 309)
The error, as you say, is that the library is not register, so I deleted the previous line and instead I add this :
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/epf/uma/1.0.6", org.eclipse.epf.uma.UmaPackage.eINSTANCE);
The error is
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/resources/IFile
I even tried with
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/epf/uma/1.0.6", UMLPackage.eINSTANCE);
and
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/epf/uma/1.0.6", EcorePackage.eINSTANCE);
But in both I got this error:
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.ClassNotFoundException: Class 'MethodLibrary' is not found or is abstract. (file:/C:/Users/jcs01/Dropbox/EclipseOxigeno-workspace/org.eclipse.acceleo.module.sampleRegorousTransformation/Model/SoftwareUnitProcess.xml, 2, 309)
The transformation code is :
[comment encoding = UTF-8 /]
[**
* The documentation of the module generate.
*/]
[module generate('http://www.eclipse.org/epf/uma/1.0.6')]
[**
* The documentation of the template generateElement.
* @param a
*/]
[template public generateElement(a : uma::DeliveryProcess )]
[comment @main/]
[file (a.name, false, 'UTF-8')]
[/file]
[/template]
|
|
|
|
|
Re: Acceleo transformation [message #1786443 is a reply to message #1786437] |
Thu, 03 May 2018 06:14  |
Eclipse User |
|
|
|
Hi
Your repro has a UMA.ecore but nothing to resolve the strange
<classpathentry kind="lib" path="C:/Users/jcs01/Documents/epf-composer-1.5.1.8-win32/epf-composer/plugins/org.eclipse.epf.uma.ecore_1.5.0.201611202248.jar"/>
<classpathentry kind="lib" path="C:/Users/jcs01/Documents/epf-composer-1.5.1.8-win32/epf-composer/plugins/org.eclipse.epf.uma_1.5.0.201611202248.jar"/>
<classpathentry kind="lib" path="C:/Users/jcs01/Documents/epf-composer-1.5.1.8-win32/epf-composer/plugins/org.eclipse.epf.xml.uma_1.2.0.201611202248.jar"/>
<classpathentry kind="lib" path="C:/Users/jcs01/Documents/epf-composer-1.5.1.8-win32/epf-composer/plugins/org.eclipse.epf.ui_1.5.0.201611202248.jar"/>
These are very fragile. Much easier to use the MANIFEST.MF.
The UMA.ecore is detached from its UML.genmodel so perhaps that is your problem.
I see problems but not enough of a repro to see what you have hidden.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.03587 seconds