Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Maven build for Acceleo 3.3
[Acceleo] Maven build for Acceleo 3.3 [message #1744644] Thu, 29 September 2016 08:51 Go to next message
Pierre Gaufillet is currently offline Pierre GaufilletFriend
Messages: 16
Registered: September 2015
Junior Member
Hi!

I am currently automating with Maven/Tycho the build of an Acceleo transformation for Capella 1.0.1. The build seems to happen correctly (see the log extract below): emtl files are produced and the installation of the resulting bundle works fine. Unfortunately the transformation fails when reading the emtl file with the following error:

Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(Unknown Source)
	at org.eclipse.emf.ecore.impl.EModelElementImpl.eObjectForURIFragmentSegment(EModelElementImpl.java:417)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:774)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:750)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setValueFromId(XMLHandler.java:2811)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2716)
	at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:79)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2188)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromTypeName(XMLHandler.java:2091)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObject(XMLHandler.java:2026)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.createObject(XMIHandler.java:128)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleFeature(XMLHandler.java:1809)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1018)
	at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:81)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:996)
	at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:707)
	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.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:175)
	at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:240)
	at org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLoad(EMtlResourceImpl.java:93)
	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.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:361)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:454)


The build is done with Acceleo 3.6.4, and the installation platform includes Acceleo 3.3.2. Is it a compatibility issue between these 2 versions?
Am I missing something else ?

Your help is welcome!

Pierre

---

Maven log extract:

[INFO] --- org.eclipse.acceleo.maven:3.6.4:acceleo-compile (acceleo-compile) @ com.irtsaintexupery.capella2aadl ---
[INFO] Acceleo maven stand alone build...
[INFO] Starting packages registration...
[INFO] Registering package 'org.eclipse.emf.ecore.EcorePackage'.
[INFO] Registering package 'org.polarsys.capella.core.data.pa.PaPackage'.
[INFO] Registering package 'org.polarsys.capella.core.data.cs.CsPackage'.
[INFO] Registering package 'org.polarsys.capella.core.data.capellacore.CapellacorePackage'.
[INFO] Registering package 'org.polarsys.capella.core.data.capellamodeller.CapellamodellerPackage'.
[INFO] Registering package 'org.polarsys.capella.common.libraries.LibrariesPackage'.
[INFO] Registering package 'org.polarsys.capella.core.data.capellacommon.CapellacommonPackage'.
[INFO] Registering package 'org.polarsys.capella.core.data.capellacore.CapellacorePackage'.
[INFO] Starting the build sequence for the project '[...]/eclipse/plugins/com.irtsaintexupery.capella2aadl'...
[INFO] Mapping the pom.xml to AcceleoProject...
[INFO] Adding jar dependencies...
[INFO] Starting parsing...
[INFO] Saving ouput file for '[...]/eclipse/plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/requests/capella2aadl_queries.mtl'.
[INFO] Saving ouput file for '[...]/eclipse/plugins/com.irtsaintexupery.capella2aadl/src/com/irtsaintexupery/capella2aadl/main/capella2aadl.mtl'.
[INFO] Build completed.
Re: [Acceleo] Maven build for Acceleo 3.3 [message #1744772 is a reply to message #1744644] Fri, 30 September 2016 07:27 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1857
Registered: July 2009
Senior Member
Hi,

This is a known incompatibility due to the changes in serialization brought by EMF for models extending Ecore.ecore, which Acceleo does transitively because of its dependency on OCL.

If you use an environement with EMF 2.9 or higher to compile the acceleo modules, you can only use an environement with EMF 2.9 or higher to use the compiled results. See also the wiki on that point.

Laurent Goubet
Obeo
Re: [Acceleo] Maven build for Acceleo 3.3 [message #1744774 is a reply to message #1744772] Fri, 30 September 2016 07:39 Go to previous message
Pierre Gaufillet is currently offline Pierre GaufilletFriend
Messages: 16
Registered: September 2015
Junior Member
Thanks for your help Laurent!

I have already red this wiki page, but I missed that I was in this case... Confused

Pierre
Previous Topic:Dynamic profile not detected on second maven execution
Next Topic:Acceleo UI plugin doesn't generate anything
Goto Forum:
  


Current Time: Thu Jun 21 16:29:44 GMT 2018

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

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

Back to the top