Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Putting Objects in JNDI in WAS

 
Ryan Quinn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if I'm crazy or what, but I cannot, for the life of me, figure out how to put a HashMap of Serializable Objects into JNDI (of WAS) so that other applications can grab them and use them. Every tutorial I see seems to want you to pass around the Context instance that I use in the original app to put the Objects in JNDI which seems kind of crazy to me. Am I completely missing something?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryan,
Welcome to JavaRanch!

You are correct that you don't need to pass around the initial context. If you were doing that, you might as well pass around the object itself!

If you look up the initial context with the same parameters, you will get a reference to an equivalent object. It is equivalent in that it lets you connect to the same JNDI.
 
Ryan Quinn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne

Thanks! You know, I thought the same thing; why not just pass around the objects at that point? Anyway, I figured out the problem. It was so simple, I'm almost ashamed of myself ;-)! I simply tried to create the subcontexts all at once rather than one at a time. So, "service/codeset/cache" instead of "service", then "service/codeset", etc... Oh well!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting the solution so that others who see this thread in the future can benefit.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic