pondělí 4. července 2011

Long breaks from work suck!

It's month and a half since my last commit to the project, not counting a little commit consisting of only gitignore files :). A lot of things happen since that time. First of all, I forgot a lot about the project, so I don't know how long it will take to get back. And there's another new thing - a brand new version of Eclipse is out.

I was experimenting with Indigo before but I've got some problems with that. I don't really remember what was the problem, but since Indigo is oficially out now, I will try to finally port trunk to Indigo and then I will carry on with development. I created a branch for indigo before, it's called eclipse-indigo. So let's see if there's still a problem.

So the problem seems to be with Acceleo and can be reproduced using these steps:

  1. First I launch karel plugins (org.macjariel.karel, org.macjariel.karel.generator) in another Eclipse runtime.
  2. In new Eclipse instance I create new Acceleo project. I set metamodel to my karel metamodel and I import org.macjariel.karel.generator project.
  3. Then I create a main Acceleo module which imports the generateKarelProgram module from generator project.
  4. I got a build error and a NullPointerException in the main Eclipse instance:
!ENTRY org.eclipse.core.resources 4 75 2011-07-04 21:16:32.493
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.acceleo.ide.ui 4 75 2011-07-04 21:16:32.494
!MESSAGE Errors running builder 'Acceleo Builder' on project 'org.macjariel.karel.sample'.
!STACK 0
java.lang.NullPointerException
at org.eclipse.acceleo.internal.parser.ast.ocl.environment.AcceleoTypeResolver.classifierEqual(AcceleoTypeResolver.java:228)
at org.eclipse.acceleo.internal.parser.ast.ocl.environment.AcceleoTypeResolver.findShadowClass(AcceleoTypeResolver.java:205)
at org.eclipse.acceleo.internal.parser.ast.ocl.environment.AcceleoTypeResolver.findShadowClass(AcceleoTypeResolver.java:1)
at org.eclipse.ocl.AbstractTypeResolver.getShadowClass(AbstractTypeResolver.java:950)
at org.eclipse.ocl.AbstractTypeResolver.resolveAdditionalOperation(AbstractTypeResolver.java:737)
at org.eclipse.ocl.AbstractEnvironment.addOperation(AbstractEnvironment.java:478)
at org.eclipse.ocl.AbstractEnvironment.addHelperOperation(AbstractEnvironment.java:456)
at org.eclipse.ocl.ecore.EcoreEnvironment.defineOperation(EcoreEnvironment.java:582)
at org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.addTemplateToScope(OCLParser.java:497)
at org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.addBehavioralFeaturesToScope(OCLParser.java:443)
at org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.addRecursivelyBehavioralFeaturesToScope(OCLParser.java:347)
at org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.addRecursivelyBehavioralFeaturesToScope(OCLParser.java:323)
at org.eclipse.acceleo.internal.parser.ast.CST2ASTConverterWithResolver.transformStepResolve(CST2ASTConverterWithResolver.java:185)
at org.eclipse.acceleo.internal.parser.ast.CST2ASTConverterWithResolver.resolveAST(CST2ASTConverterWithResolver.java:125)
at org.eclipse.acceleo.internal.parser.ast.CST2ASTConverterWithResolver.resolveAST(CST2ASTConverterWithResolver.java:104)
at org.eclipse.acceleo.parser.AcceleoSourceBuffer.resolveAST(AcceleoSourceBuffer.java:336)
at org.eclipse.acceleo.parser.AcceleoParser.resolveAST(AcceleoParser.java:239)
at org.eclipse.acceleo.parser.AcceleoParser.parse(AcceleoParser.java:215)
at org.eclipse.acceleo.parser.AcceleoParser.parse(AcceleoParser.java:123)
at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoCompileOperation.doCompileResources(AcceleoCompileOperation.java:171)
at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoCompileOperation.run(AcceleoCompileOperation.java:127)
at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.incrementalBuild(AcceleoBuilder.java:233)
at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.build(AcceleoBuilder.java:94)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

After some time I found a workaround to this problem. Import the generator project into the runtime Eclipse instance (it should just override the plugin package, so you don't need to close the generator package in the first instance). Then the problem disappears.

In the future I would like to solve the problem. It seems that Acceleo has problems importing modules from plug-in bundles.

EDIT: It seems that problem is solved, but don't ask me why :). I've just removed the imported generator project and it worked. So I've just commited it - I'm too lazy to investigate more, or there are more necessary things to do.

1 komentář:

  1. https://bugs.eclipse.org/bugs/show_bug.cgi?id=352452

    According to the bug report, it should be working in Acceleo 3.1.1. Hopefully, it will be so and until then, I will use the workaround described in the blog post.

    BTW. the issue reappears randomly after using the workaround, so you have to reapply the workaround (by importing the generator project again) each time the issue shows up.

    OdpovědětVymazat