On Tue, 3 Apr 2001, Nathan Coast wrote:

> Hi,
> 
> I'm getting thoroughly confused as to what is going on with the naming lookups 
> in the Java Pet Store example.  There seems to be a solution here: 
> http://www.jboss.org/manual/examples.html#petstore6
> 
> QUOTE:
> The default JNDI lookups (in com.sun.estore.util.EJBUtil) assume that the JNDI 
> names for beans will be the same regardless of whether the caller is a JSP or 
> EJB. This is not the case for JBoss and Tomcat - the EJB lookups are the same 
> (for example, java:comp/env/ejb/catalog), but the JSP lookups are different (for 
> example, TheCatalog).
> 
> Why is this?  Why should different J2EE servers (RI and JBoss)behave differently 
> WRT the names that are registered with JNDI?
Why _shouldn't_ they?

> 
> In Suns RI, the lookup is for something like "java:comp/env/jdbc/EstoreDataSource"
> but in JBoss it is for "EstoreDB" -
Really this is cheating - looking it up by the globally bound name, rather
than the mapped name. Because web.xml isn't parsed and the JNDI context
isn't customized for web components, this is the only way to do this in
the JBoss/Tomcat combo.

> 
> It'd be great if someone can explain why the two servers ended up being 
> configured differently.
> 
> Also, where does JBOSS / Tomcat get the jndi registrations from? Are they taken 
> from jboss-web.xml?

Bing! there's the answer you're looking for! No they're not (at the
moment). They should be. The basic difference is that the J2EE RI is a
single commercial product, whereas JBoss/Tomcat is two separate products
that have been integrated. In the JBoss/Tomcat combo, the JNDI
implementation that a JSP gets is JBoss', and since noone has (yet) taken
the time to write bits in (hmm. the deployer?) to munge through web.xml
and set up a JNDI context for the web apps, and make sure that that
context gets suspended when an EJB call is made (which would probably
work, since it must be done for an EJB to EJB call), it doesn't work
yet. Somebody will get to it some time, but this isn't as sexy as, say,
"Why _does_ that take so long?" 8^})



_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to