Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving OMLZip produces seemingly incomplete file #325

Open
sjiherzig opened this issue Jan 23, 2020 · 0 comments
Open

Saving OMLZip produces seemingly incomplete file #325

sjiherzig opened this issue Jan 23, 2020 · 0 comments
Labels

Comments

@sjiherzig
Copy link
Member

Hi,

I have a process that transforms a model from its native format to OML. The process can run as a single step, or be divided up into two steps. In the latter case, the output of the first step is a single omlzip file, which is also the input to the second step. If I run the process as a single step, everything works as expected. However, if I run the process in two steps, and save the intermediate model as omlzip, and then try to load it during the second step, I get a NullPointerException.

The trace + context is as follows:

Starting transformation to IMCE OML
Building caches...
 - Aspects... [done]
 - Concepts... [done]
 - ReifiedRelationships... [done]
 - ConceptInstances... [done]
 - ScalarDataPropertyValues... java.lang.NullPointerException
	at gov.nasa.jpl.caesar.adapters.magicdraw.utilities.OMLSysMLEmbeddingHelper$8.accept(OMLSysMLEmbeddingHelper.java:343)
	at gov.nasa.jpl.caesar.adapters.magicdraw.utilities.OMLSysMLEmbeddingHelper$8.accept(OMLSysMLEmbeddingHelper.java:340)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at gov.nasa.jpl.caesar.adapters.magicdraw.utilities.OMLSysMLEmbeddingHelper.rebuildUMLModelCache(OMLSysMLEmbeddingHelper.java:360)
	at gov.nasa.jpl.caesar.adapters.magicdraw.transformation.export.MDOML2IMCEOMLTransformationNew.toOML(MDOML2IMCEOMLTransformationNew.java:208)
	at gov.nasa.jpl.caesar.adapters.magicdraw.transformation.export.MDOML2IMCEOMLTransformationNew.toOML(MDOML2IMCEOMLTransformationNew.java:151)
	at gov.nasa.jpl.caesar.adapters.magicdraw.transformation.app.MDExporter.mdOml2Oml(MDExporter.java:352)
	at gov.nasa.jpl.caesar.adapters.magicdraw.transformation.app.MDExporter.execute(MDExporter.java:319)
	at gov.nasa.jpl.caesar.adapters.magicdraw.transformation.app.MDExporter.main(MDExporter.java:608)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.nomagic.magicdraw.MainMethodLauncher.launch(MainMethodLauncher.java:26)
	at com.nomagic.magicdraw.ApplicationGateway.start(ApplicationGateway.java:46)
	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 com.nomagic.osgi.launcher.FrameworkLauncher$DefaultApplication.run(FrameworkLauncher.java:226)
	at com.nomagic.osgi.launcher.FrameworkLauncher.runFrameworkApplication(FrameworkLauncher.java:176)
	at com.nomagic.osgi.launcher.FrameworkLauncher.run(FrameworkLauncher.java:118)
	at com.nomagic.osgi.launcher.FrameworkLauncher.run(FrameworkLauncher.java:92)
	at com.nomagic.osgi.launcher.ProductionFrameworkLauncher.run(ProductionFrameworkLauncher.java:70)
	at com.nomagic.osgi.launcher.ProductionFrameworkLauncher.main(ProductionFrameworkLauncher.java:57

The NullPointerException is triggered in the following code fragment:

print(" - ScalarDataPropertyValues... ")
umlModel.singletonScalarDataPropertyValues.forEach[sdpv |
	val ci = sdpv.singletonInstance 
	val sdpName = sdpv.scalarDataProperty.name()    // Line 343 in the generated java file
	...
]

From this, the logical conclusion is that sdpv.scalarDataProperty is null. sdpv itself cannot be null, since line 342 executed fine.

An OMLZip file for inspection can be provided upon request.

@sjiherzig sjiherzig added the bug label Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant