• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

RMI unmarshling error while registering

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
rajshkhr pandey
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
For my next trick, I'll need the help of a tiny ad ...
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic