users@glassfish.java.net

GF v3: Remote EJB access fails ...org/CosNaming/NamingContext/NotFound:1.0

From: <glassfish_at_javadesktop.org>
Date: Tue, 23 Mar 2010 12:28:10 PDT

Hello,

I try to access a remote session bean deployed on host2 (glassfish v3 final standalone) from another host1 (glassfish v3 final standalone, too).

Here is my code:


[i]
// host2 side: EJB implementation:
@Stateless
@Remote
public class DemoServerServiceImpl implements DemoServerService {
    public String getResult(String param) {
        ...
    }
}

// host2 + host1 side: remote interface implementation:
@Remote
public interface DemoServerService {
    public String getResult(String param);
}

// host1 side: client to access the remote EJB
@Stateless
public class DemoClientService {
    /** reference to the remore service */
    @EJB(name="demoServerServiceRef", mappedName="corbaname:iiop:1.2_at_host2:3700#java:global/demoserver/DemoServerServiceImpl")
    private DemoServerService demoServerService;

    ...
}
[/i]
Everything compiles and deploys well. The app on host2 is deployed in a webapp named "demoserver".

When I try to access the DemoClientService (local call on host1 to this local EJB) this local EJB cannot be initialized because the referenced EJB cannot be determined:


[i]Caused by: javax.naming.NamingException: Exception resolving Ejb for 'Remote ejb-ref name=demoServerServiceRef,Remote 3.x interface =com.remoteejbdemo.demoserver.DemoServerService,ejb-link=null,lookup=null,mappedName=corbaname:iiop:1.2_at_host2:3700#java:global/demoserver/DemoServerServiceImpl,jndi-name=,refType=Session' . Actual (possibly internal) Remote JNDI name used for lookup is 'corbaname:iiop:1.2_at_host2:3700#java:global/demoserver/DemoServerServiceImpl__3_x_Internal_RemoteBusinessHome__' [Root exception is org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 9 completed: No]
        at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:174)
        at com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl$EjbReferenceProxy.create(ComponentEnvManagerImpl.java:1040)
        at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:688)
        at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:657)
        at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:148)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:428)
        ... 43 more
Caused by: org.omg.CORBA.BAD_PARAM: vmcid: OMG minor code: 9 completed: No
        at com.sun.corba.ee.impl.logging.OMGSystemException.soBadSchemaSpecific(OMGSystemException.java:1075)
        at com.sun.corba.ee.impl.logging.OMGSystemException.soBadSchemaSpecific(OMGSystemException.java:1093)
        at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:228)
        at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveINSURL(INSURLOperationImpl.java:154)
        at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:144)
        at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:954)
        at com.sun.ejb.EjbNamingReferenceManagerImpl.resolveEjbReference(EjbNamingReferenceManagerImpl.java:167)
        ... 48 more
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
        at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
        at org.omg.CosNaming._NamingContextExtStub.resolve_str(_NamingContextExtStub.java:165)
        at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.resolveCorbaname(INSURLOperationImpl.java:222)
        ... 52 more
[/i]
I also used a sun-ejb-jar.xml instaed of the mappedName attribute to configure the JNDI name but I got the same result. I also read the EJB FAQs several times.

Any ideas?

Thanks,

Christian
[Message sent by forum member 'chrishapke']

http://forums.java.net/jive/thread.jspa?messageID=393353