I'm having some trouble when invoking Texo's code generation through the Equinox launcher from the command line (I'm trying to integrate the code generation process in my Gradle build setup).
Specifically, I run into a NPE from L352 in
GeneratorUtils.readEPackagesUsingEMFURI(final List<URI> uris, ResourceSet resourceSet, EPackage.Registry registry)
which is invoked in L331 through the overload GeneratorUtils.readEPackagesUsingEMFURI(final List<URI> uris, EPackage.Registry registry)
Since the two parameter version supplies null for the ResourceSet, the null pointer access is guaranteed. Maybe the second parameter was intended to be the return value of the otherwise unused method GeneratorUtils.createGenerationResourceSet?
I'm using the latest available version of Texo on Eclipse Mars (0.9.0.v201508051411).
If anybody has encountered this problem before and knows a workaround, I would be most grateful! Thanks for your responses in advance!
Best,
Adrian
Attached stacktrace:
java.lang.RuntimeException: Exception for model file file:/C:/Users/Adriano/MDSD4SIL/EAMetamodel/model/enterprise_architect.ecore
at org.eclipse.emf.texo.eclipse.generator.TexoGeneratorApplication.generateCode(TexoGeneratorApplication.java:167)
at org.eclipse.emf.texo.eclipse.generator.TexoGeneratorApplication.start(TexoGeneratorApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
Caused by: java.lang.NullPointerException
at org.eclipse.emf.texo.generator.GeneratorUtils.readEPackagesUsingEMFURI(GeneratorUtils.java:352)
at org.eclipse.emf.texo.generator.GeneratorUtils.readEPackagesUsingEMFURI(GeneratorUtils.java:331)
at org.eclipse.emf.texo.eclipse.generator.TexoGeneratorApplication.generateCode(TexoGeneratorApplication.java:174)
at org.eclipse.emf.texo.eclipse.generator.TexoGeneratorApplication.generateCode(TexoGeneratorApplication.java:165)
My launcher invocation looks like this:
java -jar c:/Users/Adriano/Desktop/Development/eclipse-modeling-mars-R-win32-x86_64/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar -data C:/Users/Adriano/MDSD4SIL -application org.eclipse.emf.texo.eclipse.generator.TexoCodeGenerator -modelLocation C:/Users/Adriano/MDSD4SIL/EAMetamodel/model -projectName EAMetamodel.model
]]>