Archived

This forum has been archived. Please start a new discussion on GitHub.

IceGrid server can not start.

My Operating System is Linux. I had success to compile the slice file to java class files by ANT command:
[jiangyb@web169 my_simple]$ ant
Buildfile: build.xml

config-init:

init:

generate:
[slice2java] /home/jiangyb/Ice-3.2.1/bin/slice2java --output-dir /home/jiangyb/Ice-3.2.1/demoj/IceGrid/my_simple/generated /home/jiangyb/Ice-3.2.1/demoj/IceGrid/my_simple/Hello.ice

compile:
[javac] Compiling 11 source files to /home/jiangyb/Ice-3.2.1/demoj/IceGrid/my_simple/classes
[javac] Compiling 3 source files to /home/jiangyb/Ice-3.2.1/demoj/IceGrid/my_simple/classes

all:

BUILD SUCCESSFUL
Total time: 3 seconds


This is my configuration file:

<icegrid>
<application name="Simple">
<server-template id="SimpleServer">
<parameter name="index"/>
<server id="SimpleServer-${index}" exe="java" activation="on-demand">
<option>Server</option>
<env>classpath=$classpath:./classes</env> <adapter name="Hello" endpoints="tcp" register-process="true">
<object identity="hello-${index}" type=":: Demo::Hello" property="Identity"/>
</adapter>
</server>
</server-template>
<node name="localhost">
<server-instance template="SimpleServer" index="1"/>
<server-instance template="SimpleServer" index="2"/>
<server-instance template="SimpleServer" index="3"/>
</node>
</application>
</icegrid>

After deploy application_with_template.xml to grid node, I try to startup the server by following command:

>>>server start SimpleServer-1

but server can't start, and the error message is:

[ 05/08/08 11:07:54.545 Activator: activating server `SimpleServer-1' ]
[ 05/08/08 11:07:54.549 Server: changed server `SimpleServer-1' state to `WaitForActivation' ]
Exception in thread "main" java.lang.NoClassDefFoundError: Server
Caused by: java.lang.ClassNotFoundException: Server
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
[ 05/08/08 11:07:54.831 Activator: detected termination of server `SimpleServer-1'
exit code = 1 ]
[ 05/08/08 11:07:54.833 Server: changed server `SimpleServer-1' state to `Deactivating' ]
[ 05/08/08 11:07:54.833 Server: changed server `SimpleServer-1' state to `Inactive' ]


It seems that java program can't load the Server class file, but I had added classpath to env, and my classpath is:
[jiangyb@web169 my_simple]$ echo $classpath
/usr/local/okooo/jdk1.6.0_02/lib/dt.jar:/usr/local/okooo/jdk1.6.0_02/lib/tools.jar:.:/home/jiangyb/Ice-3.2.1/lib/Ice.jar:/home/jiangyb/Ice-3.2.1/lib/db.jar:/home/jiangyb/Ice-3.2.1/ant


will anybody tell me how to solove this problem?

Thanks.