users@glassfish.java.net

Re: Embedded GlassFish ORB

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Mon, 27 Aug 2012 12:57:36 -0700

Can it be that the ORB port is used by a running regular GF instance?

Torsten.Scharf_at_t-systems.com wrote:
> Hello,
> I am trying to use EmbeddedGlassfish for unit tests, when running the
> testcase I am getting an error when stating glassfish. It looks like
> that glassfish don’t start the ORB? I don’t have found a proper
> solution for me in the net, can you help me?
> GlassFish Version: GlassFish Server Open Source Edition 3.1.2.2 (build 5)
> Using Local EJBs, CDI and WebServices
> …
> INFO: SEC1002: Security Manager is OFF.
> 27.08.2012 14:00:31 com.sun.enterprise.security.SecurityLifecycle
> onInitialization
> INFO: SEC1010: Entering Security Startup Service
> 27.08.2012 14:00:31 com.sun.enterprise.security.PolicyLoader loadPolicy
> INFO: SEC1143: Loading policy provider
> com.sun.enterprise.security.provider.PolicyWrapper.
> 27.08.2012 14:00:31 com.sun.enterprise.security.auth.realm.Realm
> doInstantiate
> INFO: SEC1115: Realm [admin-realm] of classtype
> [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully
> created.
> 27.08.2012 14:00:31 com.sun.enterprise.security.auth.realm.Realm
> doInstantiate
> INFO: SEC1115: Realm [file] of classtype
> [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully
> created.
> 27.08.2012 14:00:31 com.sun.enterprise.security.auth.realm.Realm
> doInstantiate
> INFO: SEC1115: Realm [certificate] of classtype
> [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm]
> successfully created.
> 27.08.2012 14:00:31 com.sun.enterprise.security.SecurityLifecycle
> onInitialization
> INFO: SEC1011: Security Service(s) Started Successfully
> 27.08.2012 14:00:31 org.glassfish.webservices.metroglue.MetroContainer
> postConstruct
> INFO: WS10010: Web service endpoint deployment events listener
> registered successfully.org.omg.CORBA.COMM_FAILURE: FEIN: IOP00410001:
> Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost;
> port: 3700 vmcid: OMG minor code: 1 completed: No
> …
> Caused by: _java.lang.RuntimeException_: _java.net.ConnectException_:
> Connection refused: connect
> at
> org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSocket(_IIOPSSLSocketFactory.java:339_)
> at
> com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(_SocketOrChannelConnectionImpl.java:242_)
> ... 56 more
> Caused by: _java.net.ConnectException_: Connection refused: connect
> at sun.nio.ch.Net.connect(_Native Method_)
> at sun.nio.ch.SocketChannelImpl.connect(_SocketChannelImpl.java:500_)
> at
> com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(_ORBUtility.java:110_)
> at
> org.glassfish.enterprise.iiop.impl.IIOPSSLSocketFactory.createSocket(_IIOPSSLSocketFactory.java:324_)
> ... 57 more
> …
> Unit-Test:
> …
> // System.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
> // System.setProperty("org.omg.CORBA.ORBInitialHost", "0.0.0.0");
> *final* Map<String, Object> properties = *new* HashMap<String, Object>();
> *final* String domain =
> PropertyProvider./INSTANCE/.getString("domain.dir") + "/" +
> PropertyProvider./INSTANCE/.getString("domain.name");
> properties.put(EJBContainer./MODULES/, *new*
> File("../eshop/dist/eshop.ear"));
> properties.put("org.glassfish.ejb.embedded.glassfish.installation.root",
> PropertyProvider./INSTANCE/.getString("glassfish.home"));
> properties.put("org.glassfish.ejb.embedded.glassfish.instance.root",
> domain);
> properties.put("org.glassfish.ejb.embedded.glassfish.configuration.file",
> domain + "/config/domain.xml");
> BaseAccessTest./ejbContainer/ =
> EJBContainer./createEJBContainer/(properties);
> Assert./assertNotNull/(BaseAccessTest./ejbContainer/);
> …
> domain.xml:
> …
> <iiop-service>
> <orb use-thread-pool-ids="thread-pool-1"></orb>
> <iiop-listener port="3700" id="orb-listener-1" address="0.0.0.0"
> lazy-init="false"></iiop-listener>
> </iiop-service>
> …
> or
> …
> <iiop-service>
> <orb use-thread-pool-ids="thread-pool-1"></orb>
> <iiop-listener port="3700" id="orb-listener-1" address="0.0.0.0"
> lazy-init="true"></iiop-listener>
> </iiop-service>
> …
> Greetings,
> Torsten Scharf