R actor produces 'null' message when R not found on PATH
Edward Lee reports thatthe R actor produces a 'null' error message when one of the demo workflows that requires R is run on a system lacking R.
The R actor (and other external execution actors like Matlab) should check to see if the R executable is available and the R system functioning before it tries to execute. Maybe this can be done on init() so that it happens before a workflow is run.
When R is not found, a sensible error message should be displayed, one that preferably points the user to an easy solution of the problem.
An alternative (and probably better) approach is to have the R actor formally specify a dependency on the R system executable for the local platform, so that when the R actor is installed, the module installer checks that its dependencies are all satisfied. This would be possible under the new modularization system that includes the ability to formally specify dependency graphs in module metadata.
#1 Updated by ben leinfelder about 11 years ago
I've tried a few things to have Kepler not find my R installation. Removing the R executable from my PATH gives me this error message (as expected and desired):
There has been a problem launching the R application!
It may be that R is not installed on your system, or it
may not be on your path and cannot be located by Kepler.
Please make sure R is installed and the R command line
executable is in the path.
For more information, see
section 8.2.2 of the Kepler User Manual.
I've not yet been able to recreate 'null' error message.
I'm using the demos/getting-started/00-StatisticalSummary.xml workflow to test this.
#2 Updated by Christopher Brooks about 11 years ago
I was there when Edward ran the demo and we may have seen a message
about R not being installed. Even if we did, there are two points:
1) A user dialog with just the word "null" in it is not very user friendly
and is a bug. The message should be more explicit, even if there is a
proceeding message dialog that is well worded.
If, under Mac OS X, I don't have R in my path, I see a reasonable message
dialog and then when I hit ok, I get a error dialog that says "null"
The stack trace is:
I fixed this bug.
However, RExpression has a bigger problem in that it pops up dialogs
directly instead of using the ptolemy.gui.MessageHandler facility.
The problem is that if RExpression probably can't be used in a non-graphical
environment (it certainly can't be compiled without swing).
There should be a bug report for this issue. In general, actor code
that calls JOptionPane.showMessageDialog() is suspect.
2) The real bug is that the first demo should not require additional software
that the user might not have installed yet. We are offering access to
Kepler via svn, so we should expect that new Kepler users will download
Kepler via svn and try it out without first installing R. The solution
is to have some Non-R demos at the first and to have the R demos very
clearly marked. As a first demo, I propose the predator/prey demo, it is
So, there should be a bug report for this as well.
Sorry about the confusion on this.
I'll close this after I create new bugs to address the above issue
#4 Updated by Christopher Brooks about 11 years ago
I'm closing this one:
- I searched the tree for JOptionPane.showMessageDialog and replaced it
with either throw new IllegalActionException(this, or else
- Previously, I had changed the order of the demos on the about page and
had fixed the R actor so the null message no longer appeared