Home » Eclipse Projects » Papyrus for Real Time » Papyrus-rt gets stock
Papyrus-rt gets stock [message #1756443] |
Fri, 17 March 2017 00:00 |
reza ahmadi Messages: 47 Registered: September 2016 |
Member |
|
|
Hi,
I am using papyrus-rt RTC (0.8.0) on a macbook.
I have a bug in my eclipse plugins. I have seen that it disappears sometimes!, which is so weird. Here is the issue:
In the following code, debugger stops at the marked line. Once i execute the marked line it gets stock: no exception, no execution:
More information about debugging:
so it gets stock in that point, no exception, no execution. Any clue?
I run same plugins on a linux machine. Papyrus-rt on that PC was installed using installer and its version is 0.8.0, as well. Same plugins work fine there on that linux machine.
Sorry if it's not a papyrus-rt related issue; I am not in fact an experienced eclipse user (I have been a VS user though for some years).
Thanks for any clue
Reza
-
Attachment: 1.png
(Size: 67.17KB, Downloaded 648 times) -
Attachment: 2.png
(Size: 868.63KB, Downloaded 701 times)
|
|
| |
Re: Papyrus-rt gets stock [message #1756486 is a reply to message #1756474] |
Fri, 17 March 2017 17:13 |
Ernesto Posse Messages: 438 Registered: March 2011 |
Senior Member |
|
|
Looking a bit closer, given that you get a message that says that the "Source is not found", I'm guessing that you are attempting to step into a method of a class whose source is not in in the class path, possibly the TriggerImpl.getEvent method of org.eclipse.uml2.uml.
Naturally, if Eclipse cannot find the source code of a class, it cannot show you the code you are attempting to step into.
Is this what you are trying to do?
If this is what you are trying to do, it is not a Papyrus-RT problem, but simply about how to debug in Eclipse in general.
In this case, you need to add the jar or folder that contains that class into the classpath of your Debug configuration. This is done as follows
1. Click the [Debug button] and select "Debug Configurations...".
2. Select the configuration that you are trying to run/debug. I'm guessing you are probably attempting to debug a Java Application so it would be one under "Java Application".
3. Select the "Classpath" tab.
4. Select "User Entries".
5. Click the [Add External JARs...] button.
6. Navigate to the "plugins" folder of your RCP. For example, if you extracted the RCP to a folder "PapyrusRT" under your user folder, the path should be something like "/Users/youruser/PapyrusRT/PapyrusRT.app/Contents/Eclipse/plugins".
7. Select the plugin jar file for the class that you want to see the source. For the TriggerImpl class, it should be something like org.eclipse.uml2.uml_5.2.X.v2016MMDD-BBBB.jar (probably org.eclipse.uml2.uml_5.2.2.v20161114-0827.jar). Click [Open].
8. Click [Apply].
Now you should be able to debug and step-through code in that class.
PS: If you do not know if a problem is an Eclipse problem or a Papyrus-RT problem, try to reproduce a minimal example in a plain Eclipse installation that doesn't have Papyrus-RT.
|
|
|
Re: Papyrus-rt gets stock [message #1756493 is a reply to message #1756486] |
Fri, 17 March 2017 19:45 |
reza ahmadi Messages: 47 Registered: September 2016 |
Member |
|
|
Hi Ernesto,
I am using PapyrusRT RCP, so no developer version, no tester version, just the single executable file.
The second screen shot is to just show which file (in this case TriggerImpl) is the source of the error. For sure my intend is not to debug TriggerImpl (as it's not my code of course).
My plugins are analyzing a UML-RT model in papyrus-rt. In fact by running my plugins in Papyrus-RT, it gets stock in the line that I showed above. Even if the source of the error is in my plugin, then, I think TriggerImpl should complain, raise an exception or error. But in this case, the whole eclipse just hangs! unresponsive! I tried to debug to see why Eclipse hangs, which I ended up that line above. TriggerImpl is in package org.eclipse.uml2.uml, so not related to Papyrus-RT? But I still wonder why I do not receive any error message, if something is wrong in my plugins.
|
|
| | |
Re: Papyrus-rt gets stock [message #1757809 is a reply to message #1756503] |
Mon, 20 March 2017 08:35 |
Peter Cigehn Messages: 49 Registered: September 2014 |
Member |
|
|
reza ahmadi wrote on Sat, 18 March 2017 03:27
- p is a timer port. I have used a timeout message to transit to a state. I think this case is a timer issue, as if I replace the timer message with a message from another protocol (which is not of type timer), then Eclipse does not get freezed.
To me this sounds like an issue when trying to resolve and load the run-time model library, i.e. when p is typed by the Timing protocol in the run-time model library, and the event of the trigger is the timeout protocol message, then it sometimes "hangs". As you have concluded yourself, the "hanging" cannot be seen when using other protocols and protocol messages (I assume that you then mean a user-defined protocol in your own model).
I think that, as Ernesto already have proposed, that you try to make a minimal example of your plugin, including a small example model, and attach it to a post in the forum, so that someone else also can try it and see if they can reproduce the issue you are seeing.
I guess it could be related how you initially load the model on which you are running the plugin on, i.e. the "boiler plate code" for loading the model. I guess depending on how that is done, the resolving of cross model references to other model, e.g. as in this specific case the run-time model library, behaves differently and apparently can "hang" sometimes.
/Peter Cigéhn
|
|
|
Re: Papyrus-rt gets stock [message #1757840 is a reply to message #1756503] |
Mon, 20 March 2017 14:49 |
Ernesto Posse Messages: 438 Registered: March 2011 |
Senior Member |
|
|
reza ahmadi wrote on Fri, 17 March 2017 23:27- Yes, I read a uml-rt model capsules' contents (ports,..) and explore it.
- My plugins work on UML-RT models, I wonder how can I run the plugins on a plain Eclipse? I start the plugins with selecting a capsule..
- I have tried downloading the RCP a couple of times => same issue
- The freezing happens sometimes, the freezing is just random
- p is a timer port. I have used a timeout message to transit to a state. I think this case is a timer issue, as if I replace the timer message with a message from another protocol (which is not of type timer), then Eclipse does not get freezed.
- I cannot add the .jar file like you have mentioned as I am running my plugins, which are executed into a second instance of Papyrus-RT
- which log are you referring to? If you mean error log, then no errors there.
I'll answer from the bottom up:
a. Yes, as I said in my message, the error log (Window->Show View->Error Log).
b. When you say you cannot add a .jar file according to my instructions because you are running your plugins in a second instance, what do you mean? I assume you are running a second instance by clicking the [Debug] or [Run] buttons, no? If so, that means you have a "launch configuration" for that second instance in your first instance. These launch configurations is what you can access through the "Debug configurations..." and "Run configurations..." option that I described in my message. You should be able to edit lunch configurations regardless of whether you are running your plugins or any other. So the first thing you need to do is to figure out which lunch configuration you are using to launch that second instance. If you just clicked the run or debug buttons without ever specifying a launch configuration, then Eclipse would have created one for you, which by default is called "New_configuration" and the associated workspace would be something like "runtime_New_configuration". Once you have determined which is the launch configuration you are using, then you should be able to follow the steps I described.
c. If p is a Timing port, then, as Peter says, it is possible that it is related to using elements from the runtime model library. It may be that your code is not loading the library. But what seems strange is that according to your description, Eclipse does not *always* freeze.
d. How are you accessing/loading the models from your code?
e. (I asked this before) What Papyrus-RT bundles are you importing in your code?
f. If you can answer d and e, then maybe you can do a minimal test in plain Eclipse, if you are not importing any Papyrus-RT bundles. Your plugins may be working on UML-RT models, but if they don't actually use any Papyrus-RT code, for example if you are only importing org.eclipse.uml2.uml, then you can run them without Papyrus-RT. You can have a plain Eclipse installation (probably with the JDT, as I assume you are writing Java code), and installing Eclipse UML2, without installing Papyrus-RT, or Papyrus.
BTW, when we talk about a "minimal" example, we could mean different things: 1) an example in a minimal environment needed (such as plain Eclipse+UML2); 2) a minimal model; or 3) a minimal piece of code relevant to the problem in question. The idea of having minimal examples is to eliminate possible causes for the problem.
g. Does it freeze when you are running normally, rather than debugging?
|
|
|
Goto Forum:
Current Time: Mon Dec 02 16:24:17 GMT 2024
Powered by FUDForum. Page generated in 0.08114 seconds
|