users@glassfish.java.net

Re: JMS and glassfish ...

From: <glassfish_at_javadesktop.org>
Date: Thu, 19 Aug 2010 12:14:58 PDT

Hi Nigel,

I plan to use the ACC, but for now would like to get this working without it. Is that possible? I think I've seen some stand-alone apps that don't use it. Anyway, this is what I've come up with so far:

        try
        {
                    Properties env = new Properties();
                       env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.SerialInitContextFactory");
                       env.put(Context.STATE_FACTORIES,"com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
                       env.put(Context.URL_PKG_PREFIXES,"com.sun.enterprise.naming");
                       String sUri = "iiop"+"://"+"127.0.0.1"+":"+"3700";
                       System.out.println(sUri);
                       env.put(Context.PROVIDER_URL,sUri);
              
                       //Finally, the rubber meets the road.
                       Context context = new InitialContext(env);
        }
        catch (Exception e)
        {
                System.out.println("JNDI Initial Context Failed: " + e.toString());
        }

And I get : JNDI Initial Context Failed: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.appserv.naming.SerialInitContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.appserv.naming.SerialInitContextFactory]

The Glassfish domain is up and running.

It's interesting to note that I get the error even if I put in an invalid IP addr. So, is SerialInitContextFactory an object the stand-alone client is trying to get from Glassfish?



TIA
[Message sent by forum member 'whatsamatteru']

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