Resource available but DataSource is null
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Cyber_Girl
Posted On:   Tuesday, July 9, 2002 07:48 AM

Ok, I'm using Tomcat 4.0.3, and am trying to access a JDBC datasource via JNDI. For some reason, DataSource is OK when I'm using StandAlone Tomcat (at locahost:8080), but for using Tomcat-Apache, my DataSource is NULL (at localhost:10070 - that's my port for Apache). I used the following code to print out my binding Context: NamingEnumeration enum = envCtx.list("jdbc/"); while (enum.hasMore()) System.out.println(" --> "+enum.next()); My out put is: --> Mydatabase: org.apache.naming.ResourceRef Which means that JNDI is working and the resource is available; why then is DataSource coming back as null? Please help!!    More>>

Ok, I'm using Tomcat 4.0.3, and am trying to access a JDBC datasource via JNDI. For some reason, DataSource is OK when I'm using StandAlone Tomcat (at locahost:8080), but for using Tomcat-Apache, my DataSource is NULL (at localhost:10070 - that's my port for Apache). I used the following code to print out my binding Context:
NamingEnumeration enum = envCtx.list("jdbc/");
while (enum.hasMore())
System.out.println(" --> "+enum.next());

My out put is:
--> Mydatabase: org.apache.naming.ResourceRef

Which means that JNDI is working and the resource is available; why then is DataSource coming back as null?
Please help!!

   <<Less

Re: Resource available but DataSource is null

Posted By:   Cyber_Girl  
Posted On:   Wednesday, July 10, 2002 07:32 AM

OK -- Let me answer my own questions:

JDBC pooling is unavailable while using Warp-Connector!

This is a known bug (see http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg30157.html)


Reason: The context for web application is not resolved when it passes thru the WarpConnector, resulting in a newly
created context which defaults to null --> therefore DataSource is always null.


Solution: Someone suggested I take out the "/" in

--- but that didn't do the trick for me.

Also, make sure to put your tags inside your Tomcat-Apache's tag as well.
About | Sitemap | Contact