RE: Database connection problems after redeploying war
Go to this URL: http://jakarta.apache.org/site/mail2.html#Tomcat and click the "Unsubscribe" link and follow the instructions. Peace Tom "Arikawe, Akindele (DeleArikawe)" To <[EMAIL PROTECTED] "Tomcat Users List" rontexaco.com><[EMAIL PROTECTED]> cc 06/14/2004 01:06 AMSubject RE: Database connection problems after redeploying war Please respond to "Tomcat Users List" <[EMAIL PROTECTED] rta.apache.org> Please can you help me. I do I stop receiving emails from this community? It's filling up my mail box rapidly Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 9:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom "Chad Boyd" <[EMAIL PROTECTED] .net> To <[EMAIL PROTECTED]> 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war "Tomcat Users List" <[EMAIL PROTECTED] rta.apache.org> I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous "Cannot create JDBC driver of class '' for connect URL 'null'" error message. When I put the element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 1 removeAbandoned true logAbandoned true username ... password ... driverClassName com.inet.tds.TdsDriver url ... - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection problems after redeploying war
Please can you help me. I do I stop receiving emails from this community? It's filling up my mail box rapidly Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 9:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom "Chad Boyd" <[EMAIL PROTECTED] .net> To <[EMAIL PROTECTED]> 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war "Tomcat Users List" <[EMAIL PROTECTED] rta.apache.org> I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous "Cannot create JDBC driver of class '' for connect URL 'null'" error message. When I put the element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 1 removeAbandoned true logAbandoned true username ... password ... driverClassName com.inet.tds.TdsDriver url ... - 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]
RE: Database connection problems after redeploying war
Just a side note. I couldn't get this to work in Tomcat 5.0.19. I had to upgrade to 5.0.25. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, June 12, 2004 2:27 PM To: [EMAIL PROTECTED] Subject: RE: Database connection problems after redeploying war Sweet! Thanks for the info! Peace Tom "Chad Boyd" <[EMAIL PROTECTED] .net> To "Tomcat Users List" 06/12/2004 12:14 <[EMAIL PROTECTED]> PM cc Subject Please respond to RE: Database connection problems "Tomcat Users after redeploying war List" <[EMAIL PROTECTED] rta.apache.org> OK, finally figured it out. I moved the elements that contained the connection pools into the element in server.xml. I then created the context.xml file that contained elements that pointed to the ones defined in the global section mentioned before. I had tried this before with no luck, but I figured out why this didn't work before. When deploying the war via the manager app, I was specifying the path parameter in the URL. I guess in doing this the context.xml file was ignored during deployment. I can now redeploy the war without having to restart Tomcat. -Original Message- From: Chad Boyd Sent: Friday, June 11, 2004 10:01 PM To: Tomcat Users List Subject: RE: Database connection problems after redeploying war How about the original question. It seems we got off subject here. Can someone please read the original post and see if you have a solution. Thanks. -Original Message- From: Joyce Li [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 4:38 PM To: 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: >I also have 1 problem related the database connection which needs help. >I used to have the infamous No suitable driver error, but after I >corrected my connect string by adding schema into it (defined in >context.html), it works for me: > > > url > jdbc:oracle:thin:@:: > > > After this, Tomcat has no problem to locate the driver, and I got a >valid DataSource back via JNDI lookup. However, when I tried to use >DataSource to getConnection, I got the following error: (part of the >stack trace) > >init exception: java.lang.NullPointerException >java.lang.NullPointerException > at >org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti >on.java:195) > at >org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec >tion.java:129) > at >org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola >bleConnectionFactory.java:311) > at >org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas >icDataSource.java:842) > at >org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou >rce.java:821) > at >org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource >.java:532) > > I have no idea where the Null Pointer Exception came from, and the >DataSource I got back from server is not null either. I posted this >problem before but no one answered. Now I write a class just to load >the driver and get the database pool by myself, and it works! But I >still want to have the database pooling functionalities be handled by >Tomcat, and I really want to know what goes wrong after all! Just hope >to post this problem to this thread can get some feedback! Thanks in >advance for any input! > > > > > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] >Sent: Frid
RE: Database connection problems after redeploying war
Sweet! Thanks for the info! Peace Tom "Chad Boyd" <[EMAIL PROTECTED] .net> To "Tomcat Users List" 06/12/2004 12:14 <[EMAIL PROTECTED]> PM cc Subject Please respond to RE: Database connection problems "Tomcat Users after redeploying war List" <[EMAIL PROTECTED] rta.apache.org> OK, finally figured it out. I moved the elements that contained the connection pools into the element in server.xml. I then created the context.xml file that contained elements that pointed to the ones defined in the global section mentioned before. I had tried this before with no luck, but I figured out why this didn't work before. When deploying the war via the manager app, I was specifying the path parameter in the URL. I guess in doing this the context.xml file was ignored during deployment. I can now redeploy the war without having to restart Tomcat. -Original Message- From: Chad Boyd Sent: Friday, June 11, 2004 10:01 PM To: Tomcat Users List Subject: RE: Database connection problems after redeploying war How about the original question. It seems we got off subject here. Can someone please read the original post and see if you have a solution. Thanks. -Original Message- From: Joyce Li [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 4:38 PM To: 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: >I also have 1 problem related the database connection which needs help. >I used to have the infamous No suitable driver error, but after I >corrected my connect string by adding schema into it (defined in >context.html), it works for me: > > > url > jdbc:oracle:thin:@:: > > > After this, Tomcat has no problem to locate the driver, and I got a >valid DataSource back via JNDI lookup. However, when I tried to use >DataSource to getConnection, I got the following error: (part of the >stack trace) > >init exception: java.lang.NullPointerException >java.lang.NullPointerException > at >org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti >on.java:195) > at >org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec >tion.java:129) > at >org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola >bleConnectionFactory.java:311) > at >org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas >icDataSource.java:842) > at >org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou >rce.java:821) > at >org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource >.java:532) > > I have no idea where the Null Pointer Exception came from, and the >DataSource I got back from server is not null either. I posted this >problem befor
RE: Database connection problems after redeploying war
OK, finally figured it out. I moved the elements that contained the connection pools into the element in server.xml. I then created the context.xml file that contained elements that pointed to the ones defined in the global section mentioned before. I had tried this before with no luck, but I figured out why this didn't work before. When deploying the war via the manager app, I was specifying the path parameter in the URL. I guess in doing this the context.xml file was ignored during deployment. I can now redeploy the war without having to restart Tomcat. -Original Message- From: Chad Boyd Sent: Friday, June 11, 2004 10:01 PM To: Tomcat Users List Subject: RE: Database connection problems after redeploying war How about the original question. It seems we got off subject here. Can someone please read the original post and see if you have a solution. Thanks. -Original Message- From: Joyce Li [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 4:38 PM To: 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: >I also have 1 problem related the database connection which needs help. >I used to have the infamous No suitable driver error, but after I >corrected my connect string by adding schema into it (defined in >context.html), it works for me: > > > url > jdbc:oracle:thin:@:: > > > After this, Tomcat has no problem to locate the driver, and I got a >valid DataSource back via JNDI lookup. However, when I tried to use >DataSource to getConnection, I got the following error: (part of the >stack trace) > >init exception: java.lang.NullPointerException >java.lang.NullPointerException > at >org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti >on.java:195) > at >org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec >tion.java:129) > at >org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola >bleConnectionFactory.java:311) > at >org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas >icDataSource.java:842) > at >org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou >rce.java:821) > at >org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource >.java:532) > > I have no idea where the Null Pointer Exception came from, and the >DataSource I got back from server is not null either. I posted this >problem before but no one answered. Now I write a class just to load >the driver and get the database pool by myself, and it works! But I >still want to have the database pooling functionalities be handled by >Tomcat, and I really want to know what goes wrong after all! Just hope >to post this problem to this thread can get some feedback! Thanks in >advance for any input! > > > > > >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] >Sent: Friday, June 11, 2004 1:28 PM >To: [EMAIL PROTECTED] >Subject: Re: Database connection problems after redeploying war > > > > > > >We've got the exact same issue in our environment at all. Every time >we >define a datasource, we have to restart Tomcat so that datasource can be >accessed. Additionally, when using a traditional web server frontend, >like >Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server >so >the mod_jk connector will restart and be able to use the datasources >available to the restarted Tomcat. We were hoping using a web server >frontend with a mod_jk(2) connector would not require bouncing the web >server each time we bounced Tomcat but that's just not the case. :( > >Any ideas for solving this would be greatly appreciated. > >Peace
RE: Database connection problems after redeploying war
How about the original question. It seems we got off subject here. Can someone please read the original post and see if you have a solution. Thanks. -Original Message- From: Joyce Li [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 4:38 PM To: 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: >I also have 1 problem related the database connection which needs help. >I used to have the infamous No suitable driver error, but after I >corrected my connect string by adding schema into it (defined in >context.html), it works for me: > > > url > jdbc:oracle:thin:@:: > > > After this, Tomcat has no problem to locate the driver, and I got a >valid DataSource back via JNDI lookup. However, when I tried to use >DataSource to getConnection, I got the following error: (part of the >stack trace) > >init exception: java.lang.NullPointerException >java.lang.NullPointerException > at >org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti >on.java:195) > at >org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec >tion.java:129) > at >org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola >bleConnectionFactory.java:311) > at >org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas >icDataSource.java:842) > at >org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou >rce.java:821) > at >org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource >.java:532) > > I have no idea where the Null Pointer Exception came from, and the >DataSource I got back from server is not null either. I posted this >problem before but no one answered. Now I write a class just to load >the driver and get the database pool by myself, and it works! But I >still want to have the database pooling functionalities be handled by >Tomcat, and I really want to know what goes wrong after all! Just hope >to post this problem to this thread can get some feedback! Thanks in >advance for any input! > > > > > >-----Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] >Sent: Friday, June 11, 2004 1:28 PM >To: [EMAIL PROTECTED] >Subject: Re: Database connection problems after redeploying war > > > > > > >We've got the exact same issue in our environment at all. Every time >we >define a datasource, we have to restart Tomcat so that datasource can be >accessed. Additionally, when using a traditional web server frontend, >like >Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server >so >the mod_jk connector will restart and be able to use the datasources >available to the restarted Tomcat. We were hoping using a web server >frontend with a mod_jk(2) connector would not require bouncing the web >server each time we bounced Tomcat but that's just not the case. :( > >Any ideas for solving this would be greatly appreciated. > >Peace... > >Tom > > > > > > "Chad Boyd" > > <[EMAIL PROTECTED] > > .net> >To > <[EMAIL PROTECTED]> > > 06/11/2004 12:38 >cc > PM > > >Subject >Database connection problems >after > Please respond to redeploying war > >"Tomcat Users > >List" > > <[EMAIL PROTECTED] > > rta.apache.org> > > > > > > > > > >I'm having trouble accessing a database connection after war >redeployment. I've read the docum
RE: Database connection problems after redeploying war
Hans, Thanks very much for your reply. I think it might still be related, because the null pointer exception I got is from DelegatingConnection.close(). However, I never thought it's bugs of dbcp or Oracle driver, since if I setup the datasource manually (following the example code in DBCP website), I have no problem to get database connection. I couldn't figure out why when Tomcat initiated the action of configuring the dbcp resource, it will fail. Anyway, thanks again for your input. It's encouraging to know someone else also works on the similar problem. Thanks again! -Original Message- From: Hans [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 2:29 PM To: Tomcat Users List; 'Tomcat Users List' Subject: RE: Database connection problems after redeploying war Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: >I also have 1 problem related the database connection which needs help. >I used to have the infamous No suitable driver error, but after I >corrected my connect string by adding schema into it (defined in >context.html), it works for me: > > > url > jdbc:oracle:thin:@:: > > > After this, Tomcat has no problem to locate the driver, and I got a >valid DataSource back via JNDI lookup. However, when I tried to use >DataSource to getConnection, I got the following error: (part of the >stack trace) > >init exception: java.lang.NullPointerException >java.lang.NullPointerException > at >org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti >on.java:195) > at >org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec >tion.java:129) > at >org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola >bleConnectionFactory.java:311) > at >org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas >icDataSource.java:842) > at >org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou >rce.java:821) > at >org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource >.java:532) > > I have no idea where the Null Pointer Exception came from, and the >DataSource I got back from server is not null either. I posted this >problem before but no one answered. Now I write a class just to load >the driver and get the database pool by myself, and it works! But I >still want to have the database pooling functionalities be handled by >Tomcat, and I really want to know what goes wrong after all! Just hope >to post this problem to this thread can get some feedback! Thanks in >advance for any input! > > > > > >-Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] >Sent: Friday, June 11, 2004 1:28 PM >To: [EMAIL PROTECTED] >Subject: Re: Database connection problems after redeploying war > > > > > > >We've got the exact same issue in our environment at all. Every time >we >define a datasource, we have to restart Tomcat so that datasource can be >accessed. Additionally, when using a traditional web server frontend, >like >Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server >so >the mod_jk connector will restart and be able to use the datasources >available to the restarted Tomcat. We were hoping using a web server >frontend with a mod_jk(2) connector would not require bouncing the web >server each time we bounced Tomcat but that's just not the case. :( > >Any ideas for solving this would be greatly appreciated. > >Peace... > >Tom > > > > > > "Chad Boyd" > > <[EMAIL PROTECTED] > > .net> >To > <[EMAIL PROTECTED]> > > 06/11/2004 12:38 >cc > PM > > >Subject >Database connection problems >after > Please respond to redeploying war > >"Tomcat Users > >List" > > <[EMAIL PROTECTED] > > rta.apache.org> > > > > > > > > > >I'm having trouble accessing a database connection after war >redeployment. I've read the documentation several times and went >through suggestions posted in the mailing lists, but nothing has worked. >I prefer the approach of having the context.xml file in the META-INF >directory in the war itself. When I try this, I get the infamous >"Cannot create JDBC driver of class '' for connect URL 'null'" error &g
RE: Database connection problems after redeploying war
Oops! Misread the stacktrace I am afraid my previous mail does not apply to your problem... sorry ... hmm perhaps I should go get some sleep At 14:09 11/06/2004 -0700, Joyce Li wrote: I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: url jdbc:oracle:thin:@:: After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database pooling functionalities be handled by Tomcat, and I really want to know what goes wrong after all! Just hope to post this problem to this thread can get some feedback! Thanks in advance for any input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom "Chad Boyd" <[EMAIL PROTECTED] .net> To <[EMAIL PROTECTED]> 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war "Tomcat Users List" <[EMAIL PROTECTED] rta.apache.org> I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous "Cannot create JDBC driver of class '' for connect URL 'null'" error message. When I put the element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 1 removeAbandoned true logAbandoned true username ... password ... driverClassName com.inet.tds.TdsDriver url ... - 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] ---
RE: Database connection problems after redeploying war
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom "Chad Boyd" <[EMAIL PROTECTED] .net> To <[EMAIL PROTECTED]> 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war "Tomcat Users List" <[EMAIL PROTECTED] rta.apache.org> I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous "Cannot create JDBC driver of class '' for connect URL 'null'" error message. When I put the element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 1 removeAbandoned true logAbandoned true username ... password ... driverClassName com.inet.tds.TdsDriver url ... - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database connection problems after redeploying war
I also have 1 problem related the database connection which needs help. I used to have the infamous No suitable driver error, but after I corrected my connect string by adding schema into it (defined in context.html), it works for me: url jdbc:oracle:thin:@:: After this, Tomcat has no problem to locate the driver, and I got a valid DataSource back via JNDI lookup. However, when I tried to use DataSource to getConnection, I got the following error: (part of the stack trace) init exception: java.lang.NullPointerException java.lang.NullPointerException at org.apache.commons.dbcp.DelegatingConnection.close(DelegatingConnecti on.java:195) at org.apache.commons.dbcp.PoolableConnection.reallyClose(PoolableConnec tion.java:129) at org.apache.commons.dbcp.PoolableConnectionFactory.destroyObject(Poola bleConnectionFactory.java:311) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(Bas icDataSource.java:842) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSou rce.java:821) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource .java:532) I have no idea where the Null Pointer Exception came from, and the DataSource I got back from server is not null either. I posted this problem before but no one answered. Now I write a class just to load the driver and get the database pool by myself, and it works! But I still want to have the database pooling functionalities be handled by Tomcat, and I really want to know what goes wrong after all! Just hope to post this problem to this thread can get some feedback! Thanks in advance for any input! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 1:28 PM To: [EMAIL PROTECTED] Subject: Re: Database connection problems after redeploying war We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom "Chad Boyd" <[EMAIL PROTECTED] .net> To <[EMAIL PROTECTED]> 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war "Tomcat Users List" <[EMAIL PROTECTED] rta.apache.org> I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous "Cannot create JDBC driver of class '' for connect URL 'null'" error message. When I put the element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 1 removeAbandoned true logAbandoned true username ... password ... driverClassName com.inet.tds.TdsDriver url ... - 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]
Re: Database connection problems after redeploying war
We've got the exact same issue in our environment at all. Every time we define a datasource, we have to restart Tomcat so that datasource can be accessed. Additionally, when using a traditional web server frontend, like Apache or IIS, with mod_jk or mod_jk2, we have to restart the web server so the mod_jk connector will restart and be able to use the datasources available to the restarted Tomcat. We were hoping using a web server frontend with a mod_jk(2) connector would not require bouncing the web server each time we bounced Tomcat but that's just not the case. :( Any ideas for solving this would be greatly appreciated. Peace... Tom "Chad Boyd" <[EMAIL PROTECTED] .net> To <[EMAIL PROTECTED]> 06/11/2004 12:38 cc PM Subject Database connection problems after Please respond to redeploying war "Tomcat Users List" <[EMAIL PROTECTED] rta.apache.org> I'm having trouble accessing a database connection after war redeployment. I've read the documentation several times and went through suggestions posted in the mailing lists, but nothing has worked. I prefer the approach of having the context.xml file in the META-INF directory in the war itself. When I try this, I get the infamous "Cannot create JDBC driver of class '' for connect URL 'null'" error message. When I put the element back into the server.xml file, everything is fine, except for the fact that I can't redeploy the war file without restarting Tomcat. This is very frustrating and time-consuming. Does anyone know why the context.xml file is not working for me? I've included the contents of this file below. I'm using Tomcat 5.0.19. Thanks in advance. Chad factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 100 maxIdle 30 maxWait 1 removeAbandoned true logAbandoned true username ... password ... driverClassName com.inet.tds.TdsDriver url ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]