This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Is the stub actually in your server.jar file, you can check it out in winzip and see if you find that class, and also check the path to make sure it says suncertify/server It just appears that it can't find the class in the jar file. Also remember that these stub classes will also need to be in the client.jar file too. Mark
and also check the path to make sure it says suncertify/server
Yes it is that in the server.jar
It just appears that it can't find the class in the jar file.
Ok, i understand
Also remember that these stub classes will also need to be in the client.jar file too
I have both stub and skel in server.jar and stub in client.jar. Is that ok? If I add '-Djava.rmi.server.codebase=file:///F:\Privat\mina_projekt\cert\proj ect\project\FlyByNight\dist/server.jar' when i start upp the application like this: java -djava.rmi.server.... -jar server.jar it works! Is my classpath wrong or something? I want to start without the codebase stuff. Thnaks Mark Any idea?
Yes, you should not need a codebase. Basically a codebase states where to find classes. If the classes are already in your jar file then it does not need to know the location. It still appears like a class is missing in your jar file or a class has the wrong directoy path. When you create the jar file you should create from the root directory. for instance you have the following two source directories, with the .class files c:\devexam\suncertify\db c:\devexam\suncertify\server then in the c:\devexam directory you would run jar -cvfm server.jar c:\devexam\manifest\server\manifest.mf suncertify\db\*.class suncertify\server\*.class Hope that helps Mark
Joined: Feb 24, 2003
Mark, This is what i do: F:\Privat\mina_projekt\cert\project\project\FlyByNight\classes>jar -cvfm ..\dist \server.jar Manifest.mf suncertify\db\*.class suncertify\server\*.class suncerti fy\util\*.class Then: F:\Privat\mina_projekt\cert\project\project\FlyByNight\dist>java -jar server.jar Server starting Server starting at 10.10.4.50 Server ended with the following error: java.rmi.ServerException: RemoteException occurred in server thread; nested exce ption is: java.rmi.UnmarshalException: error unmarshalling arguments; nested excep tion is: java.lang.ClassNotFoundException: suncertify.server.DataInterfaceFactory Impl_Stub java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: suncertify.server.DataInterfaceFactory Impl_Stub java.lang.ClassNotFoundException: suncertify.server.DataInterfaceFactoryImpl_Stu b at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream RemoteCall.java:245) at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java: 220) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:354) at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source) at java.rmi.Naming.rebind(Naming.java:160) at suncertify.server.DataInterfaceFactoryImpl.startServer(Unknown Source ) at suncertify.server.DataInterfaceFactoryImpl.<init>(Unknown Source) at suncertify.server.FBNServer.main(Unknown Source) Yes, the server.jar contains the DataInterfaceFactoryImpl_Stub. The command works fine: F:\Privat\mina_projekt\cert\project\project\FlyByNight\dist>java -Djava.rmi.serv er.codebase=file:F:/Privat/mina_projekt/cert/project/project/FlyByNight/dist/ser ver.jar -jar server.jar Server starting Server starting at 10.10.4.50 Server ready at 10.10.4.50/FBNServer I just dont get it..... Any idea?
"Naming.rebind("//" + daServer + "/" + SERVER_NAME, this);" Well we can tell that this is the line that is failing. this is showing up as an Unknown Source. That is about all I could figure out here. What class has your main(String args) method? Nevermind try this.
No need to have the server address. I think, I didn't have it in mine. Hope this works, otherwise I am out of ideas. Mark
Joined: Feb 24, 2003
Nope, that didnt do it. :-( I have class called FBNServer (that has thr main method) that does new on DataInterfaceFactoryImpl. Like this:
and I just dont get it. Thanks for all your help. [ April 01, 2003: Message edited by: Raffe Paffe ]