Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315848 - [rseserver] Java Call From auth.pl Dies With "Could not find the main class: org.eclipse.dstore.core.server.Server. Program will exit."
Summary: [rseserver] Java Call From auth.pl Dies With "Could not find the main class: ...
Status: REOPENED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: dsdp.tm.rse-inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-04 17:57 EDT by Ryan Ware CLA
Modified: 2010-06-04 19:00 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Ware CLA 2010-06-04 17:57:49 EDT
Build Identifier: I20100520-1744

I've been trying to get the rseserver daemon running on and off for the past couple of days with no success.  The root cause seems to be that the system call at auth.pl:96 does with the following error:


Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/dstore/core/server/Server
Caused by: java.lang.ClassNotFoundException: org.eclipse.dstore.core.server.Server
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: org.eclipse.dstore.core.server.Server.  Program will exit.

I've been trying to root cause this behavior with no success.  I've tried using the standard openjava that comes with Fedora 12 (both the 32-bit and 64-bit openjava packages on Fedora 12 x86_64) as well as Sun's 1.6 release; all with the same behavior.

I've primarily done this with 3.2RC3.  However, I've gone back and tried this with the 3.0 release and get the same behavior.

I _am_ able to use the server.pl script which executes fine.

Reproducible: Always

Steps to Reproduce:
1. Modify auth.pl:96 adding '>& file' to get the output of the java command.
2. perl ./daemon.pl 4075 10000-10010
3. Connect via RSE from a remote system.
4. check 'file'.
Comment 1 Martin Oberhuber CLA 2010-06-04 18:09:51 EDT
auth.pl is not meant to be called directly - it is internal, and needs to be called with proper parameters and environment (CLASSPATH) set.

Only daemon.pl and server.pl are the end-user callable scripts.
Comment 2 Martin Oberhuber CLA 2010-06-04 18:11:11 EDT
Oops, I did not read to the end :(

The problem seems to be valid.
Comment 3 Martin Oberhuber CLA 2010-06-04 18:12:07 EDT
Are you aware that daemon.pl must be run as root ?
Comment 4 Ryan Ware CLA 2010-06-04 18:35:02 EDT
Just root-caused this.  It's a permissions issue.  The full, expanded system call from auth.pl comes out to be: 

su -p rrware -c '/usr/bin/java -Duser.home=/home/rrware -cp /root/rseserver:/root/rseserver/dstore_extra_server.jar:/root/rseserver/dstore_core.jar:/root/rseserver/dstore_miners.jar:/root/rseserver/clientserver.jar -DA_PLUGIN_PATH=/root/rseserver/ -DDSTORE_SPIRIT_ON=true org.eclipse.dstore.core.server.Server 10000-10010 120000 1274895413522'


If you look at the passed in CLASSPATH, it points to the rseserver directory I had in /root.  /root isn't accesible by anyone.  When I moved the rseserver directory to /rseserver with global read and execute permissions, things work as expected.

You can close this as not a bug.  Thank you for the prompt response though!
Comment 5 Martin Oberhuber CLA 2010-06-04 18:42:44 EDT
Should we update docs in any way?

http://dsdp.eclipse.org/help/latest/topic/org.eclipse.rse.doc.user/tasks/tbeginlinux.html
Comment 6 Ryan Ware CLA 2010-06-04 19:00:42 EDT
I would update the doc to say something like:

rseserver scripts, jar's and other files must be readable by the local user ID's intended to access the dstore server.

In the troubleshooting section, you may want to put information with the specific error I included here showing what the root cause is.