• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in Starting rmi registry.  RSS feed

 
vinoth sathiyamoorthy
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying to run rmi registry and

the rmi Server(TPNServer). The interface

declared in a file(LoginInter) and

implemented in another file(logimpl), and it

is called from TPNServer. But when I execute

the rmi registry and rmi Server I getting

error, Here I given the server coding and

the error occurred.

Code:

import java.rmi.*;
import java.rmi.server.*;


class TPNServer
{
public static void main(String ar[])
{
try
{
System.out.println("Server Started....");
Tpn t=new TPNImpl();


System.out.println("test-1");


Naming.rebind("Server",t);
}
catch(Exception e)
{
System.out.println("Error

Occurred: "+e);


e.printStackTrace();
}
}
}


Error:

Server Started....
test-1
Error Occurred:
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:

TPNImpl_Stub
at

sun.rmi.server.UnicastServerRef.oldDispatch(

UnicastServerRef.java:396
)
at

sun.rmi.server.UnicastServerRef.dispatch(Uni

castServerRef.java:250)
at

sun.rmi.transport.Transport$1.run(Transport.

java:159)
at

java.security.AccessController.doPrivileged(

Native Method)
at

sun.rmi.transport.Transport.serviceCall(Tran

sport.java:155)
at

sun.rmi.transport.tcp.TCPTransport.handleMes

sages(TCPTransport.java:5
35)
at

sun.rmi.transport.tcp.TCPTransport$Connectio

nHandler.run0(TCPTranspor
t.java:790)
at

sun.rmi.transport.tcp.TCPTransport$Connectio

nHandler.run(TCPTransport
.java:649)
at

java.util.concurrent.ThreadPoolExecutor$Work

er.runTask(ThreadPoolExec
utor.java:885)
at

java.util.concurrent.ThreadPoolExecutor$Work

er.run(ThreadPoolExecutor
.java:907)
at

java.lang.Thread.run(Thread.java:619)
at

sun.rmi.transport.StreamRemoteCall.exception

ReceivedFromServer(Unknow
n Source)
at

sun.rmi.transport.StreamRemoteCall.executeCa

ll(Unknown Source)
at

sun.rmi.server.UnicastRef.invoke(Unknown

Source)
at

sun.rmi.registry.RegistryImpl_Stub.rebind(Un

known Source)
at java.rmi.Naming.rebind(Unknown

Source)
at TPNServer.main(TPNServer.java:15)
Caused by: java.rmi.UnmarshalException:

error unmarshalling arguments; nested ex
ception is:
java.lang.ClassNotFoundException:

TPNImpl_Stub
at

sun.rmi.registry.RegistryImpl_Skel.dispatch(

Unknown Source)
at

sun.rmi.server.UnicastServerRef.oldDispatch(

UnicastServerRef.java:386
)
at

sun.rmi.server.UnicastServerRef.dispatch(Uni

castServerRef.java:250)
at

sun.rmi.transport.Transport$1.run(Transport.

java:159)
at

java.security.AccessController.doPrivileged(

Native Method)
at

sun.rmi.transport.Transport.serviceCall(Tran

sport.java:155)
at

sun.rmi.transport.tcp.TCPTransport.handleMes

sages(TCPTransport.java:5
35)
at

sun.rmi.transport.tcp.TCPTransport$Connectio

nHandler.run0(TCPTranspor
t.java:790)
at

sun.rmi.transport.tcp.TCPTransport$Connectio

nHandler.run(TCPTransport
.java:649)
at

java.util.concurrent.ThreadPoolExecutor$Work

er.runTask(ThreadPoolExec
utor.java:885)
at

java.util.concurrent.ThreadPoolExecutor$Work

er.run(ThreadPoolExecutor
.java:907)
at

java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException:

TPNImpl_Stub
at

java.net.URLClassLoader$1.run(URLClassLoader

.java:200)
at

java.security.AccessController.doPrivileged(

Native Method)
at

java.net.URLClassLoader.findClass(URLClassLo

ader.java:188)
at

java.lang.ClassLoader.loadClass(ClassLoader.

java:306)
at

java.lang.ClassLoader.loadClass(ClassLoader.

java:251)
at

java.lang.ClassLoader.loadClassInternal(Clas

sLoader.java:319)
at java.lang.Class.forName0(Native

Method)
at

java.lang.Class.forName(Class.java:247)
at

sun.rmi.server.LoaderHandler.loadClass(Loade

rHandler.java:434)
at

sun.rmi.server.LoaderHandler.loadClass(Loade

rHandler.java:165)
at

java.rmi.server.RMIClassLoader$2.loadClass(R

MIClassLoader.java:620)
at

java.rmi.server.RMIClassLoader.loadClass(RMI

ClassLoader.java:247)
at

sun.rmi.server.MarshalInputStream.resolveCla

ss(MarshalInputStream.jav
a:197)
at

java.io.ObjectInputStream.readNonProxyDesc(O

bjectInputStream.java:157
5)
at

java.io.ObjectInputStream.readClassDesc(Obje

ctInputStream.java:1496)
at

java.io.ObjectInputStream.readOrdinaryObject

(ObjectInputStream.java:1
732)
at

java.io.ObjectInputStream.readObject0(Object

InputStream.java:1329)
at

java.io.ObjectInputStream.readObject(ObjectI

nputStream.java:351)
... 12 more
 
Oscar Costa
Ranch Hand
Posts: 31
Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I think you need to export the object before bind it.

Try this:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!