Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Issue with CDT Generation (windows)(I deleted and imported the ping pong example, but get 2 errors for NullPointerExceptions. Please help me resolve these.)
Issue with CDT Generation (windows) [message #1790631] Wed, 13 June 2018 17:18 Go to next message
Sneha Sahu is currently offline Sneha SahuFriend
Messages: 20
Registered: June 2018
Junior Member
1
---------------------------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_171
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64

org.eclipse.core.commands
Error
Wed Jun 13 19:04:36 CEST 2018
Problems occurred when invoking code from plug-in: "org.eclipse.core.commands".

java.lang.NullPointerException
at org.eclipse.papyrus.views.modelexplorer.ModelExplorerView$3.commandStackChanged(ModelExplorerView.java:250)
at org.eclipse.papyrus.infra.emf.gmf.command.NotifyingWorkspaceCommandStack$2.historyNotification(NotifyingWorkspaceCommandStack.java:143)
at org.eclipse.core.commands.operations.DefaultOperationHistory$2.run(DefaultOperationHistory.java:868)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyListeners(DefaultOperationHistory.java:857)
at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyDone(DefaultOperationHistory.java:923)
at org.eclipse.core.commands.operations.DefaultOperationHistory.closeOperation(DefaultOperationHistory.java:1217)
at org.eclipse.ltk.internal.core.refactoring.UndoManager2.changePerformed(UndoManager2.java:164)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:264)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:305)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:96)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:216)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

---------------------------------------------------------------

2
---------------------------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_171
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64

org.eclipse.core.commands
Error
Wed Jun 13 19:04:36 CEST 2018
Problems occurred when invoking code from plug-in: "org.eclipse.core.commands".

java.lang.NullPointerException
at org.eclipse.papyrus.infra.ui.lifecycleevents.SaveAndDirtyService.fireIsDirtyChanged(SaveAndDirtyService.java:380)
at org.eclipse.papyrus.infra.ui.lifecycleevents.SaveAndDirtyService.access$0(SaveAndDirtyService.java:378)
at org.eclipse.papyrus.infra.ui.lifecycleevents.SaveAndDirtyService$1.commandStackChanged(SaveAndDirtyService.java:129)
at org.eclipse.papyrus.infra.emf.gmf.command.NotifyingWorkspaceCommandStack$2.historyNotification(NotifyingWorkspaceCommandStack.java:143)
at org.eclipse.core.commands.operations.DefaultOperationHistory$2.run(DefaultOperationHistory.java:868)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyListeners(DefaultOperationHistory.java:857)
at org.eclipse.core.commands.operations.DefaultOperationHistory.notifyDone(DefaultOperationHistory.java:923)
at org.eclipse.core.commands.operations.DefaultOperationHistory.closeOperation(DefaultOperationHistory.java:1217)
at org.eclipse.ltk.internal.core.refactoring.UndoManager2.changePerformed(UndoManager2.java:164)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:264)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:305)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:96)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:216)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

---------------------------------------------------------------

[Updated on: Sun, 22 July 2018 16:46]

Report message to a moderator

Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1790827 is a reply to message #1790631] Mon, 18 June 2018 15:46 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
I don't see any Papyrus-RT exception in those traces.

Can you provide more information: when do you get those exceptions? performing which action (preferably a list of steps)? Can you provide a model on which to reproduce it?
Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1790834 is a reply to message #1790827] Mon, 18 June 2018 18:56 Go to previous messageGo to next message
Sneha Sahu is currently offline Sneha SahuFriend
Messages: 20
Registered: June 2018
Junior Member
It was the pingPong tutorial.

What I had done -
1. Copied the Papyrus-RT installed directory from my old machine to new one (both Windows 10 C:\ drive)
2. Created the pingPong project but got some errors.
3. Then I removed and re-installed Papyrus-RT RCP with a fresh copy. Imported this project. This is when I got the above errors.
4. Then instead of importing I again created a fresh project with the new installation and now the errors are gone.

But now, the CDT project does not recognize the c++ header files and UMLRTCapsule class.
I am now using Papyrus-RT installed from RCP with win10 linux subsystem and Jdk 1.8.

The issue that I am now facing is similar to the one in discussion "problem finishing the PingPong tutorial [message #1773520]" at https://www.eclipse.org/forums/index.php/t/1089138/

steps performed for CDT project -
1. right click on the capsule Top and select "Generate with this capsule as top".
2 switch to ubuntu subsytem in windows 10,
navigate to the generated project and create "build" folder.
3. run 'cmake ../src' inside build
upto here everything is smooth.
4. run 'make' from inside build directory. And this is where I get errors, probably because of the errors in the CDT Project itself.

I am attaching the project directories and also listing few of the errors -
1. Unresolved inclusion: cstddef
> to resolve this I added the path through Properties->C/C++ General->Paths and Symbols->Includes: Add
However, with every new addition, the previous inclusion gets resolved but a new one pops-up. I went upto 5-6 additions and it still continues for a new unresolved inclusion.
Note: all the unresolved inclusions are under 1 common directory (../rootfs/usr/include), but I am having toddll each sub-directory separately.
2. symbol 'UMLRTCapsule' could not be resolved
3. symbol 'NULL' could not be resolved
and many more...


Path of Ubuntu Subsytem in Win 10:
C:\Users\sneha\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\

Installation Details also attached.

[Updated on: Mon, 18 June 2018 19:09]

