Systems-Modeling / SysML-v2-Pilot-Implementation

Proof-of-concept pilot implementation of the SysML v2 textual notation and visualization
GNU Lesser General Public License v3.0
128 stars 24 forks source link

Possible readme typo and Xtext generation issue #441

Closed dallman2 closed 1 year ago

dallman2 commented 1 year ago

Possible typo in the Getting Started section

The Getting Started section says that Xtext artifacts must be generated from this file org.omg.kerml.xtext.expressions/src/org.omg.kerml.expressions.xtext/KerMLExpressions.xtext. But, that file does not exist! The file org.omg.kerml.expressions.xtext/src/org.omg.kerml.expressions.xtext/KerMLExpressions.xtext does exist, is this what is meant?

Error in Xtext artifact generation

When running the artifact generation for any of the Xtext files mentioned in Getting Started, the following error is produced. I used the Oomph installer method with a fresh install of both Java and Eclipse to set up my environment...

0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri 'C:\repos\sysml\SySML-v2-Pilot-Implementation'
103  [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project .antlr-generator at 'archive:file:/C:/repos/sysml/SySML-v2-Pilot-Implementation/org.omg.kerml.expressions.xtext/.antlr-generator-3.2.0-patch.jar!/' and using 'archive:file:/C:/repos/sysml/SySML-v2-Pilot-Implementation/org.omg.kerml.owl/.antlr-generator-3.2.0-patch.jar!/' instead.
178  [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project .antlr-generator at 'archive:file:/C:/repos/sysml/SySML-v2-Pilot-Implementation/org.omg.kerml.owl/.antlr-generator-3.2.0-patch.jar!/' and using 'archive:file:/C:/repos/sysml/SySML-v2-Pilot-Implementation/org.omg.kerml.xtext/.antlr-generator-3.2.0-patch.jar!/' instead.
222  [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project .antlr-generator at 'archive:file:/C:/repos/sysml/SySML-v2-Pilot-Implementation/org.omg.kerml.xtext/.antlr-generator-3.2.0-patch.jar!/' and using 'archive:file:/C:/repos/sysml/SySML-v2-Pilot-Implementation/org.omg.sysml/.antlr-generator-3.2.0-patch.jar!/' instead.
1181 [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project .antlr-generator at 'archive:file:/C:/repos/sysml/SySML-v2-Pilot-Implementation/org.omg.sysml/.antlr-generator-3.2.0-patch.jar!/' and using 'archive:file:/C:/repos/sysml/SySML-v2-Pilot-Implementation/org.omg.sysml.xtext/.antlr-generator-3.2.0-patch.jar!/' instead.
[Fatal Error] :1:1: Content is not allowed in prolog.
1260 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems instantiating module org.omg.kerml.expressions.xtext.GenerateKerMLExpressions: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module org.omg.kerml.expressions.xtext.GenerateKerMLExpressions: java.lang.reflect.InvocationTargetException
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:96)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:63)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:53)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
    at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:60)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:147)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:118)
    at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:303)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:70)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:146)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:118)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:303)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:70)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:84)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:303)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:70)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:66)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:94)
    ... 4 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:58)
    ... 28 more
Caused by: java.lang.RuntimeException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at org.eclipse.emf.mwe.utils.StandaloneSetup.handleException(StandaloneSetup.java:398)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.registerProject(StandaloneSetup.java:436)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:327)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:316)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:316)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:316)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:298)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.setPlatformUri(StandaloneSetup.java:258)
    ... 33 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:261)
    at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
    at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.registerProject(StandaloneSetup.java:429)
    ... 39 more
Joshua-Latimer-H18 commented 1 year ago

I'm seeing the same behavior using out-of-the-box Debian 11 latest, see output below. Should I be using a different file for Run As > Generate Xtext Artifacts? I am currently using:

org.omg.kerml.expressions.xtext/src/org.omg.kerml.expressions.xtext/KerMLExpressions.xtext

Output

