[jacorb-developer] org.omg.CORBA.INITIALIZE: Could not create server socket (4689): java.net.BindException: Address already in use: JVM_Bind

Steve Totten tottens at ociweb.com
Mon Sep 26 20:01:38 CEST 2011


Hi Gary,

On 9/26/2011 10:58 AM, Riojas, Gary wrote:
> Trying to get the server demo running from Eclipse
>
> Below is the code from the main method.
>
> public static void main(String[] args) {
>
>               org.omg.CORBA.Object obj;
>
>               Properties props = System.getProperties();
>
>
>           ORB orb = ORB.init( args, props );
>
>              try {
>
>                    // Get reference to the RootPOA
>                    org.omg.CORBA.Object rootPOA = orb
>                                .resolve_initial_references("RootPOA");
>
>                    org.omg.PortableServer.POA poa = org.omg.PortableServer.POAHelper
>                                .narrow(rootPOA);
>
>                    // Activate the POAManager
>                    poa.the_POAManager().activate();
>                    org.omg.CORBA.Object o = poa.servant_to_reference(new gridImpl());
>
>                    NamingContextExt nc = null;
>                    nc = NamingContextExtHelper.narrow(orb
>                                .resolve_initial_references("NameService"));
>
>                          // register with the naming service
>                          nc.bind(nc.to_name("grid.example"), o);
>              } catch (Exception e) {
>                    e.printStackTrace();
>              }
>              orb.run();
>        }
>
> The only thing I changed in the jacorb.properties file is ORBInitRef.NameService=corbaloc:: 10.72.241.37:4689/StandardNS/NameServer-POA/_root
>
> Below are my steps:
> ===================
>
> 1.  Start NamingService from command prompt using the following command
>
> java -Djava.endorsed.dirs=%JACORB_HOME%\lib -DOAPort=4689 -Djacorb.home=%JACORB_HOME% -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton org.jacorb.naming.NameServer

Did the Naming Service start up successfully?

> Run main method above and get "org.omg.CORBA.INITIALIZE: Could not create server socket (4689): java.net.BindException: Address already in use: JVM_Bind" error on "org.omg.CORBA.Object rootPOA = orb.resolve_initial_references("RootPOA");"

What command line options did you provide to the demo server with the
above main method?  In particular, did you provide a different port
number than 4689 to the -DOAPort option?

> Please advise on what might be causing the error.

If the Naming Service is up listening on port 4689, you can't start
another server and have it try to listen on the same port number on the
same host.  Make sure you try a different port number for OAPort for the
demo server.

HTH,
Steve
-- 
----------------------------------------------------------------
  Steve Totten, Principal Software Engineer and Partner
  Object Computing, Inc. (OCI), St. Louis, MO, USA
  http://www.ociweb.com/  http://www.twitter.com/objectcomputing
----------------------------------------------------------------



More information about the jacorb-developer mailing list