Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AccessException: unknown host

 
tony f
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In spite of following all of the steps in Gopalan's RMI tutorial
<http://www.execpc.com/~gopalan/java/java_rmi.html>
things still aren't working. I get a nested AccessException: unknown host. Does anyone have an idea what I'm doing wrong? Thanks for any tips.
 
Milind Kulkarni
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
UnknownHostException is encountered when RMI is unable to resolve the server host name. If you are working on a stand alone machine then TCP/IP must be configured.
To experiment with RMI on a single machine, you must provide the name of the machine. To find out the name of your machine, go to the control panel of start menu and select �Network.� Click on the "Identification" tab, and you�ll see your computer name. In my case, I call my computer "compaq".
TCP / IP connection will have to be active. This means that you must connect to your Internet service provider before trying to run the program or you�ll get some obscure exception messages.
Regards,
Milind
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Milind,
Please help I trying to run my first RMI Program on windows 98 (stand alone). My Stub and Skel classes in same directory and I run the rmiregistry from that directory.
But When I run my server using following.
java -Djava.rmi.server.codebase=c:\developer_assignment\working\suncertify\db\ -classpath <myclasspath> DataProxy
I get following error:
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: suncertify.db.DataProxy_Stub
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.db.DataProxy_Stub
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: suncertify.db.DataProxy_Stub
java.lang.ClassNotFoundException: suncertify.db.DataProxy_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:249)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
224)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:358)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:165)
at suncertify.db.DataProxy.main(DataProxy.java:56)

BTW I am not running any http server.
am I invovking my server properly??? Please send some comments, I am really in need of some help.

Regards
Sanjay
 
tony f
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Milind,
Thanks for those tips. I've now got things working.
Is there any RMI book you can recommend? I'm currently using "Java Enterprise in a Nutshell" from O'Reilly. While it is a good book, it doesn't cover these basic beginners' problems.
Thanks again, Tony.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic