Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

RMI - unknown protocol: rsrc

843793Jul 6 2009 — edited Jul 12 2009
Hello,
I get a strange error message from my test rmi client. (Client is run on localhost, just for testing)
The exception is:

java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.net.MalformedURLException: unknown protocol: rsrc
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at sep.tukl.client.Client.main(Client.java:27)
Caused by: java.net.MalformedURLException: unknown protocol: rsrc
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
...
...

I cant find anything on google or in these forums about this exception.
Can anyone help me?

greetings
Raptor

Client
    public static void main(String[] args) {
        System.setProperty("java.security.policy", "java.policy");
        if (System.getSecurityManager() == null) {
            System.setSecurityManager(new SecurityManager());
        }


		try{
			Registry r = LocateRegistry.getRegistry(6666);
			
			DVMService h = (DVMService) r.lookup("DVM");
			System.out.println(h);
		} catch (Exception e){
			e.printStackTrace();
		}
    }
Server
private void startRMIRegistry(){		
		System.setProperty("java.security.policy", "java.policy");
		if(System.getSecurityManager()==null){
			System.setSecurityManager(new RMISecurityManager());
		}
		try {
			LocateRegistry.createRegistry(rmiPort);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
}
private void registerRMI() throws AccessException, RemoteException, AlreadyBoundException, MalformedURLException{
	dvmservice = new DVMServiceImpl(this);
	DVMService d = (DVMService) UnicastRemoteObject.exportObject(
		dvmservice, 0);
		LocateRegistry.getRegistry(rmiPort).rebind("DVMService", d);
	}
 
    private void unregisterRMI() throws AccessException, RemoteException,
	    NotBoundException {
	LocateRegistry.getRegistry(rmiPort).unbind("DVM");
	UnicastRemoteObject.unexportObject(dvmservice, false);
	UnicastRemoteObject.unexportObject(registry, false);

    }

    private void startCodebaseWebserver() {
	try {
	    new NanoHTTPD(httpdPort);
	    System.setProperty("java.rmi.server.codebase", control.codebaseURL
		    + ":" + httpdPort + "/Server.jar");
	} catch (IOException e) {
	    Logger.fatal("ServerController : " + e.getMessage());
	}

    }

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 8 2009
Added on Jul 6 2009
5 comments
3,052 views