0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri '/home/sysml2dev/SySML-v2-Pilot-Implementation'
108  [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project .antlr-generator at 'archive:file:/home/sysml2dev/SySML-v2-Pilot-Implementation/org.omg.sysml.xtext/.antlr-generator-3.2.0-patch.jar!/' and using 'archive:file:/home/sysml2dev/SySML-v2-Pilot-Implementation/org.omg.kerml.expressions.xtext/.antlr-generator-3.2.0-patch.jar!/' instead.
124  [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project .antlr-generator at 'archive:file:/home/sysml2dev/SySML-v2-Pilot-Implementation/org.omg.kerml.expressions.xtext/.antlr-generator-3.2.0-patch.jar!/' and using 'archive:file:/home/sysml2dev/SySML-v2-Pilot-Implementation/org.omg.kerml.owl/.antlr-generator-3.2.0-patch.jar!/' instead.
149  [main] WARN  lipse.emf.mwe.utils.StandaloneSetup  - Skipping conflicting project .antlr-generator at 'archive:file:/home/sysml2dev/SySML-v2-Pilot-Implementation/org.omg.kerml.owl/.antlr-generator-3.2.0-patch.jar!/' and using 'archive:file:/home/sysml2dev/SySML-v2-Pilot-Implementation/org.omg.kerml.xtext/.antlr-generator-3.2.0-patch.jar!/' instead.
[Fatal Error] :1:1: Content is not allowed in prolog.
167  [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - Problems instantiating module org.omg.kerml.expressions.xtext.GenerateKerMLExpressions: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module org.omg.kerml.expressions.xtext.GenerateKerMLExpressions: java.lang.reflect.InvocationTargetException
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:96)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:63)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:53)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
    at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:60)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:147)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:118)
    at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:303)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:70)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:146)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:118)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:303)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:70)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:84)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:303)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:70)
    at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:66)
    at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:94)
    ... 4 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:58)
    ... 28 more
Caused by: java.lang.RuntimeException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at org.eclipse.emf.mwe.utils.StandaloneSetup.handleException(StandaloneSetup.java:398)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.registerProject(StandaloneSetup.java:436)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:327)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:316)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:316)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:316)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.scanFolder(StandaloneSetup.java:298)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.setPlatformUri(StandaloneSetup.java:258)
    ... 33 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:261)
    at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)
    at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:122)
    at org.eclipse.emf.mwe.utils.StandaloneSetup.registerProject(StandaloneSetup.java:429)
    ... 39 more
seidewitz commented 1 year ago

Sorry about this.

It seems to be due to the .project files added to the model library subdirectories of sysml.library. These are not Eclipse .project files but, rather, JSON-formatted files consistent with the recently specified project interchange formal for KerML and SysML. Unfortunately, even though the Xtext generation has nothing to do with sysml.library, the worflow engine seems to be scanning the entire workspace looking for Eclipse projects. And the errors happen when it tries to read the .project files in the sysml.library subdirectories as XML files.

If you delete all the JSON .project files under sysml.library, then the Xtext generations will run without errors. Or, I have pushed a commit to master that (at least temporarily) renames all those files to .proj. If you pull this commit, then you should also be able to run the Xtext generations without any problem.

dallman2 commented 1 year ago

Ed,

Fantastic, the fix worked. Will the change be permanent to the names? Additionally, I am having trouble getting the PlantUML visualizer to work. I have a working GraphViz install, and the PlantUML pane is showing up in the runtime Eclipse instance, but no graph is being shown when I open a file in the editor...

seidewitz commented 1 year ago

Whether the name change will be "official" in the standard is still pending internal discussion. However, given the issues with Eclipse, I certianly will not change the names back to .project in the system.library subdirectories in the development repository.

As to PlantUML, there was no update but bug fixes in the 2022-11 release. There was an update to a new version in 2022-10, but if you did a clean install for the latest release (or had your installation working for 2022-10), there should not have been any change for 2022-11. Nevertheless, there have been perennial issues with PlantUML that seem to keep popping up. However, it would be better for you to post to the SysML v2 Release Google Group for help on that, rather than in a GitHub issue.

seidewitz commented 1 year ago

And also, you are correct about the typo in the README. I have fixed that.

dallman2 commented 1 year ago

I understand. I'm not discounting that maybe I am just not doing the right thing to make it work, rather than there being a bug of some sort. I am going to close this issue, but I do have more questions about the purpose and capabilities of this repository. Are you available to chat with myself and @Joshua-Latimer-H18 at some point soon?

seidewitz commented 1 year ago

The purpose of the SysML v2 Pilot Implementation right now is to support the completion of the SysML v2 specification for submission to OMG. The implementation was made public some time ago to provide a preview to the systems engineering community and to act as way to generate feedback from a wider audience than just within the submission team.

Our final submission is scheduled to be delivered 20 February, so I have limited bandwidth for other discussions. If you have questions whose answers might be of interest to the general community, though, please start a conversation on the Google Group.

dallman2 commented 1 year ago

That makes sense, I will open a thread there. Good luck on the submission!