Hi Sam, Did you remember to run rmic on your exportable classes? That's what it looks like.
Hope this helps, Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Sam Stackly
Ranch Hand
Joined: May 04, 2002
Posts: 109
posted
0
I have run rmic for both DataServer and DataFactory classes, It seems somethings missing but I don't know what it is excatly Sam
Ying Ren
Ranch Hand
Joined: May 24, 2002
Posts: 35
posted
0
Hi, I had the same problems before. I solved it by deleting the old stub copy file in the client side then put the new copy one in the client side. As i understand it will happen when the stub file is not the same as the one in server side.
YING REN
Pavel Z
Greenhorn
Joined: Aug 13, 2002
Posts: 1
posted
0
Hi Sam, Check how do you set java.rmi.server.codebase property - java -Djava.rmi.server.codebase=file:///d:/projects/assignment/server.jar -jar server.jar
Pavel
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi Sam, Make sure you have an import statement that imports the package where the stubs are located. Michael Morris
Sam Stackly
Ranch Hand
Joined: May 04, 2002
Posts: 109
posted
0
Thanks Guys for your comments, well now I've got a new Problem , I tried to run rmic to generate new stubs for my exportable classes but I've got this error C:\JServer\server>rmic -v1.2 DataFactory error: File .\DataFactory.class does not contain type DataFactory as expected, but type server.DataFactory. Please remove the file, or make sure it appears in the correct subdirectory of the class path. error: Class DataFactory not found. 2 errors any comment on this, ?? I am totally confused!!! Thanks again for your comment Sam
Nate Johnson
Ranch Hand
Joined: May 13, 2002
Posts: 301
posted
0
To run rmic correctly you should run the command from the root of your packages... So from a classes directory you should see the directory suncertify and then type... rmic -v1.2 suncertify.server.DataFactory Let me know if that helps...
Hi Sam, Nate's right. But don't feel bad, I'm sure we all grappled with this the first time or two. Michael Morris
Nate Johnson
Ranch Hand
Joined: May 13, 2002
Posts: 301
posted
0
I sure did... I probably found the answer here at the ranch too
Sam Stackly
Ranch Hand
Joined: May 04, 2002
Posts: 109
posted
0
thanks guys, let me clear my thought about your comment, if I have my exportable class in c:\suncertify\server\DataFactory.class then I have to run rmic -v1.2 suncertify.server.DataFactory ? am I right? Sam
Nate Johnson
Ranch Hand
Joined: May 13, 2002
Posts: 301
posted
0
yep, from the root c drive
Sam Stackly
Ranch Hand
Joined: May 04, 2002
Posts: 109
posted
0
Guys, I made that stub for my DataServer and DataFactory classes, but I still get that error " RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: Server.DataFactory_Stub " I copied them to server package(didn't work) suncertiy pacakge(also didn't work) , I have no idea why I get this exception ,I am totally lost in RMI island ! Please help! Sam
Package names are case-sensitive. Could that be the problem? Hope this helps, Michael Morris
Sam Stackly
Ranch Hand
Joined: May 04, 2002
Posts: 109
posted
0
No Michael , I tried that, Thanks anyway,I really appreciate it Sam
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi Sam, Man, don't you just hate this kind of stuff! I do think that it has to do with package declarations and/or importing of packages. The package directory structure has to be as indicated relative to the user (execution) directory. So if you have a package suncertify.server and a package suncertify.client then you have to have directories ./suncertify/server/ and ./suncertify/client/ which contain the appropriate class files. If a class in the suncertify.client package needs to know about a class in the suncertify.server package, then it has to import that package. I'm sure that you're aware of all this, but I know that I have oft times overlooked the obvious for a more obscure solution to a problem. One other problem that I frequently ran across after I jarred both client and server was that I would forget to put the new server files after a build into the client jar which would cause a similar exception. Keep thinking about it and I will too and at some point we'll figure it out. Hope this helps, Michael Morris
Sam Stackly
Ranch Hand
Joined: May 04, 2002
Posts: 109
posted
0
Michael , Let me explain my directory and package structue, may be I am doing something wrong that I am not aware of,(just server) Directory structure, C:\suncertify C:\suncertify\db C:\suncertify\server Package structure : suncertify // have a class implemented main method suncertify.server // all classes related to server (includes DataSever and DataFactory, two exportable classes) suncertify.db // classes and Interfaces (remote interfaces , one for DataFactory and one for DataServer) and here is the code I got that exception
I created stub for DataFactory and DataServer and they are in suncertify.server package That's all, Thanks again for your help and comment Sam
Sai Prasad
Ranch Hand
Joined: Feb 25, 2002
Posts: 560
posted
0
Sam, The problem is not with the RMI server. It is with the RMI Registry. Assuming that you are staring RMI Registry from a different console window and not from the code, try to issue the command below and start the RMI Registry using rmiregistry command. Assuming that your root directory starts from C:\working, set CLASSPATH=C:\working <Enter> rmiregistry<Enter> [ August 13, 2002: Message edited by: Sai Prasad ]
Sam Stackly
Ranch Hand
Joined: May 04, 2002
Posts: 109
posted
0
Thanks Sai, You solved my problem Sam
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi Sam, I'm glad someone figured this out. I wasn't thinking about the registry because I started the registy inside my server so the registry's CLASSPATH was never an issue. So now you can move on to more productive matters! Michael Morris
Sam Stackly
Ranch Hand
Joined: May 04, 2002
Posts: 109
posted
0
Michael, Thanks again for your comments, It's great to have people like you around here, Good Luck Sam