[Remoterengine-devel] Running RemoteREngine from Eclipse

Romain Francois romain.francois at dbmail.com
Mon Sep 14 11:22:05 CEST 2009


Hi,

Thanks for this update.

On 09/11/2009 03:25 PM, Ian Long wrote:
> I have managed to get the REngine Server and the Test Client running
> within debuggers in Eclipse today.. As part of this I have checked in
> some changes to the build.xml to update some of the dependencies and
> updated the .bat scripts within the bin directory to start the server&
> client from Windows. Currently the scripts have a hardcoded path for the
> java.rmi.server.codebase property as I haven't managed to find a way to
> get Dos to generate a URL with /s instead of \s.

That's the kind of thing that is much easier to handle in an R script, 
which is the recommended way to start the server.

> I still have a couple of items that I don't fully understand:
> 1.) I can't run the Ant build script from within eclipse without
> compilation errors - even though my Eclipse is set to use my external
> Ant installation and I can compile without any issues outside of Eclipse.

No idea about this. I don't use eclipse for building. My guess is that 
eclipse gets confused by the rather complex build script we use, 
specially that we don't put everything in one jar but select subset of 
source path to go on the server jar and subset of source paths to go on 
the client jar.

The reason for this is that I want the client jar to be as thin as 
possible. In particular it should not know about low level Rengine API, ...

> 2.) Eclipse doesn't seem to like the package directory structure we are
> using and continually complains that .java files aren't in the
> appropriate directory even though they are. Doing Project ->  Clean
> resolves the issue temporarily.
>
> I have also started playing around with policy files, so hopefully will
> be checking in a tighter policy file in the not too distant future.

That's good news. On the client side, it would be a plus if by default 
we would not have to give a policy file. Not sure we can change the 
policy at runtime.

> I will shortly be making some further changes to allow us to control
> which port the RMI Server listens on with a view to starting to run the
> server on my Win 2008 Server rather than my dev laptop.
>
> Properties that need to be set to start the server directly from Java are:
> -cp Path to the local jar files or .class files - any path entries that
> point to .class files need to contain a trailing \ (or / on Unix)
> -Djara.rmi.server.codebase - Needs to be a URL containing the classpath
> to the jar files or Java class files. This can be either http://..... if
> the classes are available via a web server or a file URL such as
> file:/d:/remoterenegine/build/ if on the local Windows or Unix file system

At the moment, the client knows common classes and stubs of remote 
objects (there is a specific use of the rmic compiler as part of the 
build). So in theory it does not need classes to be available through a 
web server.

But this might be old school rmi programming ...

> -Djava.sercurity.policy - Path to the security file
> -Drjava.path -  Path to the java directory within rJava, e.g.
> %R_HOME%\library\rJava\java
> -Drjava.class.path - Path to the classes within rJava, e.g
> R_HOME%\library\rJava\java\boot;R_HOME%\library\rJava\java
> -Djava.library.path - Path to the directory containing jri.dll

Again, when the server is started through the R script, you don't need 
to specify these as R will find them.

The R script is just a minimal R script that only sets environment 
variables and options like these. What we can do perhaps is have the 
possibility to start this script so that it does not launch java but 
only shows the command to do so. So then we can have this in a batch (or 
bash) script so that next time we don't have to pay for Rscript's load time.

>
> Cheers,
> Ian.


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/yw8E : New R package : sos
|- http://tr.im/y8y0 : search the graph gallery from R
`- http://tr.im/y8wY : new R package : ant



More information about the Remoterengine-devel mailing list