Where does the syntax "java:comp/blah come from?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chris_Adams
Posted On:   Monday, March 18, 2002 12:10 PM

I learned EJBs using the String lookup method - Context.lookup(String name) - and am more frequently running into the overloaded twin - lookup(Name name) where name might be (java:comp/blah"). Where does that come from? Is that suppose to be an object already instantiated and located at that location?? How do I register that location on my JNDI service?

Re: Where does the syntax "java:comp/blah come from?

Posted By:   Christopher_Schultz  
Posted On:   Monday, March 18, 2002 12:16 PM

When you're talkin' EJB's, yes. The EJB deployer sets up the names of, say, the RemoteHome interfaces as they wil be accessible through JNDI.



When your server comes up, these objects should already be available to you via JNDI -- you don't have to put them there yourself from within your application.



That isn't to say that you can put anything into JNDI -- just use the rebind method to stuff something into the directory.



Note that if you rebind something on which the EJB server relies (like the RemoteHome interface for a bean), you'll probably seriously screw up the EJB server.



-chris
About | Sitemap | Contact