Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JMS (JNDI InitialContext) with Sun Application Server

16 views
Skip to first unread message

RVince

unread,
Jul 1, 2007, 8:32:38 PM7/1/07
to
For a remote client running connecting to a server at serverAddr
running OpenJMS, I am able to obtain an InitialContext as follows:


Properties env = new Properties( );

env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.InitialContextFactory");
env.put(Context.PROVIDER_URL, "tcp://"+serverAddr+":3035/");

InitialContext jndi = new InitialContext(env);

Does anyone have a sample of how they accomplish this connecting to either
Sun Application Server (any version) or Glassfish? I have spent the better
part of a weekend trying to give that a go, and am at a complete loss here.
Surely someone must have managed to get this going with one of those
servers? -R. Vince


Manish Pandit

unread,
Jul 2, 2007, 7:08:18 PM7/2/07
to

Hi,

You can try the factory as com.sun.appserv.naming.S1ASCtxFactory and
provider URL as iiop://<server_address>:3700 for Glassfish.

-cheers,
Manish

RVince

unread,
Jul 2, 2007, 7:56:35 PM7/2/07
to
Do you know what jars I must include Manish? Thanks, R.Vince


Manish Pandit

unread,
Jul 2, 2007, 11:10:11 PM7/2/07
to
On Jul 2, 4:56 pm, "RVince" <r vince 9 9 at hotmail dot com> wrote:
> Do you know what jars I must include Manish? Thanks, R.Vince

The context factory should be in appserv-rt.jar in the $GLASSFISH_HOME/
lib folder. I believe you are running within glassfish - you should
not have to specify explicit jar files...no?

-cheers,
Manish

RVince

unread,
Jul 3, 2007, 6:54:01 AM7/3/07
to
Hi Manesh,

Whether I include that jar or not, when I use these values as in my code
below, I am getting the exception stack which seems to start from a
"com.sun.appserv.naming.RoundRobinPolicy setClusterInstanceInfo" ? Any
thoughts here? I am running this under Glassfish v1_ur1-p01-b02 which I
believe is still the latest release. -Ralph

Properties env = new Properties( );
env.put(Context.INITIAL_CONTEXT_FACTORY,

"com.sun.appserv.naming.S1ASCtxFactory");
env.put(Context.PROVIDER_URL, "iiop://127.0.0.1:3700/");


InitialContext jndi = new InitialContext(env);

//The following line is referred to as
'Chat.<init>(Chat.java:44)' in the exception stack below
TopicConnectionFactory conFactory =
(TopicConnectionFactory)jndi.lookup("jmsConnectionFactory1");

Jul 3, 2007 6:42:11 AM com.sun.appserv.naming.RoundRobinPolicy
setClusterInstanceInfo
WARNING: NAM1005 : No Endpoints selected. Please specify using system
property com.sun.appserv.iiop.endpoints.
GroupInfoServiceBase(main): .addObserver->:
com.sun.appserv.naming.GroupInfoServiceObserverImpl@1ae939f
GroupInfoServiceBase(main): .addObserver<-:
com.sun.appserv.naming.GroupInfoServiceObserverImpl@1ae939f true
Jul 3, 2007 6:42:14 AM com.sun.appserv.naming.RoundRobinPolicy
getEndpointForProviderURL
WARNING: NAM1001: No Endpoints selected in com.sun.appserv.iiop.endpoints
property. Using JNDI Provider URL iiop://127.0.0.1:3700/ instead
Jul 3, 2007 6:42:15 AM
com.sun.enterprise.connectors.ConnectorConnectionPoolAdminServiceImpl
initialize
WARNING: sealing violation: can't seal package javax.transaction: already
loaded
Jul 3, 2007 6:42:16 AM com.sun.enterprise.connectors.ActiveRAFactory
createActiveResourceAdapter
SEVERE: RAR6001 : Class Not found : com.sun.messaging.jms.ra.ResourceAdapter
Jul 3, 2007 6:42:16 AM com.sun.enterprise.connectors.ActiveRAFactory
createActiveResourceAdapter
SEVERE:
com.sun.enterprise.connectors.ConnectorRuntimeException: Error in creating
active RAR
at
com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:94)
at
com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:287)
at
com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:208)
at
com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:88)
at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:314)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Chat.<init>(Chat.java:44)
at Chat.main(Chat.java:113)
Caused by: java.lang.ClassNotFoundException:
com.sun.messaging.jms.ra.ResourceAdapter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at
com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:68)
... 8 more
Jul 3, 2007 6:42:16 AM com.sun.enterprise.naming.SerialContext lookup
SEVERE: NAM0004: Exception during name lookup : {0}
com.sun.enterprise.connectors.ConnectorRuntimeException: Error in creating
active RAR
at
com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:94)
at
com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:287)
at
com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:208)
at
com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:88)
at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:314)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Chat.<init>(Chat.java:44)
at Chat.main(Chat.java:113)
Caused by: java.lang.ClassNotFoundException:
com.sun.messaging.jms.ra.ResourceAdapter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at
com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:68)
... 8 more
javax.naming.CommunicationException: serial context communication ex [Root
exception is com.sun.enterprise.connectors.ConnectorRuntimeException: Error
in creating active RAR]
at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:338)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at Chat.<init>(Chat.java:44)
at Chat.main(Chat.java:113)
Caused by: com.sun.enterprise.connectors.ConnectorRuntimeException: Error in
creating active RAR
at
com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:94)
at
com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:287)
at
com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:208)
at
com.sun.enterprise.naming.factory.ConnectorObjectFactory.getObjectInstance(ConnectorObjectFactory.java:88)
at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at
com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:314)
... 3 more
Caused by: java.lang.ClassNotFoundException:
com.sun.messaging.jms.ra.ResourceAdapter
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

0 new messages