Re: 6.0.13 MySQL DBCP Example

2007-08-10 Thread David Smith
To make use  a  .. , 
you'll have to put a ResourceLink element in your webapp's context.xml file.


See the end of 
http://tomcat.apache.org/tomcat-6.0-doc/config/globalresources.html for 
more information.



--David



G M wrote:

Thanks!

It worked when I put the  in the context.xml of my webapp
META-INF directory.
However when I tried to put it in the global context.xml it doesn't work.
Tomcat should put this information in his example.

Why it doesn't work in the global context.xml, any ideas?

Here is the context if you need to check it out.










Thank you a lot, is great to have my app up and running!

Gabriel Moreno

2007/8/9, Caldarale, Charles R <[EMAIL PROTECTED]>:
  

From: David Smith [mailto:[EMAIL PROTECTED]
Subject: Re: 6.0.13 MySQL DBCP Example

1. I would merge the  element from server.xml to your
context.xml file and remove the Context element from your
server.xml.
  

Just a point of clarification: the context.xml above refers to the one
in your webapp's META-INF directory, not the global one in Tomcat's conf
directory.

- Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 6.0.13 MySQL DBCP Example

2007-08-09 Thread G M
Thanks!

It worked when I put the  in the context.xml of my webapp
META-INF directory.
However when I tried to put it in the global context.xml it doesn't work.
Tomcat should put this information in his example.

Why it doesn't work in the global context.xml, any ideas?

Here is the context if you need to check it out.










Thank you a lot, is great to have my app up and running!

Gabriel Moreno

2007/8/9, Caldarale, Charles R <[EMAIL PROTECTED]>:
>
> > From: David Smith [mailto:[EMAIL PROTECTED]
> > Subject: Re: 6.0.13 MySQL DBCP Example
> >
> > 1. I would merge the  element from server.xml to your
> > context.xml file and remove the Context element from your
> > server.xml.
>
> Just a point of clarification: the context.xml above refers to the one
> in your webapp's META-INF directory, not the global one in Tomcat's conf
> directory.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


RE: 6.0.13 MySQL DBCP Example

2007-08-09 Thread Caldarale, Charles R
> From: David Smith [mailto:[EMAIL PROTECTED] 
> Subject: Re: 6.0.13 MySQL DBCP Example
> 
> 1. I would merge the  element from server.xml to your 
> context.xml file and remove the Context element from your 
> server.xml.  

Just a point of clarification: the context.xml above refers to the one
in your webapp's META-INF directory, not the global one in Tomcat's conf
directory.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: 6.0.13 MySQL DBCP Example

2007-08-09 Thread David Smith

Ok... tomcat 6.0.13

1. I would merge the  element from server.xml to your 
context.xml file and remove the Context element from your server.xml.  
Placing this element in server.xml is not recommended anymore as it 
means a restart of tomcat to deploy/undeploy webapps.  Also having the 
Context definition in two places for one webapp will undoubtedly cause 
problems with one overriding the other.


2. Trim any spaces in the element attributes.  I saw an extraneous space 
in the driverClassName attribute below.


3. It's not recommended you add autoReconnect=true to the mysql db url.  
It has it's uses, but not in a database pool.  Instead, use a 
validationQuery attribute in your Resource element to test and validate 
connections before your app borrows them.


4. I'm assuming the mysql-connector-java-*.jar file is stored in the 
$CATALINA_HOME/lib folder and not present in your webapp's WEB-INF/lib 
folder.


Let us know what happens.  If it still doesn't work, let us see the new 
context.xml file and be sure there isn't a  element in the 
server.xml.


--David

G M wrote:

I've been trying for days now to establish a jdbc resource for mysql in
tomcat 6.0.13

To whom it may correspond:

I get the following error

Unable to get connection, DataSource invalid:
"org.apache.tomcat.dbcp.dbcp.SQLNestedException
: Cannot create JDBC driver of class '' for connect URL 'null'"


I have the driver mysql-connector-java-5.0.6-bin.jar copied to
$CATALINA_HOME/lib

My application web.xml looks like this: (exactly as the example)

http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd "
version="2.4">
  MySQL Test App
  
  DB Connection
  jdbc/TestDB
  javax.sql.DataSource
  Container
  


In
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.htmlthere
is this instruction:

Add this in between the  tag of the examples context and the
  

 tag closing the localhost definition. If there is no such tag, you
can add one as illustrated in the 
Contextand
Host configuration 
references, and  repeated below for your convenience.




In my own opinion this is quite ambiguous. After several search in the mail
repositories. I have this as my server.xml configuration (i deleted the
comments for easy reading)


  
  
  
  

  

  

  



 

  

  







  

  


In my own opinion the problem is with server.xml, should I add something to
context.xml?
Any comment, hint or tip would be greatly appreciated.

Regards

Gabriel

  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



6.0.13 MySQL DBCP Example

2007-08-08 Thread G M
I've been trying for days now to establish a jdbc resource for mysql in
tomcat 6.0.13

To whom it may correspond:

I get the following error

Unable to get connection, DataSource invalid:
"org.apache.tomcat.dbcp.dbcp.SQLNestedException
: Cannot create JDBC driver of class '' for connect URL 'null'"


I have the driver mysql-connector-java-5.0.6-bin.jar copied to
$CATALINA_HOME/lib

My application web.xml looks like this: (exactly as the example)

http://java.sun.com/xml/ns/j2ee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd "
version="2.4">
  MySQL Test App
  
  DB Connection
  jdbc/TestDB
  javax.sql.DataSource
  Container
  


In
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.htmlthere
is this instruction:

Add this in between the  tag of the examples context and the
>  tag closing the localhost definition. If there is no such tag, you
> can add one as illustrated in the 
> Contextand
> Host configuration 
> references, and  repeated below for your convenience.


In my own opinion this is quite ambiguous. After several search in the mail
repositories. I have this as my server.xml configuration (i deleted the
comments for easy reading)


  
  
  
  

  

  

  



 

  

  







  

  


In my own opinion the problem is with server.xml, should I add something to
context.xml?
Any comment, hint or tip would be greatly appreciated.

Regards

Gabriel