[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ptp-dev] launching remote proxy script
|
I imagine the working directory is whatever it was when the JVM was
started. ProcessBuilder doesn't change this unless you explicitly ask
it to.
Ruby allows you to specify the absolute path of the library in the
require statement. Why don't you do that?
Greg
On Nov 1, 2007, at 1:07 AM, Feiyi Wang wrote:
I did some testing to locate the problem:
Say, I have a script in /Users/fwang2/tmp/test.rb, which load an
external module file, mylib.rb.
To launch this in Java world:
try {
ProcessBuilder pb = new ProcessBuilder("/Users/fwang2/tmp/test.rb");
Process p = pb.start();
...
}
This will reproduce the error I saw earlier. I tried two ways to
fix this, first in Ruby script itself, I tried to ask it to look at
current directory for any external file, which is actually the
default behavior, doesn't work; Append an explicit loading path,
doesn't work either, which is a bit strange.
The second way is to make slight modification on Java launch: After
ProcessBuilder instance "pb" is created, change the working
directory to where the main program gets started:
pb.directory(new File("/Users/fwang2/tmp"));
Now the LoadError is gone. I am guessing the current launch process
ignores where the executable is, and take user's home directory as
its working directory. Is it so?
Feiyi
Greg Watson wrote:
I guess the issue is how ruby finds the libraries that it needs.
If it's just looking in the current working directory, then this
could be the problem. There's no guarantee that the cwd is the
same as the location of the executable. Is there some way to
specify where to look?
Greg
On Oct 31, 2007, at 4:41 PM, Feiyi Wang wrote:
Using local service provider. The exact console message is as
following:
bind(0.0.0.0/0.0.0.0:0)
port=57964
Launch command: [/home/fwang2/workspace/ptp/
org.eclipse.ptp.moab.proxy/src/ptp_moab_proxy.rb, --proxy=tcp, --
host=dyn21918711.dz.ornl.gov, --port=57964, ]
accept thread starting...
MOAB@LocalProxyRuntimeClient: Waiting on accept.
MOAB@Local: /home/fwang2/workspace/ptp/org.eclipse.ptp.moab.proxy/
src/ptp_moab_proxy.rb:4:in `require': no such file to load --
proxylib (LoadError)
MOAB@Local: from /home/fwang2/workspace/ptp/
org.eclipse.ptp.moab.proxy/src/ptp_moab_proxy.rb:4
proxylib.rb is a local file residing in the same directory as
ptp_moab_proxy.rb. This seems to be the case for every file I try
to load at runtime.
Feiyi
Greg Watson wrote:
Do you mean RSE launching onto local host, or using the Local
service provider?
What is the error message?
Greg
On Oct 31, 2007, at 4:06 PM, Feiyi Wang wrote:
Hmm ... problem is, It gave me this error even with a local
launch, without ssh involvement.
Feiyi
Greg Watson wrote:
No, but I haven't tried it with the remote support. Remember
that when you run a command via ssh, it will not load
your .profile, .bash_profile, .login, etc.). Any environment
variables that need to be set up have to be done in your rc
file (.bashrc, .cshrc, etc.)
Greg
On Oct 31, 2007, at 3:28 PM, Feiyi Wang wrote:
hi, Greg -
I have a remote proxy (a ruby script) that implemented wire
protocol 2.0. If I run the script in manual mode, then all is
fine; if in auto mode, then there is error complaining about
failing to locate certain files, be it a library file or my
own module file. In python world, this would be like when you
do "import certain_module", and the interpreter complains
that there is error with the file you are trying to import.
I suspect this has to do with some environment setup, without
looking into the specifics, when you worked on proxy for
MPICH, have you experienced anything similar?
Thanks
Feiyi
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev