users@glassfish.java.net

Re: Accessing a JMS Resource on a Remote Server

From: rdblaha1 <rd_blaha_at_hotmail.com>
Date: Thu, 3 Jan 2008 10:23:48 -0800 (PST)

Thank you Zoltan for the information. I read through much of the thread you
directed me to


glassfish wrote:
>
> First, take a look at this thread:
> http://forums.java.net/jive/thread.jspa?threadID=25704&tstart=15
>

And then I reviewed the piece of code and added what I found necessary to
add to my code.



> Here's a piece of code which works fine for me:
>
> //the following 2 lines are equivalent with setting Java VM parameters
> with the same
> //name and value (like -Dorg.omg.CORBA.ORBInitialHost=serverhost)
> System.setProperty( "org.omg.CORBA.ORBInitialHost", "serverhost" );
> //default is localhost
> System.setProperty( "org.omg.CORBA.ORBInitialPort", "3700" ); //default
>
> Context jndiCtx = new InitialContext();
> ConnectionFactory connectionFactory = (ConnectionFactory) jndiCtx.lookup(
> "ConnFactJNDIName" );
> Destination dest = (Destination) jndiCtx.lookup( "MyQueueOrTopicJNDIName"
> );
> Connection connection = connectionFactory.createConnection();
> Session session = connection.createSession( false,
> Session.AUTO_ACKNOWLEDGE );
>
> MessageProducer producer = session.createProducer( dest );
> TextMessage message = session.createTextMessage();
> message.setText( "Hello" );
> producer.send( message );
>

After establishing in my code the connectionFactory, dest, connection, and
session, when I tried to run the code the results were the same as my
original post. This tells me there is something apparently in my setup that
is incorrect. (If my code is right the first alternative area for a problem
is the setup.)

When I established and ran my JMS Client Programs on Multiple Systems (as
described in The Java EE 5 Tutorial) I had to have connectionFactories and
resources (queue and topic) setup in both the client side (my PC with
Glassfish v2) and the server side (the network system with AppServer 9.1).
Furthermore, in setting up the connectionFactory I had to create a remote
Factory using -Dsys=remote-system-name. Being viewed using the Admin
Console for the PC Glassfish v2 server I had the following tree and
properties:
Resources >> JMS Resources >> Connection Factories >>
jms/AdminConnectionFactory with three specified properties: UserName: guest
Password: guest AND AddressList: admin:7676. I don't see where these are
included in my standalone setup.

If I am to make connection via my standalone setup with all the require jar
files (provided for me by using package-appclient and deployed to a separate
directory on my PC, separate from the development area) I have yet to see
where the connectionFactories and resources (queue and topic) are actually
setup. I almost know that what I am missing is simple, yet I have need to
find in all the reading I have done including that to which I was directed
in your post.

Help me to understand my steps for setup to make this work.

Thank you.




-- 
View this message in context: http://www.nabble.com/Accessing-a-JMS-Resource-on-a-Remote-Server-tp14580977p14602496.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.