Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo transformation(how to register schemas)
Acceleo transformation [message #1786299] Mon, 30 April 2018 12:28 Go to next message
Julieth Castellanos is currently offline Julieth CastellanosFriend
Messages: 8
Registered: April 2018
Junior Member
I get this problem when I try to transform a model from EPF COMPOSER in ACCELEO:

Package with uri 'http://www.eclipse.org/epf/uma/1.0.6' not found

How can I register the previous metamodel .

In advance, thank you for your answers.

Julieth Castellanos
Re: Acceleo transformation [message #1786305 is a reply to message #1786299] Mon, 30 April 2018 13:12 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

Read the instructions in the generated template. Better still. Follwo a tutorial.

Regards

Ed Willink
Re: Acceleo transformation [message #1786385 is a reply to message #1786305] Wed, 02 May 2018 13:02 Go to previous messageGo to next message
Julieth Castellanos is currently offline Julieth CastellanosFriend
Messages: 8
Registered: April 2018
Junior Member
Hi Ed

I imported the package that I needed (UMA from EPF COMPOSER) and I registered the metamodel (or I think so) in the following way:

if (!isInWorkspace(org.eclipse.epf.uma.UmaPackage.class)) {
resourceSet.getPackageRegistry().put(org.eclipse.epf.uma.UmaPackage.eINSTANCE.getNsURI(), org.eclipse.epf.uma.UmaPackage.eINSTANCE);
}

However, the following mistake still happens:

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.RegorousTransformationExample/model/SoftwareUnitProcess.xml, 2, 309)

I do not have a clue, what can be the problem..

If you know how to improve the problem, it will be very nice from you.

Thanks,

Julieth
Re: Acceleo transformation [message #1786386 is a reply to message #1786385] Wed, 02 May 2018 13:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

Sorry no clues since you have denied me the clues from a repro.

All I can say is that you almost certainly have not registered 'http://www.eclipse.org/epf/uma/1.0.6' in the executable that you ran.

Regards

Ed Willink
Re: Acceleo transformation [message #1786407 is a reply to message #1786386] Wed, 02 May 2018 21:44 Go to previous messageGo to next message
Julieth Castellanos is currently offline Julieth CastellanosFriend
Messages: 8
Registered: April 2018
Junior Member
Hi again

Thank you for the previous answer. I tried again, and it seems that now, the library is registered. This time I used the following sentence to register

EPackage.Registry.INSTANCE.put("http://www.eclipse.org/epf/uma/1.0.6", org.eclipse.epf.uma.UmaPackage.eINSTANCE);

But now, the error that I get is:

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/core/resources/IFile
at org.eclipse.epf.uma.impl.UmaFactoryImpl.createMethodLibrary(UmaFactoryImpl.java:1126)
at org.eclipse.epf.uma.impl.UmaFactoryImpl.create(UmaFactoryImpl.java:335)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.createObject(XMLHelperImpl.java:885)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.createObject(XMLHelperImpl.java:922)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2222)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1366)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1504)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1026)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:78)
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:190)
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.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$ContentDriver.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.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:261)
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)
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.module.sampleRegorousTransformation.main.Generate.<init>(Generate.java:93)
at org.eclipse.acceleo.module.sampleRegorousTransformation.main.Generate.main(Generate.java:147)
Caused by: java.lang.ClassNotFoundException: org.eclipse.core.resources.IFile
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 38 more


What can it be?... In advance thank you...

P.D. What do you mean with "repro."
Re: Acceleo transformation [message #1786416 is a reply to message #1786407] Thu, 03 May 2018 05:19 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

"Caused by: java.lang.ClassNotFoundException: org.eclipse.core.resources.IFile" should be impossible. org.eclipse.core.resources is always a required bundle. You must have done something magic.

Repro: See e.g. https://wiki.eclipse.org/OCL/ForumNetiquette

Regards

Ed Willink
Re: Acceleo transformation [message #1786423 is a reply to message #1786416] Thu, 03 May 2018 08:12 Go to previous messageGo to next message
Julieth Castellanos is currently offline Julieth CastellanosFriend
Messages: 8
Registered: April 2018
Junior Member
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 #1786431 is a reply to message #1786423] Thu, 03 May 2018 08:34 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
Hi

You have clearly done something magic. I am not prepared to spend my time helping you if you do not have time to create a repro to avoid my need to guess at your wizardry.

Regards

Ed Willink
Re: Acceleo transformation [message #1786437 is a reply to message #1786431] Thu, 03 May 2018 09:25 Go to previous messageGo to next message
Julieth Castellanos is currently offline Julieth CastellanosFriend
Messages: 8
Registered: April 2018
Junior Member
Hi again

Sorry for the inconvenience of my messages... I am pretty new in Acceleo and on the forums as well... Apart from the things I wrote in the previous message, I have prepared a .zip with the "project" done in Eclipse Oxigeno( Oxygen.3a Release (4.7.3a)) and Acceleo Version: 3.7.2.201708211328.

Hopefully, you have some answers

In advance, thank you

Julieth
Re: Acceleo transformation [message #1786443 is a reply to message #1786437] Thu, 03 May 2018 10:14 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6111
Registered: July 2009
Senior Member
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
Previous Topic:Obtain the xmi:id using ACCELEO
Next Topic:How pass string array[] as argument of a java service wrapper in acceleo ?
Goto Forum:
  


Current Time: Thu Nov 15 15:21:48 GMT 2018

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

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

Back to the top