Report message to a moderator

Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1790837 is a reply to message #1790834] Mon, 18 June 2018 19:16 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
The CDT problems are unrelated to the exceptions shown in the original message. Are those exceptions preventing you from doing something or have some observable unexpected behaviour, or they just show up in the console and Error log?

With respect to the CDT errors, did you follow the instructions from [1] and [2]?

[1] https://wiki.eclipse.org/Papyrus-RT/User_Guide/Cygwin_Setup
[2] https://wiki.eclipse.org/Papyrus-RT/User_Guide/Compiling_and_running_Papyrus_for_Real_Time_applications

It's particularly important that you find the location of the RTS and set the UMLRTS_ROOT environment variable to point to it as described in [2]. Also add it as an environment variable in the CDT's preferences for Environment variables.

Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1790839 is a reply to message #1790837] Mon, 18 June 2018 20:56 Go to previous messageGo to next message
Sneha Sahu is currently offline Sneha SahuFriend
Messages: 20
Registered: June 2018
Junior Member
The exceptions in the original message only showed up in the console and error log. On re-doing the project in a fresh install, they just dissappeared.

With regards to the CDT error, yes I have done everything as per [1] and [2].
I have correctly set up the UMLRTS_ROOT as described in [2].

About the last part. I added both - LinuxGCCInclude and UMLRTS_ROOT, to -
Windows -> Preferences -> C/C++ -> Build -> Environment,
and, .............................................................................. -> Build Variables

Then reGenerated the Project, but still the same error in CDT Project.
Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1790840 is a reply to message #1790839] Mon, 18 June 2018 21:11 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
In the generated cdt project can you unfold the "Includes" item and list all the items that appear there?

You should see paths pointing to the libraries of your C++ installation, as well as the $UMLRTS_ROOT/umlrt folder (note the last /umlrt).

Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1790841 is a reply to message #1790840] Mon, 18 June 2018 21:33 Go to previous messageGo to next message
Sneha Sahu is currently offline Sneha SahuFriend
Messages: 20
Registered: June 2018
Junior Member
CDT Project -> Includes , has only 1 sub-directory - $UMLRTS_ROOT/include

The includes from GCC are not being added automatically.
If I add manually one by one they get unresolved. But its just too many to manually add all sub-directories.

[Updated on: Mon, 18 June 2018 21:34]

Report message to a moderator

Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1790887 is a reply to message #1790841] Tue, 19 June 2018 16:10 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Ok, the problem is more of a CDT problem than a Papyrus-RT problem. After some quick googling I found this about configuring the CDT [1]:

Quote:
You do NOT need to do any configuration, as long as the Cygwin or MinGW binaries are included in the PATH environment variable. CDT searches the PATH to discover the C/C++ compilers.


It's a bit outdated, but probably still holds true.

So what happens is that if you installed Cygwin (or the GCC in Cygwin) *after* you started your Papyrus-RT session, then the CDT included in Papyrus-RT doesn't find the GCC (and its libraries and include files). Therefore you get all those unresolved symbols.

So what you would need to do is to make sure that you have installed Cygwin with GCC first (and you may have to manually add the Cygwin's bin folder to the System PATH), and then start Papyrus-RT. If you do that, when the CDT project is generated, it will include all the required paths automatically.

By the way, don't expect that a CDT project that you generated on a different machine will work, because obviously all those paths could be different. In that case you will have to regenerate code.

[1] https://www3.ntu.edu.sg/home/ehchua/programming/howto/EclipseCpp_HowTo.html

Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1792702 is a reply to message #1790887] Sun, 22 July 2018 16:40 Go to previous messageGo to next message
Sneha Sahu is currently offline Sneha SahuFriend
Messages: 20
Registered: June 2018
Junior Member
Thank you for the solution.
I am able to generate an error-free CDT for my project now.

Just an additional note.
I am using the Windows Subsystem for Linux (WSL) instead of Cygwin or MinGW (following their steps and instruction).
So instead of adding 'c:\cygwin\bin' (in my case WSL ..rootfs\usr\bin directory) to the windows Path variable I was adding 'rootfs\bin' and 'rootfs\usr\include'(wrong paths) at wrong places - 1) WSL PATH (2) Papyrus-RT preferences > C/C++ >Build>Environment.
That is why Papyrus-rt could not find the C++ header files.

It works perfectly now :) Thank you again for pointing it out.

If required I could also share the steps I followed for compiling & executing using Windows Subsystem for Linux (WSL). This an inbuilt feature of Windows10 and works without having to additionally use Vagrant, Cygwin or MinGW.

Thanks again,
Sneha
Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1792761 is a reply to message #1792702] Mon, 23 July 2018 15:31 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Glad to know it worked.

If you can share the steps for building with WSL it would be great! Thanks.
Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1792771 is a reply to message #1792761] Mon, 23 July 2018 16:51 Go to previous messageGo to next message
Sneha Sahu is currently offline Sneha SahuFriend
Messages: 20
Registered: June 2018
Junior Member
steps for compiling and building with WSL
Re: Problems occurred when invoking code from plug-in: "org.eclipse.core.commands". [message #1792773 is a reply to message #1792771] Mon, 23 July 2018 16:59 Go to previous message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Thank you.
Previous Topic:Sharing attributes
Next Topic:Requirement Specification
Goto Forum:
  


Current Time: Fri Apr 19 11:08:59 GMT 2024

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

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

Back to the top