wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Putting Objects in JNDI in WAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Putting Objects in JNDI in WAS" Watch "Putting Objects in JNDI in WAS" New topic
Author

Putting Objects in JNDI in WAS

Ryan Quinn
Greenhorn

Joined: Apr 04, 2007
Posts: 2
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

Joined: May 26, 2003
Posts: 30938
    
158

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ryan Quinn
Greenhorn

Joined: Apr 04, 2007
Posts: 2
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

Joined: May 26, 2003
Posts: 30938
    
158

Thanks for posting the solution so that others who see this thread in the future can benefit.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Putting Objects in JNDI in WAS