• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

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

 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
grapes are vegan food pellets. Eat this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic