You should be able to set it up in a <DefaultContext ...> element or you can use <GlobalNamingResources ...> and then in your context use a <ResourceLink>.

The Tomcat docs for 4.1 talk all about this.

Jake

At 06:48 PM 10/29/2002 -0800, you wrote:
AHAAA!

I figured it out ... well ... sort of.

My primary content is www.hotel.us.  But, I also configured hotel.us,
hotel.us.com, etc to all point to www.hotel.us.  It turns out that the times
I was getting the JDBC not bound to Context error, were the times I was
going to the alternat domains, not www.hotel.us!

Ok, so that is the issue!  Pheew!  BUT, here's another question.  Must I
configure DBCP in every single one of those other hosts?  I was hoping I
could jsut switch crossContext=true on the Context containing the correct
setup. Perhaps for this to work the contexts must all be nested within the
same host? But to have different urls resolve the only way I know to do it,
is via a seperate host node, per domain:

      <Host name="hotel.us" appBase="webapps/hotel">
          <Context path="" docBase="" debug="5"/>
      </Host>

Any thoughts?

Thanks everyone for your help!!!!

Neal


-----Original Message-----
From: neal [mailto:nealcabage@;yahoo.com]
Sent: Tuesday, October 29, 2002 6:21 PM
To: Tomcat Users List
Subject: RE: DBCP Woes!


That sounds likely, but unfortunately I'm not familiar enough with JNDI to
really know how to do that.

But, let's say that this is the problem.  What would the solution be?  Other
than the server.xml parameters I've specified, how does one bind a
Datasource to a Context? And, can you think of any reasons why that would
have been working 10 hours ago, but isn't now?  I didn't even alter the
server.xml file until *after* this became an issue.


Thanks.
Neal


-----Original Message-----
From: micael [mailto:caraunltd@;harbornet.com]
Sent: Tuesday, October 29, 2002 5:09 PM
To: Tomcat Users List
Subject: RE: DBCP Woes!


Write a class to see whether or not jdbc is bound in the context.  It
probably isn't.

