Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] NullPointerException when running standalone
[Acceleo] NullPointerException when running standalone [message #1755338] Thu, 02 March 2017 08:06 Go to next message
Eclipse UserFriend
Hi,

i have a Project to generate Java files with Acceleo. When i start the generation in eclipse everything works just fine.

If i start the generation without eclipse, so just the exported jar file, i get the following exception:
Quote:
java.lang.NullPointerException
at org.eclipse.acceleo.common.internal.utils.workspace.AcceleoWorkspaceUtil.getResourceURL(AcceleoWorkspaceUtil.java:278)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.findModuleURL(AbstractAcceleoGenerator.java:746)
at org.eclipse.acceleo.engine.service.AbstractAcceleoGenerator.initialize(AbstractAcceleoGenerator.java:408)
at cpsModeler.logic.interceptor.codeGenerator.main.Generate.<init>(Generate.java:118)


here is the code i use to start the generation:
File projectRoot = new File(getMySourcePath().concat(acceleoFilesPath));
AcceleoProject acceleoProject = new AcceleoProject(projectRoot);
new AcceleoParser(acceleoProject, false, false, false).buildAll(null);

Generate codeGenerator = new Generate(model, new File(getMySourcePath() + outputPath),Collections.emptyList());
codeGenerator.registerPackages(generationResource.getResourceSet());
codeGenerator.registerResourceFactories(generationResource.getResourceSet());
	    
codeGenerator.doGenerate(new BasicMonitor());


Here Generate is the automatically generated java file from Acceleo.

What am i doing wrong? Any Ideas?
Re: [Acceleo] NullPointerException when running standalone [message #1756300 is a reply to message #1755338] Wed, 15 March 2017 04:47 Go to previous messageGo to next message
Eclipse UserFriend
Update:

AcceleoCommonPlugin.getDefault() returns null, maybe this can help to identify the cause
Re: [Acceleo] NullPointerException when running standalone [message #1756304 is a reply to message #1756300] Wed, 15 March 2017 05:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi

This suggests that the plugin has not been started.

When running standalone, it is usually necessary to avoid facilities that require plugins to be started. However some plugins have specific procedures to support standalone initialization. I have no idea what Acceleo provides, so I would debug what happens in a working example.

Regards

Ed Willink
Re: [Acceleo] NullPointerException when running standalone [message #1757824 is a reply to message #1756304] Mon, 20 March 2017 07:12 Go to previous message
Eclipse UserFriend
Thanks for your reply.

I also suggest, that this Plugin is not running but could not yet figure out why. Maybe i missed something i should have executed but did still not find any information about it. Working examples can only be run in eclipse (what is my current problem) where the acceleo plugin seems to start this specific plugin.

Best regards

Benno
Previous Topic:[acceleo] let =null
Next Topic:modelToSysml
Goto Forum:
  


Current Time: Mon May 12 21:13:15 EDT 2025

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

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

Back to the top