Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8905967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:31:47+00:00 2026-06-15T02:31:47+00:00

I have written a small Java client which does some calculations on an Rserver

  • 0

I have written a small Java client which does some calculations on an Rserver. For this purpose, there are functions.r– and libraries.r files on the server side, which have to be sourced, before the actual calculation can be done.

Currently I load the files on every new connection:

import org.rosuda.REngine.Rserve.RConnection;

public class RserveTester {

  public void doOnRserve() {
    RConnection c = new RConnection( "rserve.domain.local" );
    c.login( "foo", "user" );
    c.eval("source(\"/home/rserve/lib/libraries.r\")");
    c.eval("source(\"/home/rserve/lib/functions.r\")");
    c.eval( "someCalculation()" )
    c.close();
  }  
}

where doOnRserve() is called due to some events on the client side couple of times in a minute.

My Question is: Is it possibility to source the libraries only once, such that they are available during all new RSessions without individual sourcing?

I tried on the client side something like:

c.serverSource("/home/rserve/lib/libraries.r" )
c.serverSource("/home/rserve/lib/functions.r" )

Which gives me te following exception (no idea why this does not work wile eval does):

 org.rosuda.REngine.Rserve.RserveException: serverSource failed, request status: access denied (local to the server)

Can I start the Rserve with a specific .Rprofile?

EDIT:

Basically, there seam to be three possible methods:

  1. Let the /home/rserve/.Rprofile source the .r files. But this seams to source them each time I call new RConnection()
  2. Passing the source commands directly to R when starting Rserve (no idea how to do this).
  3. My preferred method: doing it from the client side using serverSource(), which throws these “access denied” exceptions.

EDIT2:

Rserve version v0.6-8 (338)

R version 2.15.2 for x86_64-pc-linux-gnu.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:31:48+00:00Added an answer on June 15, 2026 at 2:31 am

    This is trivially done by adding source lines to your configuration file, i.e., putting

    source "/foo/bar.R"
    

    in /etc/Rserv.conf will source /foo/bar.R on startup. If you want to use another config file, use --RS-conf command line argument to specify it. Finally, Rserve 1.x supports --RS-source option on the command line as well.

    Without the quotations in the filepath, it may give File Not Found Error.

    BTW: you mentioned serverSource() access denied – that means you did not enable control commands in Rserve (control enable in the configuration or --RS-enable-control on the command line).

    PS: Please use stats-rosuda-devel mailing list for Rserve questions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small linux vps. I have written a Java client application, which
I have written a small webservice[Axis2/Java] which exposes a method public String Fill(String cacheName
I have written a small java application for which I need to obtain performance
I currently have a small text game I've written in Java that utilizes System.out.print();
I have written a small function, which uses ElementTree to parse xml file,but it
I have a web service with a client written in Java. The service works
I have written a Java applet class and made a small HTML page to
have written a stochastic simulation in Java, which loads data from a few CSV
I have a neural network written in Java which uses a sigmoid transfer function
I have written a small CMS for an application which provides basic site management

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.