At 05:15 PM 10/29/2002 -0800, you wrote:
>My setup?  I'm using MySQL 3.23 and the latest version of (don't recall the
>number) Connector/J for my driver.  This is of course all sitting inside
>tomcat 4.0.4.  I have manually installed the DBCP, collections and whatever
>other support classes I needed for DBCP.
>
>I have configured DBCP via my server.xml file as such (below).  When I was
>recieving the error from (org.hsql) that was because I was also attempting
>to creating a reference to the resource within my web.xml file.  I have
>since removed it and that error has ceased.  The error I am currently
>experiencing (javax.naming.NameNotFoundException: Name jdbc is not bound in
>this Context) was happening last night.  *Seemed* to spontaneously got
away,
>then this morning I loaded a few classes and rebooted and it started again.
>I have since removed those classes but the error is persisting.
>
>Its worth noting that I can still obtain connections directly through JDBC,
>without the use of DBCP, no problem.
>
>Please let me know if you can think of anything!!!!
>
>Thanks!
>Neal
>
>
><Context path="" docBase="" debug="5">
>
>           <Logger className="org.apache.catalina.logger.FileLogger"
>                 directory="logs"  prefix="dbcp_" suffix=".log"
> timestamp="true" />
>
>           <Resource name="jdbc/hotel" auth="Container"
> type="javax.sql.DataSource"
>/>
>           <ResourceParams name="jdbc/hotel">
>             <parameter>
>               <name>factory</name>
>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>             </parameter>
>             <parameter>
>               <name>maxActive</name>
>               <value>100</value>
>             </parameter>
>             <parameter>
>               <name>maxIdle</name>
>               <value>30000</value>
>             </parameter>
>             <parameter>
>               <name>maxWait</name>
>               <value>100</value>
>             </parameter>
>             <parameter>
>              <name>username</name>
>              <value>xxxxx</value>
>             </parameter>
>             <parameter>
>              <name>password</name>
>              <value>xxxxx</value>
>             </parameter>
>             <parameter>
>                <name>driverClassName</name>
>                <value>com.mysql.jdbc.Driver</value>
>             </parameter>
>             <parameter>
>               <name>url</name>
>               <value>jdbc:mysql:///hotel</value>
>             </parameter>
><!--
>             <parameter>
>                 <name>removeAbandoned</name>
>                 <value>true</value>
>             </parameter>
>             <parameter>
>                 <name>removeAbandonedTimeout</name>
>                 <value>30</value>
>             </parameter>
>             <parameter>
>                 <name>logAbandoned</name>
>                 <value>true</value>
>             </parameter>
>-->
>           </ResourceParams>
>
>         </Context>
>
>-----Original Message-----
>From: micael [mailto:caraunltd@;harbornet.com]
>Sent: Tuesday, October 29, 2002 4:06 PM
>To: Tomcat Users List
>Subject: RE: DBCP Woes!
>
>
>I don't know your setup at all, neal, but this is a hypersonic database
>reference.  What is your setup?
>
>At 04:31 PM 10/29/2002 -0800, you wrote:
> >I considered poolman but it doesn't look like its supported or even
> >available from the website to download anymore.  Is this the case?  I
have
> >heard good things about it.
> >
> >Don't suppose you understand this JDBC conext binding error, do you?
> >
> >Thanks.
> >Neal
> >
> >
> >-----Original Message-----
> >From: Mike Jackson [mailto:mjackson@;cdi-hq.com]
> >Sent: Tuesday, October 29, 2002 3:25 PM
> >To: Tomcat Users List
> >Subject: RE: DBCP Woes!
> >
> >
> >Poolman works nicely, I have little to no problems with it.  Then again
> >I haven't used DBCP.  But you'd still have had the exhasted connections
> >problem with poolman.
> >
> >--mikej
> >-=-----
> >mike jackson
> >[EMAIL PROTECTED]
> >
> > > -----Original Message-----
> > > From: neal [mailto:nealcabage@;yahoo.com]
> > > Sent: Tuesday, October 29, 2002 4:22 PM
> > > To: Tomcat Users List
> > > Subject: RE: DBCP Woes!
> > >
> > >
> > > Now I have some other strange error related to accessing my
> > > database.  Ever
> > > since I started messing with thsi stuff my conneciton to my dB has
been
> > > flakey at best.  Sometimes it works ... sometimes it doesn't.
> > >
> > > javax.naming.NamingException: Exception creating DataSource:
> > > org.hsql.jdbcDriver
> > >
> > > I don't even know where this class is defined or called!!!
> > >
> > > >:(
> > >
> > > Neal
> > >
> > >
> > >
> > >
> > > Still having DBCP problems.
> > >
> > > I ensured that all my connections, statements, and resulset objects
> > > are being properly released when using DBCP for connection pooling.
I've
> > > enabled recoverAbandoned. It seems that yes I did have some
> > > connection pool
> > > leaking,
> > > but that has since been resolved.  But I still get this message
> > > (along with
> > > a
> > > failure) from time to time.  Does anyone know why?
> > >
> > > javax.naming.NameNotFoundException: Name jdbc is not bound in this
>Context
> > >
> > > This is a different message than I was getting when I was having
>problems
> > > with the DBCP pool being exhausted.
> > >
> > > Thanks!
> > > Neal
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:tomcat-user-help@;jakarta.apache.org>
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> ><mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> >For additional commands, e-mail:
> ><mailto:tomcat-user-help@;jakarta.apache.org>
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> >For additional commands, e-mail:
> ><mailto:tomcat-user-help@;jakarta.apache.org>
> >
> >
> >--
> >To unsubscribe, e-mail:
><mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> >For additional commands, e-mail:
><mailto:tomcat-user-help@;jakarta.apache.org>
>
>Micael
>
>-------------------------------------------------------
>
>This electronic mail  transmission and any accompanying documents contain
>information belonging to the sender which may be confidential and legally
>privileged.  This information is intended only for the use of the
>individual or entity to whom this electronic mail transmission was sent as
>indicated above. If you are not the intended recipient, any disclosure,
>copying, distribution, or action taken in reliance on the contents of the
>information contained in this transmission is strictly prohibited.  If you
>have received this transmission in error, please delete the message.  Thank
>you
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
>For additional commands, e-mail:
><mailto:tomcat-user-help@;jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
>For additional commands, e-mail:
<mailto:tomcat-user-help@;jakarta.apache.org>

Micael

-------------------------------------------------------

This electronic mail  transmission and any accompanying documents contain
information belonging to the sender which may be confidential and legally
privileged.  This information is intended only for the use of the
individual or entity to whom this electronic mail transmission was sent as
indicated above. If you are not the intended recipient, any disclosure,
copying, distribution, or action taken in reliance on the contents of the
information contained in this transmission is strictly prohibited.  If you
have received this transmission in error, please delete the message.  Thank
you



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


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


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

Reply via email to