Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] NullPointerException when running standalone
[Acceleo] NullPointerException when running standalone [message #1755338] Thu, 02 March 2017 13:06 Go to next message
Benno Kallweit is currently offline Benno KallweitFriend
Messages: 7
Registered: November 2016
Junior Member
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 08:47 Go to previous messageGo to next message
Benno Kallweit is currently offline Benno KallweitFriend
Messages: 7
Registered: November 2016
Junior Member
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 09:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6040
Registered: July 2009
Senior Member
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 11:12 Go to previous message
Benno Kallweit is currently offline Benno KallweitFriend
Messages: 7
Registered: November 2016
Junior Member
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: Sun Sep 23 12:45:21 GMT 2018

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

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

Back to the top