tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject RE: Name jdbc is not bound in this Context
Date Thu, 09 Sep 2004 14:24:27 GMT
i agree, when I define my 5 JNDI datasources within

  /conf/Catalina/localhost/webapp.xml

on startup of tomcat I get a bunch of error messages saying JDBC is not bound for all my resources.


I have a servlet context listener that configures a bunch of manager objects each of which
attempts to init its private datasource via JNDI resolution. It appears to me that Tomcat
is not ready with its JNDI resources yet and manages to call the servlet context listener
before JNDI is bound.

after these errors, Tomcat appears to initialise my webapp again, and this time the JNDI resources
are available and my app works.

odd.

> -----Original Message-----
> From: Kelly C. Goedert [mailto:kelly.goedert@nexxera.com]
> Sent: 09 September 2004 15:09
> To: Tomcat Users List
> Subject: Re: Name jdbc is not bound in this Context
> 
> 
> I fixed this on the code and it still didn't work. I put my 
> datasource 
> as a global resource and used <ResourceLink> than the error 
> stoped. But 
> when it is not global it doesn't, I don't know why.
> 
> Kelly.
> 
> 
> Shapira, Yoav wrote:
> 
> >Hi,
> >
> >  
> >
> >>I'm getting this error " Name jdbc is not bound in this 
> Context" on my
> >>application. My tomcat version is 5.0.27.
> >>
> >>The servlet that is causing this error is trying to access 
> a database
> >>with the following code:
> >>
> >>protected IDatabaseConnection getConnection() throws Exception {
> >>
> >>       Context ic = new InitialContext();
> >>       Context ctx = (Context) ic.lookup("java:comp/env");
> >>       DataSource ds = (DataSource) ic.lookup("jdbc/boxes-cactus");
> >>
> >>       con = new DatabaseDataSourceConnection( ds);
> >>
> >>       return con;
> >>    
> >>
> >
> >Sometimes people miss the basic things: how about ctx.lookup 
> instead of
> >ic.lookup on the 2nd call? ;)
> >
> >Yoav
> >
> >
> >
> >This e-mail, including any attachments, is a confidential 
> business communication, and may contain information that is 
> confidential, proprietary and/or privileged.  This e-mail is 
> intended only for the individual(s) to whom it is addressed, 
> and may not be saved, copied, printed, disclosed or used by 
> anyone else.  If you are not the(an) intended recipient, 
> please immediately delete this e-mail from your computer 
> system and notify the sender.  Thank you.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> >  
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message