users@glassfish.java.net

Re: Glassfish V3 Standalone JMS Client - Question

From: <glassfish_at_javadesktop.org>
Date: Wed, 06 Jan 2010 08:16:43 PST

I am including the following jars for the client's classpath. Since this client does more work, I've also listed a few other jars, just for additional information. I just can't connect to the server's resources in GFV3.

[code]
appserv-rt.jar
jms.jar - jms support
imq.jar - jms support
mail.jar - mail support
javax.persistence.jar - working with entities
[/code]


I've found that if I reference my old connection factories and queues using explicit references via sun's api, that I can reach them, but I still am not able to access <strong>ejbs</strong> via jndi.


Here is how I was able to get the JMS client working. Where as in GF 2.1+ I was able to do the following:
[code]
// works in 2.1
factory = (ConnectionFactory) context.lookup("jms/ConnectionFactory")
[/code]

In GFV3, I used information in this post [link]http://forums.java.net/jive/thread.jspa?threadID=71923&tstart=0[/link] to do this:

[code]
factory = new com.sun.messaging.ConnectionFactory();
((new com.sun.messaging.ConnectionFactory)factory).setProperty (ConnectionConfiguration.imqAddressList, "machineName:7676");
[/code]

I took a similar approach for the destination queues. It appears that [b]the real problem is[/b] that I am not locating the jndi default properties, or the client is not finding them.


Now, the client can't seem to reach any ejbs via remote reference:

[code]
remoteEJB = (MyRemoteInterface) context.lookup ("ejb/MappedName");
[/code]
Throws exceptions.
Specifically:

[code]
javax.naming.NoInitialContextException: Need To Specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.initial.
[/code]

I've done a search in all of the jar files that are included within GFV3 and can't find this file, does anyone know where this file is or how to resolve it? Am I including something incorrectly?

I've also tried including alot more jar files - but it appears to make the problem significantly worse :(


I believe that the most helfpul exception is
[Message sent by forum member 'hoffman462' (HoffmanDanielG_at_comcast.net)]

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