Dain Sundstrom wrote:
Any idea what is causing this? BTW the error message is quite useless
as it doesn't even tell you the port and interface that it was
attempting to bind to.
org.omg.CORBA.COMM_FAILURE: bind() failed: java.net.BindException:
Address already in use minor code: 0x4f4f0008 completed: No
at
org.apache.yoko.orb.OCI.IIOP.Acceptor_impl.<init>(Acceptor_impl.java:434)
at
org.apache.yoko.orb.OCI.IIOP.AccFactory_impl.create_acceptor(AccFactory_impl.java:148)
at
org.apache.yoko.orb.OBPortableServer.POAManagerFactory_impl.create_POAManager(POAManagerFactory_impl.java:250)
at
org.apache.yoko.orb.OB.ORBControl.initializeRootPOA(ORBControl.java:515)
at
org.apache.yoko.orb.OBCORBA.ORB_impl.resolve_initial_references(ORB_impl.java:1073)
at org.apache.yoko.rmi.impl.RMIState.<init>(RMIState.java:73)
at
org.apache.yoko.rmi.impl.PortableRemoteObjectExtImpl.getCurrentState(PortableRemoteObjectExtImpl.java:45)
at
org.apache.yoko.rmi.api.PortableRemoteObjectExt.getState(PortableRemoteObjectExt.java:65)
at org.apache.yoko.rmi.impl.RMIState.current(RMIState.java:152)
at
org.apache.yoko.rmi.impl.PortableRemoteObjectImpl.getTypeRepository(PortableRemoteObjectImpl.java:42)
at
org.apache.yoko.rmi.impl.PortableRemoteObjectImpl.narrow(PortableRemoteObjectImpl.java:103)
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:56)
The code is just doing this:
String ior = getIor();
ORB orb = (ORB) ORB.init(new String[0], null);
org.omg.CORBA.Object object = orb.string_to_object(ior);
MyObject myObj = (MyObject) PortableRemoteObject.narrow(object,
MyObject.class);
I think I figured out what's going on here. A lot of code within Yoko
is doing the following to instantiate an ORB instance:
Properties props = System.getProperties();
props.put(...);
ORB orb = ORB.init(args, props);
By setting the properties directly into the property bundle returned by
System.getProperties(), this code is inadvertently setting the system
property, leaving junk that can be picked up later. In this case, it
was the NamingService code that was leaving an endpoint property set
that was causing the duplicate.
Thanks
-dain