Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Rebind() Problem

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I m facing little bit different problem regarding Naming.rebin()..........In this problem, rmiregistry is not working n the error is occured with this line.........
"Port is not a number" even i m using the same format to write hostname and port number what is the problem here ..........plz guide me........
import java.rmi.*;
import java.rmi.server.*;
public class HelloWorldImpl extends UnicastRemoteObject implements HelloWorld
{ public HelloWorldImpl() throws RemoteException
{ super(); }
public String sayHello(String name)
{ return "Hello "+ name; }
public static void main(String[] args)
{ if(System.getSecurityManager()==null)
System.setSecurityManager(new RMISecurityManager());
try { HelloWorldImpl hw = new HelloWorldImpl();
System.out.println("Trying to bind");
Naming.rebind("//localhost:1098/HelloWorldImpl",hw);
System.out.println("Bound"); }
catch(Exception e) {
e.printStackTrace(); } }}
import java.rmi.*;public interface HelloWorld extends Remote{ public String sayHello(String name) throws RemoteException;}
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try it out using this :
Naming.rebind("HelloWorldImpl",hw);
 
I am going to test your electrical conductivity with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic