Hi,

I have been developing an application that does a JNDI lookup for a
DataSource and then does a database query. Everything works great when I
just use Tomcat 4.0.1. But when I use Apache as the front end and use the
Warp Connector to connect Apache and Tomcat, I am then unable to retrieve
the DataSource from the JNDI tree.

I receive the exception: javax.naming.NameNotFoundException: Name testDB is
not bound in this Context

I did some digging and found that there is the same problem with the Tomcat
example: /examples/servlet/JndiServlet

This is what I receive when running the example using only Tomcat on port
8080:
(http://localhost:8080/examples/servlet/JndiServlet)

Simple lookup test :
Max exemptions value : 15
list() on /comp/env Context :
Binding : mail: org.apache.naming.NamingContext
Binding : maxExemptions: java.lang.Integer
Binding : minExemptions: java.lang.Integer
Binding : jdbc: org.apache.naming.NamingContext
Binding : ejb: org.apache.naming.NamingContext
Binding : name3: java.lang.Integer
Binding : foo: org.apache.naming.NamingContext
listBindings() on /comp/env Context :
Binding : mail:
org.apache.naming.NamingContext:org.apache.naming.NamingContext@7a1bb6
Binding : maxExemptions: java.lang.Integer:15
Binding : minExemptions: java.lang.Integer:1
Binding : jdbc:
org.apache.naming.NamingContext:org.apache.naming.NamingContext@315d34
Binding : ejb:
org.apache.naming.NamingContext:org.apache.naming.NamingContext@5e256f
Binding : name3: java.lang.Integer:1
Binding : foo:
org.apache.naming.NamingContext:org.apache.naming.NamingContext@6bd8ea


But when I connect Apache and Tomcat using the Warp Connector I receive:
(http://localhost/examples/servlet/JndiServlet)

JNDI lookup failed : javax.naming.NameNotFoundException: Name maxExemptions
is not bound in this Context
list() on /comp/env Context :
Binding : mail: org.apache.naming.NamingContext
Binding : minExemptions: java.lang.Integer
Binding : ejb: org.apache.naming.NamingContext
Binding : name3: java.lang.Integer
Binding : foo: org.apache.naming.NamingContext
listBindings() on /comp/env Context :
Binding : mail:
org.apache.naming.NamingContext:org.apache.naming.NamingContext@2da3d
Binding : minExemptions: java.lang.Integer:1
Binding : ejb:
org.apache.naming.NamingContext:org.apache.naming.NamingContext@45f743
Binding : name3: java.lang.Integer:1
Binding : foo:
org.apache.naming.NamingContext:org.apache.naming.NamingContext@6c8909


I have tested this on Apache 1.3.20, Apache 1.3.22, Tomcat 4.0, Tomcat 4.0.1
and Tomcat 4.1-dev (nightly build).

Has anyone come across this problem before, or know how to correct this?

Justin.

Reply via email to