RE: Multiple webapps talking to same DB

2003-11-06 Thread Edson Alves Pereira
If you want to create a default database for all web-apps ( i don´t
known if you want the same database´s user also ), you should add a JNDI
datasource in GlobalNamingResources, try to use tomcat´s manager. Remeber,
you must put your JDBC driver in common/lib also, because tomcat need it to
create the datasource, but in your case, maybe you did try a simple
connection and forgot to put JDBC driver in shared/lib or WEB-INF/lib.

 --
 De:   [EMAIL PROTECTED]:[EMAIL PROTECTED]
 Responder:Tomcat Users List
 Enviada:  quinta-feira, 6 de novembro de 2003 10:22
 Para: [EMAIL PROTECTED]
 Assunto:  Multiple webapps talking to same DB
 
 Version of Tomcat - 4.1.24
 OS - WinXP (development workstation)
 DB - MySQL 4.0.13
 
 I currently have a single webapp (test1) that can connect to the database
 and
 perform DB operations just fine. This uses JSP, Servlets and JDBC.
 What I want to do is have other webapps connect to the same database. Here
 is
 what I did:
 1. I copied my existing webapp, tomcat_home\webapps\test1 and created
 tomcat_home\webapps\test2.
 2. I restarted tomcat and when invoking the test2 webapp, I get the
 following
 error: java.sql.SQLException: Cannot load JDBC driver class 'null'
 This error happens when I call the getConnection() method on the
 DataSource
 object.
 
 I believe I don't have the correct configuration in the server.xml for the
 webapp, test2. I tried several different ways to try and get this to work,
 but
 those have
 failed so far.
 
 So, when making a straight copy of one webapp like I did above, what would
 need
 to change in the server.xml (in the MySQL section) to get this to work?
 Or, would the culprit be some other configuration?
 
 Thanks for any help on this,
 Kevin
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


RE: Multiple webapps talking to same DB

2003-11-06 Thread KKolle

Thanks for the tips.
Actually, I added another context (context) to the tomcat_home
\conf\server.xml, which specifies the database parameters and I'm good to go.
Didn't help that I was also working with the wrong server.xml file.


   
   
  Edson Alves Pereira  
   
  [EMAIL PROTECTED]To:   'Tomcat Users List' [EMAIL 
PROTECTED]  
  ano.com.br cc:  
   
  Subject:  RE: Multiple webapps 
talking to same DB   
  11/06/2003 11:32 AM  
   
  Please respond to
   
  Tomcat Users List  
   
   
   
   
   




 If you want to create a default database for all web-apps ( i don´t
known if you want the same database´s user also ), you should add a JNDI
datasource in GlobalNamingResources, try to use tomcat´s manager. Remeber,
you must put your JDBC driver in common/lib also, because tomcat need it to
create the datasource, but in your case, maybe you did try a simple
connection and forgot to put JDBC driver in shared/lib or WEB-INF/lib.

 --
 De:  [EMAIL PROTECTED]:[EMAIL PROTECTED]
 Responder: Tomcat Users List
 Enviada: quinta-feira, 6 de novembro de 2003 10:22
 Para:[EMAIL PROTECTED]
 Assunto: Multiple webapps talking to same DB

 Version of Tomcat - 4.1.24
 OS - WinXP (development workstation)
 DB - MySQL 4.0.13

 I currently have a single webapp (test1) that can connect to the database
 and
 perform DB operations just fine. This uses JSP, Servlets and JDBC.
 What I want to do is have other webapps connect to the same database. Here
 is
 what I did:
 1. I copied my existing webapp, tomcat_home\webapps\test1 and created
 tomcat_home\webapps\test2.
 2. I restarted tomcat and when invoking the test2 webapp, I get the
 following
 error: java.sql.SQLException: Cannot load JDBC driver class 'null'
 This error happens when I call the getConnection() method on the
 DataSource
 object.

 I believe I don't have the correct configuration in the server.xml for the
 webapp, test2. I tried several different ways to try and get this to work,
 but
 those have
 failed so far.

 So, when making a straight copy of one webapp like I did above, what would
 need
 to change in the server.xml (in the MySQL section) to get this to work?
 Or, would the culprit be some other configuration?

 Thanks for any help on this,
 Kevin



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]