Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Internal Error ArrayIndexOutOfBoundsException
[Acceleo] Internal Error ArrayIndexOutOfBoundsException [message #899492] Wed, 01 August 2012 07:27 Go to next message
E. TOSI is currently offline E. TOSI
Messages: 10
Registered: July 2012
Junior Member
Hello,

Strange behaviour when generating a file with Acceleo 3.3 and Eclipse Juno 4.2
If file not exists in output directory all is OK (if I delete manually before generation it's OK)
But, if the generated file already exists in the output directory i've got this exception :
Caused by: java.lang.ArrayIndexOutOfBoundsException: 8192
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationContext$LineReader.readLine(AcceleoEvaluationContext.java:1134)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationContext.internalSaveProtectedAreas(AcceleoEvaluationContext.java:867)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationContext.saveProtectedAreas(AcceleoEvaluationContext.java:887)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationContext.openNested(AcceleoEvaluationContext.java:700)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.createFileWriter(AcceleoEvaluationVisitor.java:286)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.delegateCreateFileWriter(AcceleoEvaluationVisitor.java:1369)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoFileBlock(AcceleoEvaluationVisitor.java:417)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1811)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1041)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoTemplate(AcceleoEvaluationVisitor.java:913)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1782)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1041)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoTemplateInvocation(AcceleoEvaluationVisitor.java:964)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1821)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1041)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoTemplate(AcceleoEvaluationVisitor.java:913)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1782)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1041)
	at org.eclipse.ocl.internal.evaluation.QueryImpl.evaluate(QueryImpl.java:152)
	at org.eclipse.ocl.ecore.QueryImpl.evaluate(QueryImpl.java:62)
	at org.eclipse.acceleo.engine.generation.AcceleoEngine.doEvaluate(AcceleoEngine.java:364)
	at org.eclipse.acceleo.engine.generation.AcceleoEngine.evaluate(AcceleoEngine.java:141)
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerateTemplate(AcceleoService.java:884)
	at org.eclipse.acceleo.engine.service.AcceleoService.doGenerate(AcceleoService.java:575)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.generate(AbstractAcceleoGenerator.java:193)
	at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.doGenerate(AbstractAcceleoGenerator.java:158)
	at fr.logsystem.logfms.uml.gen.csharp.main.GenerateCSharp.doGenerate(GenerateCSharp.java:202)
	at org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoLaunchOperation.run(AcceleoLaunchOperation.java:149)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2326)
	at org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoPluginLaunchingStrategy.launch(AcceleoPluginLaunchingStrategy.java:239)
	at org.eclipse.acceleo.ide.ui.launching.strategy.AcceleoPluginLaunchingStrategy.launch(AcceleoPluginLaunchingStrategy.java:141)
	at org.eclipse.acceleo.internal.ide.ui.launching.AcceleoLaunchDelegate.launch(AcceleoLaunchDelegate.java:51)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
	at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
	at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
	at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


What can I do to solve this problem ?

TXS,
Eric
Re: [Acceleo] Internal Error ArrayIndexOutOfBoundsException [message #899571 is a reply to message #899492] Wed, 01 August 2012 13:29 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

It has been fixed now, for more information: https://bugs.eclipse.org/bugs/show_bug.cgi?id=385312.

Quote:
This is a known (and fixed) issue coming from the fact that you are generating on windows and there is a "\r" at an index "n" with "n = x * 8191". Since the size of our buffer to read protected areas is 8192, we have found a "\r" at the index 8191 which is the last index of our buffer "READ_BUFFER[index]", we are looking for a possible "\n" to look for a windows line separator at the next offset which creates this array index out of bounds. You can see the fix here:
https://github.com/eclipse/acceleo/commit/7b289e8bf548cb0f0782fa60b60da71b52d406b2

The fix will be available in Acceleo 3.3.1, in the mean time, you can switch your line delimiter or if possible change few characters in your generated code to change the index of the "\r".

You can also use the Acceleo build created just after this fix with this update site:
https://hudson.eclipse.org/hudson/job/m2t-acceleo-master/257/artifact/Acceleo.p2.repository/

This update site is temporary and it will be removed in a couple weeks. This fix was not included in the juno release (3.3.0) since the problem was discovered a bit too late. The build linked is exactly the juno release with only this fix.

Don't hesitate to reopen this issue if the problem persists with the version of Acceleo linked here if you choose to use it (version 3.3.0.v20120619-0324).


Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau & @acceleo
Google+: stephane.begaudeau & acceleo
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Re: [Acceleo] Internal Error ArrayIndexOutOfBoundsException [message #899572 is a reply to message #899571] Wed, 01 August 2012 13:39 Go to previous message
E. TOSI is currently offline E. TOSI
Messages: 10
Registered: July 2012
Junior Member
Hi Stephane,

Thanks for your response.
I generate CSharp code files for Windows, so "\r\n" is required on my templates.
But this bug appear on a template for generate a Xml File, so I will go back to '\n' to avoid this problem waiting for a new stable version of Acceleo

Regards,
Eric
Previous Topic:XPand2 / MWE: Load file for XPand generator from outside the Java classpath?
Next Topic:[Acceleo] how to input multiple models URGENT!!
Goto Forum:
  


Current Time: Wed Sep 17 13:47:19 GMT 2014

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

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