I am sorry for the delay, but it was holiday in Italy.
I have tried to go into the deep and inspect the Java stack trace using Thread.currentThread().getStackTrace()
from MyDaemonDaemonService.getExecutable()
, which appears to be the one involved in the ERROR state setting.
Here is what I get when clicking on the start button:
com.ur.urcap.cpp.impl.MyDaemonDaemonService.getExecutable(MyDaemonDaemonService.java:31)
com.ur.urcap.view.impl.DaemonImpl.getExecutable(DaemonImpl.java:41)
com.ur.urcap.servicedaemon.impl.RUNITService.getExecutableHashCode(RUNITService.java:217)
com.ur.urcap.servicedaemon.impl.RUNITService.getDaemonIdentifier(RUNITService.java:213)
com.ur.urcap.servicedaemon.impl.RUNITService.getSymLinkPath(RUNITService.java:209)
com.ur.urcap.servicedaemon.impl.RUNITService.isRunning(RUNITService.java:173)
com.ur.urcap.view.impl.DaemonImpl.getState(DaemonImpl.java:81)
com.ur.urcap.cpp.impl.MyDaemonDaemonService.getDaemon(MyDaemonDaemonService.java:59)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.awaitDaemonRunning(MyDaemonInstallationNodeContribution.java:189)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.applyDesiredDaemonStatus(MyDaemonInstallationNodeContribution.java:176)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.onStartClick(MyDaemonInstallationNodeContribution.java:68)
The first DaemonImpl.getState()
returns correctly in the STOPPED state.
Then, MyDaemonDaemonService.getExecutable()
is called three times consecutively by DaemonImpl.start()
, where it seems to retrieve and check the executable path and hash code:
com.ur.urcap.cpp.impl.MyDaemonDaemonService.getExecutable(MyDaemonDaemonService.java:31)
com.ur.urcap.view.impl.DaemonImpl.getExecutable(DaemonImpl.java:41)
com.ur.urcap.servicedaemon.impl.RUNITService.getExecutableHashCode(RUNITService.java:217)
com.ur.urcap.servicedaemon.impl.RUNITService.getDaemonIdentifier(RUNITService.java:213)
com.ur.urcap.servicedaemon.impl.RUNITService.getSymLinkPath(RUNITService.java:209)
com.ur.urcap.servicedaemon.impl.RUNITService.start(RUNITService.java:142)
com.ur.urcap.view.impl.DaemonImpl.start(DaemonImpl.java:70)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.awaitDaemonRunning(MyDaemonInstallationNodeContribution.java:189)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.applyDesiredDaemonStatus(MyDaemonInstallationNodeContribution.java:176)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.onStartClick(MyDaemonInstallationNodeContribution.java:68)
com.ur.urcap.cpp.impl.MyDaemonDaemonService.getExecutable(MyDaemonDaemonService.java:31)
com.ur.urcap.servicedaemon.impl.RUNITService.getExecutablePath(RUNITService.java:203)
com.ur.urcap.servicedaemon.impl.RUNITService.start(RUNITService.java:148)
com.ur.urcap.view.impl.DaemonImpl.start(DaemonImpl.java:70)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.awaitDaemonRunning(MyDaemonInstallationNodeContribution.java:189)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.applyDesiredDaemonStatus(MyDaemonInstallationNodeContribution.java:176)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.onStartClick(MyDaemonInstallationNodeContribution.java:68)
com.ur.urcap.cpp.impl.MyDaemonDaemonService.getExecutable(MyDaemonDaemonService.java:31)
com.ur.urcap.view.impl.DaemonImpl.getExecutable(DaemonImpl.java:41)
com.ur.urcap.servicedaemon.impl.RUNITService.getExecutableHashCode(RUNITService.java:217)
com.ur.urcap.servicedaemon.impl.RUNITService.start(RUNITService.java:148)
com.ur.urcap.view.impl.DaemonImpl.start(DaemonImpl.java:70)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.awaitDaemonRunning(MyDaemonInstallationNodeContribution.java:189)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.applyDesiredDaemonStatus(MyDaemonInstallationNodeContribution.java:176)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.onStartClick(MyDaemonInstallationNodeContribution.java:68)
Lastly, the following DaemonImpl.getState()
returns in the infamous ERROR state (which persists until the stop button is clicked):
com.ur.urcap.cpp.impl.MyDaemonDaemonService.getExecutable(MyDaemonDaemonService.java:31)
com.ur.urcap.view.impl.DaemonImpl.getExecutable(DaemonImpl.java:41)
com.ur.urcap.servicedaemon.impl.RUNITService.getExecutableHashCode(RUNITService.java:217)
com.ur.urcap.servicedaemon.impl.RUNITService.getDaemonIdentifier(RUNITService.java:213)
com.ur.urcap.servicedaemon.impl.RUNITService.getSymLinkPath(RUNITService.java:209)
com.ur.urcap.servicedaemon.impl.RUNITService.isRunning(RUNITService.java:173)
com.ur.urcap.view.impl.DaemonImpl.getState(DaemonImpl.java:81)
com.ur.urcap.cpp.impl.MyDaemonDaemonService.getDaemon(MyDaemonDaemonService.java:59)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.awaitDaemonRunning(MyDaemonInstallationNodeContribution.java:191)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.applyDesiredDaemonStatus(MyDaemonInstallationNodeContribution.java:176)
com.ur.urcap.cpp.impl.MyDaemonInstallationNodeContribution.onStartClick(MyDaemonInstallationNodeContribution.java:68)
I know that this is a bit hard to read, but I cannot figure out how to get rid of this problem and I have almost tried everything I know.
For the sake of completeness, I am using sdk-1.0.0-23
and ursim-3.3.3
on Ubuntu 16.04 (but we have tried also with Ubuntu 14.04) and the urtool3
is properly installed (checked with dpkg -s urtool3
).
The HelloWorld example obviously works as expected, like the Screwing URCap does. The problem is with the MyDaemon and with a simplified version of it where I tried to remove all the unnecessary elements.
Have you got any hints?
Thank you very much for your time,
Alessandro Tondo @qbrobtoics
Further Investigation:
The communication through RPC works like a charm if the executable is opened in a separate termianl. Nonetheless the initialization of the daemon seems not to be able to start the executable: I even modified the file permissions manually to make it executable by every user in the PC (chmod a+x file.py
), but it is still not working it and continues to end in the ERROR state.