• Post Reply Bookmark Topic Watch Topic
  • New Topic

What to set in INITIAL_CONTEXT_FACTORY and PROVIDER_URL in Stand alone client for JMS

 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am trying out J2EE 1.4 from Sun and I am using their tutorial and things worked for me for SimpleProducer and SimpleSynchConsumer.java for JMS Examples

Here is the link of tutorial I am following,
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html

Now, here is my question,
I want to run SimpleProducer as stand alone java program but I am not sure what to set in for Intial Context Factory and Provider Url properties in InitialContext so that it can work. I will still keep running the SimpleSynchConsumer via 'appclient' executable as mentioned in the tutorial.

Thanks
Maulin

 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maulin Vasavada wrote:

Now, here is my question,
I want to run SimpleProducer as stand alone java program but I am not sure what to set in for Intial Context Factory and Provider Url properties in InitialContext so that it can work.



The InitialContext properties are actually for connecting to a JNDI server and get hold of the "administered" objects like the queues, queue connection factories. So you need a minimal JMS server which is able to provide this administered objects. Usually such objects are made available through the JNDI server.
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jaikiran

Thanks for your reply. I found what I had to put in those values.

Here are my findings,

1. In InitialContextFactory I had to put sun's initialcontext factory class impl name (I found that value by putting SOP in the Message Consumer for context.getEnvironment().get(Context.INITIAL_CONTEXT_FACTORY) )

2. In the Provider Url I had to put the "address" to the server that is running JNDI service. That I found from some web link (I forgot which one).

In my case I was using Sun ONE J2EE 1.4 so it was "localhost:1099"

Now, I got hang of what it is-
- We have to know the JNDI server's host+port and the factory class name that can help us to communicate with the JNDI server we specify in Provider Url.

Both of these worked.

Regards
Maulin
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!