users@glassfish.java.net

EJB call from standalone client via IIOPS (SSL)

From: <glassfish_at_javadesktop.org>
Date: Wed, 05 Mar 2008 09:58:32 PST

Hello,

I have the same (or perhaps similar) problem as described here: http://forums.java.net/jive/thread.jspa?threadID=35327

I'm trying to get SSL and IIOP working.
I have a standalone client where I lookup a remote EJB stateless session
bean.
The lookup works fine if I don't use SSL. When I switch to SSL I get the
following error:
[i]
javax.naming.CommunicationException: Can't find SerialContextProvider [Root exception is org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 208 completed: Maybe]
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:172)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:309)[/i]

In my standalone client I'm doing the lookup as follows:

[i] private final static String INITIAL_CONTEXT_FACTORY_CLASS = "com.sun.enterprise.naming.SerialInitContextFactory";
...
      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY_CLASS);

      Context ctx = new InitialContext(env);
      ServerAuthHome home = (ServerAuthHome) ctx.lookup("ServerAuthHomeJNDI");[/i]

The exception is thrown in line:
[i]ServerAuthHome home = (ServerAuthHome) ctx.lookup("ServerAuthHomeJNDI");[/i]

The appserv-rt.jar and javaee.jar are on the client's classpath and i called my standalone client with:

[i] <target name="run.example" depends="">
    <java classname="com.test.SimpleNativeClient" classpathref="project.classpath" fork="true">
          <jvmarg line="-Dorg.omg.CORBA.ORBInitialHost=localhost" />
          <jvmarg line="-Dorg.omg.CORBA.ORBInitialPort=3820" />
          <!--<jvmarg line="-Djavax.net.debug=ssl,handshake" />-->
         <jvmarg value="-Djavax.net.ssl.keyStore=keystore.jks"/>
    <jvmarg value="-Djavax.net.ssl.keyStorePassword=changeit"/>
    <jvmarg value="-Djavax.net.ssl.trustStore=cacerts.jks"/>
    <jvmarg value="-Djavax.net.ssl.trustStorePassword=changeit"/>
    </java>
  </target>[/i]

I also followed the hints of the thread (35327) mentioned above. I have a sun-ejb-jar.xml in the META-INF of my EJB jar-file which looks as follows:

[i]<?xml version="1.0"?>

<!DOCTYPE sun-ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Application Server 9.0 EJB 3.0//EN'
  'http://www.sun.com/software/appserver/dtds/sun-ejb-jar_3_0-0.dtd'>
<sun-ejb-jar>
 
  <enterprise-beans>
  
    <ejb>
      <ejb-name>ServerAuthEJB</ejb-name>
      <jndi-name>ServerAuthHomeJNDI</jndi-name>
                        <ior-security-config>
                                <transport-config>
                                  <integrity>required</integrity>
                                  <confidentiality>required</confidentiality>
                                  <establish-trust-in-target>supported</establish-trust-in-target>
                                  <establish-trust-in-client>supported</establish-trust-in-client>
                                </transport-config>
                                <sas-context>
                                        <caller-propagation>supported</caller-propagation>
                                </sas-context>
                        </ior-security-config>
    </ejb>
 
  </enterprise-beans>

</sun-ejb-jar>[/i]


Any ideas what could be the problem? Thanks a lot in advance.
[Message sent by forum member 'freddydaking' (freddydaking)]

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