Hi JRemote.JClient -- is my client program JRemote.JServer -- is my RMI server program JRemote.JRemoteInterface -is my remote interface I am running a program JRemote.JClient in NT and connecting to a JRemote.JServer running in UNIX and could complete the client call.My Application folder is VisualAPP.But the same server program when I am trying to access from another program under Designer folder (a sibling folder under VisualApp like JRemote) using JClient object server is not getting called.(failing at Naming.lookup) Even I tried using Naming.lookup in the Designer folder program( butI get a remote Exception) Error occurred in server thread; nested exception is: java.lang.NoClassDefFoundError Can any one suggest me a solution I feel this this has some thing to do with the classpath .But the classpath is set properly in both unix and NT and JRemote.JClient is working fine. Any one has solutions please let me know so that I can integrate in my Main application thanks
Are you starting the registry from inside your server program? If you are, try adding -Djava.rmi.codebase="file:///home/tb4user/tb4/resources/tb4db.jar"(wherever your interface lives) to your java call. Here is the call I make in a batch file:
I do exactly what you are trying to do with the server on *NIX (linux) and the clients on win2k, so it is possible. let me know if it doesn't work and I will see if there is anything else I can suggest. Chris oh, don't forget that you need to use : (colon) between your classpath directories under linux and probably unix as well [ February 09, 2004: Message edited by: Chris Shepherd ]
Joined: Jun 27, 2000
Naga Venna wrote: First of all thanks for responding.I am very happy to recieve a response 1)I am starting the server and registry on two seperate unix windows(I connect to unix server thru reflection software).I don't know how I can start the registry with in the server program it self.If you know please let me know. Regarding the jarring of files I didn't make a jar.Do I need need to make a jar of JGRemote package?(where the server ,remote interface and my client program reside).I felt it is not mandatory.so for the moment I didn't do I will do it later 2)And about the rmi.codebase property, you mean to say that it should be set in unix classpath right?Please let me know about these two things thanks Nagamani
1. add this in your main somewhere near the beginning so it can get started before you try to do any assignments. That will start the registry and mroe importantly, it will stop the registry when you stop your program.
1a. regarding jarring, i like to stick it all together in a jar file because it makes it easy to distribute. I'v found that setting up a batch file to create your jars can make it really easy to re jar everything when you have made a change and are ready to distribute it. You shouldn't HAVE to jar everything, but then you have to deal with whatever kind of package structure you have as directories. Thats a pain. In short, jar when you can. 2. It should nopt be part of the classpath, it should come before the classpath as an extra settign for the java program to use when its looking for all the files it needs to run your code. Look at where I put it in the code I posted above. HTH Chris