• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI Initial Context Parameters

 
Jayavardhan geepi
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We enter JNDI by doing " new InitialContext()" . But we need to pass PROVIDER_URL and INITIAL_CONTEXT_FACTORY in a map or Properties object right?
What those parameter does mean? What are the values for them?.
Someone please help me..
Thanks
 
Vikram Saxena
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes, The Initital context is used to get to the base of the Application server's JNDI tree.
You have to hence pack all the details in a HashMap (Properties) object and pass it to the Initial Context constructor.
This is the way you do it for JBOSS, for other application servers you would need to change the NamingContectFactory and the url protocol (jnp for jboss and t3 for WLS as an example) :



Hope this helps
 
Jayavardhan geepi
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vikram, It has brought some light.
But I want to know what is the provider URL? What will be there in that location?
(I came to know that, the value of "java.naming.factory.initial" property is the name of the class which implements the InitialContext).
 
Vikram Saxena
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayavardhan geepi wrote:But I want to know what is the provider URL? What will be there in that location?


A provider URL contains server information that the initial context factory uses to get an initial context. So this is the hostname and the port on which your server is accepting requests.


Jayavardhan geepi wrote:(I came to know that, the value of "java.naming.factory.initial" property is the name of the class which implements the InitialContext).


Yes, this should point to the application server's class which implements InititalContext and hence varies for every App server
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!