This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes RMI unmarshling error while registering Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI unmarshling error while registering" Watch "RMI unmarshling error while registering" New topic
Author

RMI unmarshling error while registering

rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Hello to all

I am trying to develop the call back server through RMI and get following error while running my Client code


my policy file for client

I tried to run my code with both with and without policy file but the error is same

the interface files are
interFile.java (Used to register the call back object to the server)


callBackInter.java (used to reply to Client)



Client.java


Server.java


When I run my code without security manager, It gives me following error


Please Tell me about this, How to come out of this?
Thanks in advance.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

rajshkhr pandey wrote:Hello to all
java.lang.ClassNotFoundException: Client (no security manager: RMI class loader disabled)


Sounds to me like you are missing a security manager.
I'm going to move this to the Distributed Programming forum, where RMI is discussed.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Joe Ess wrote:
rajshkhr pandey wrote:Hello to all
java.lang.ClassNotFoundException: Client (no security manager: RMI class loader disabled)


Sounds to me like you are missing a security manager.
I'm going to move this to the Distributed Programming forum, where RMI is discussed.


Thanks for the reply apologies to post the in wrong forum

But when I use security manager the error again arise if java.security.AccessControlException


# Client's Contructor :
# Registering to the server
# Exception in thread "main" java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.6:49291 connect,resolve)
# at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
# at java.security.AccessController.checkPermission(AccessController.java:546)
# at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
# at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
# at java.net.Socket.connect(Socket.java:513)
# at java.net.Socket.connect(Socket.java:469)
# at java.net.Socket.<init>(Socket.java:366)
# at java.net.Socket.<init>(Socket.java:180)
# at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
# at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
# at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:595)
# at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:198)
# at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:184)
# at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:110)
# at Server_Stub.registerToTheServer(Unknown Source)
# at Client.main(Client.java:21)


I tried both also using all -Djavas command while running code but the result is same.
Also I have created the stub files of the Client and Server, and copied in respective folders
But the error is same.
rajshkhr pandey
Ranch Hand

Joined: Oct 14, 2009
Posts: 35
Problem has been resolved

In clients code I have not exported the object using UnicastRemoteObject.
I have just extended the UnicastRemoteObject to the client's class and the application is running no problems.

Thanks a lot for your efforts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI unmarshling error while registering
 
Similar Threads
HFJ - RMI issues.
RMI: ClassNotFoundException for STUB class
Eclipse wont run my RMI program?
Using RMI from within Eclipse
no security manager: RMI class loader disabled