Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

classcastexception naming.lookup()  RSS feed

 
sherryanee bose
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm new here. I'm using naming.lookup() in client side (winxp) to talk to remote methods in sever (unix). I get classcastexception problem. I know I need to put sever side "myinterface_stub.class " into client side. How can I do this? I put it in a .bat file using "java -cp -CLASSPATH /Client/myinterface_stub.class"? OR I just copy it from unix and put it under Client directory? what else should be in Client directory? myinterface.java? test.java.

Thanks a lot!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sherryanee, and welcome to JavaRanch!

On the client side you need to have any client side code (duh!), plus your stub class and any interfaces/etc. the client is expected to use. What you don't need is the actual implementation of your server or any classes that are only used on the server side.

You can make these classes available to the client in a variety of ways... simply put them all in the client's directory... add the classes you need to the classpath... or package all the classes in a JAR file.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!