users@glassfish.java.net

Re: Accessing a JMS Resource on a Remote Server

From: <glassfish_at_javadesktop.org>
Date: Sat, 12 Jan 2008 06:14:52 PST

Hey,

sorry for not responding sooner, I was busy during the week.

I think you're still mixing up the concept of Application Client with stand-alone java client.

Facts:
- you're trying to write a stand alone java client - which is to be run like "java -jar myapp.jar".
- the java ee 5 tutorial uses Application Client for executing it's code - it uses appclient.bat which is in the server for executing client jar files.
- you want your program to be able to execute without application server presence --> that's a standalone java client
- you're writing your code as i suggested --> you're writing a stand alone application. howewer, you're trying to execute it with appclient command which is in the server and is used to execute Application Clients.

Now, Application Client is a good thing, Tim explained it in his reply previously. You can use that, if you want, but then you should ignore what I was saying because I thought you want to write a stand alone java client.

If you still want to write stand alone java clients then you should NOT try to execute it with appclient command, 'cause it is designed to execute Application Clients. What you should do is simply write a simple java console application, like hello world. Then include j2ee libraries in the project - you can find the necessary jars in Glassfish_home/lib. Then copy the code I wrote in my first reply and paste it in the application, then you're done, it should execute properly if the remote server (on which the application tries to reach the queue) is up and running. So you simply have to execute this program as you would execute a simple hello world. without using the appclient command.

i hope this clears things out.

cheers
z
[Message sent by forum member 'zoltan_kiss' (zoltan_kiss)]

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