I recive this error when i am trying to start my server: Server starting at 10.10.4.50 Error creating server RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: suncertify.server.DataFactoryImpl_Stub This my code:
I have not any securitymanager and policyfile. I start my application with java -jar server.jar
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
Raffe Paffe
Ranch Hand
Joined: Feb 24, 2003
Posts: 92
posted
0
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
Raffe Paffe
Ranch Hand
Joined: Feb 24, 2003
Posts: 92
posted
0
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 ]
John Smith
Ranch Hand
Joined: Oct 08, 2001
Posts: 2937
posted
0
have class called FBNServer (that has thr main method) that does new on DataInterfaceFactoryImpl. ... Naming.rebind(SERVER_NAME, this);
What should be bound to registry is the remote object. In your case, it would be DataInterfaceFactoryImpl. Instead, you are trying to bind FBNServer.
Raffe here is my manifest for the client and for the server. Maybe that will help. Server
Client
Both of the classes listed as the Main-Class is the class that has the public static void main(String[] args) method in them. Mark
Raffe Paffe
Ranch Hand
Joined: Feb 24, 2003
Posts: 92
posted
0
Both of the classes listed as the Main-Class is the class that has the public static void main(String[] args) method in them.
Are those calsses the the remote ones?
kevin chang
Ranch Hand
Joined: Mar 08, 2003
Posts: 64
posted
0
I think there r two ways to solve the problem first. try set classpath="your work class" or jar; then run rmiregistry in command line, and startserver with
second. u can make rmiregistry in the programme ,by useing
wish it could be help
Sun Certified Java Programmer, Sun Certified Java Developer. <br />Strving to be a real architect.
John Smith
Ranch Hand
Joined: Oct 08, 2001
Posts: 2937
posted
0
Yest its a joke. I put da infront of all temporary names.
Are you serious? Do you think the folks at Sun Microsystem would understand your sense of humor? Eugene.
Raffe Paffe
Ranch Hand
Joined: Feb 24, 2003
Posts: 92
posted
0
Yup, this dis it. Set the classpath to server.jar before starting the rmiregistry. Thanks.
Are you serious? Do you think the folks at Sun Microsystem would understand your sense of humor? Eugene.
Well, i will remove it before posting it to Sun... :-) Thank you all for your help!!!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.