Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Papyrus for Real Time » Papyrus-rt gets stock
Papyrus-rt gets stock [message #1756443] Fri, 17 March 2017 00:00 Go to next message
reza ahmadi is currently offline reza ahmadiFriend
Messages: 47
Registered: September 2016
Member
index.php/fa/28776/0/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:
index.php/fa/28776/0/


More information about debugging:
index.php/fa/28777/0/

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 #1756474 is a reply to message #1756443] Fri, 17 March 2017 14:36 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
Hi Reza. Can you give a bit more context here? It's not clear when is this happening. Apparently it's an issue when you are debugging, but what are you debugging exactly?

Are you doing some operation on a model in Papyrus-RT or are you executing something else?

I don't recognize the classes in the trace that you show in the screenshot, which suggests that the problem is related to whatever code that is. I assume you are trying to execute some plugins in your workspace.

You said you are using the "RTC". Do you mean the RCP? You are not using the tester or developer setup? In any case can you say which exact version (including build#; you can find it in Help->Installation details, and should be of the form 0.8.0_YYYYMMDDBBBB)

The line where it gets stuck is in which file, and which line number? It looks like it's TriggerImpl, but can you determine the package? Is it org.eclipse.uml2.uml or one within org.eclipse.papyrusrt.umlrt.uml?

Did you put a breakpoint? When debugging, what are the variable's values just before it gets stuck?

Do you get any errors in the console? In the Error log?

When it gets stuck, is the whole Eclipse unresponsive? You cannot step through?

PS: When posting screenshots, you might want to scale them down a little bit.
Re: Papyrus-rt gets stock [message #1756486 is a reply to message #1756474] Fri, 17 March 2017 17:13 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
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 Go to previous messageGo to next message
reza ahmadi is currently offline reza ahmadiFriend
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 #1756498 is a reply to message #1756493] Fri, 17 March 2017 20:21 Go to previous messageGo to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 438
Registered: March 2011
Senior Member
So you are debugging your code which does something to UML-RT models?

What Papyrus-RT bundles are you importing in your code?

Have you tried doing an equivalent debug in a plain Eclipse without Papyrus-RT?

Have you tried it in a separate, fresh Papyrus-RT RCP installation?

Did you try the steps from my last response?

Does the freeze always happens or does it work sometimes?

And as I asked before, what are the values of the variables before it freezes?

Are there any errors in the error log (unless you explicitly delete the log, any errors from a session, even if it freezes should be there).

Re: Papyrus-rt gets stock [message #1756503 is a reply to message #1756498] Sat, 18 March 2017 03:27 Go to previous messageGo to next message
reza ahmadi is currently offline reza ahmadiFriend
Messages: 47
Registered: September 2016
Member
- 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.
Re: Papyrus-rt gets stock [message #1757809 is a reply to message #1756503] Mon, 20 March 2017 08:35 Go to previous messageGo to next message
Peter Cigehn is currently offline Peter CigehnFriend
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 Go to previous message
Ernesto Posse is currently offline Ernesto PosseFriend
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?

Previous Topic:How to access port index of an incoming message
Next Topic:Attaching data with a timeout signal
Goto Forum:
  


Current Time: Mon Dec 02 16:24:17 GMT 2024

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

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

Back to the top