RE: Tomcat Default page
You need to and a Context element to the server.xml file with a zero-length path attribute. Check out http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 11, 2004 6:15 PM To: [EMAIL PROTECTED] Subject: Tomcat Default page Hi, I am new to tomcat so bear with me. I set tomcat 5 up on a server today and it is working. I then setup webMathematica 2 and that is working fine. However, when I go to the address http://localhost the page shown is the default tomcat page. What I would like to do is have the address http://localhost bring up the webMathematica program. Can anyone shed some light onto how I can acomplish this? Thank you in advance -Seth- - 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
OK, finally figured it out. I moved the Resource elements that contained the connection pools into the GlobalNamingResources element in server.xml. I then created the context.xml file that contained ResourceLink 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: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter 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
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 Resource elements that contained the connection pools into the GlobalNamingResources element in server.xml. I then created the context.xml file that contained ResourceLink 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: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter 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
Database connection problems after redeploying war
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 context 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 Context debug=0 docBase=h path=/h privileged=false reloadable=false Logger className=org.apache.catalina.logger.FileLogger prefix=localhost_h_log. suffix=.txt timestamp=true/ Resource name=jdbc/myPool auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/myPool parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namemaxActive/name value100/value /parameter parameter namemaxIdle/name value30/value /parameter parameter namemaxWait/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter parameter nameusername/name value.../value /parameter parameter namepassword/name value.../value /parameter parameter namedriverClassName/name valuecom.inet.tds.TdsDriver/value /parameter parameter nameurl/name value.../value /parameter /ResourceParams /Context
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: parameter nameurl/name valuejdbc:oracle:thin:schema@server:port:sid/value /parameter 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 context 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
RE: Custom MBeans in Tomcat 5
My MBean is not a Valve or Realm element, so there are no elements in the server.xml file. The only experience I've had with MBeans is on JBoss. With JBoss, all you had to do is drop the packaged MBean and descriptor into the deploy directory and JBoss registered and created an instance of it for you. Then all you had to do is look it up. I assumed Tomcat did something similar as far as creating and registering the MBean for you. Is this not a correct assumption? If you've had success deploying custom MBeans on Tomcat 5, could you send me an example of how I can do this? Thanks. -Original Message- From: Benjamin Armintor [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 8:44 AM To: Tomcat Users List Subject: RE: Custom MBeans in Tomcat 5 Ahh, this is kind of tricky. Your Mbean may very well be in the Registry, but if you're getting an InstanceNotFoundException, then your asking for an instance of it that's not there (Asking for an Mbean that wasn't registered would just get you a null, I believe). The Mbean is more like a registered type. You still need to create the instances somehow. Where do you create an instance of the Mbean? If, as in the Realm and Valve examples mentioned in the Tomcat docs, your bean is a custom server component, then the Tomcat internals take care of that for you with the Valve or Realm elements in your server.xml. Benjamin J. Armintor Systems Analyst ITS-Systems: Mainframe Group University of Texas - Austin tele: (512) 232-6562 email: [EMAIL PROTECTED] -Original Message- From: Chad Boyd [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 5:27 PM To: Tomcat Users List Subject: RE: Custom MBeans in Tomcat 5 Thanks for your quick response, Benjamin. I tried including the mbeans-descriptors.xml file in the package com.ihs.config in my mbean jar but this still didn't work. I've included my mbeans-descriptors.xml file and the entry in the server.xml file. Could you take a look and see if anything looks out of place? If there's anything else you would like to see, please let me know. Thanks. mbeans-descriptors.xml file: mbeans-descriptors mbean name=Merchant className=com.ihs.config.AppConfigMBean description=Configuration MBean domain=com.ihs.config group=Realm type=javax.management.DynamicMBean attribute name=configFileLoc description=Location of the application configuration file. type=java.lang.String writeable=falsed:\javaSites\properties\ihs-web\ihs-web.properties/at tribute /mbean /mbeans-descriptors server.xml file: Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0 descriptors=/com/ihs/config/mbeans-descriptors.xml/ Object name used to try and look up the MBean: com.ihs.config:name=Merchant -Original Message- From: Benjamin Armintor [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 4:18 PM To: Tomcat Users List Subject: RE: Custom MBeans in Tomcat 5 Yes: The mbeans-descriptors.xml file needs to be jarred up in a package that corresponds to the path in your server.xml. The reference in the server.xml file is a getResource() parameter, not a file path per se. Benjamin J. Armintor Systems Analyst ITS-Systems: Mainframe Group University of Texas - Austin tele: (512) 232-6562 email: [EMAIL PROTECTED] -Original Message- From: Chad Boyd [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 4:14 PM To: [EMAIL PROTECTED] Subject: Custom MBeans in Tomcat 5 Has anyone had any luck deploying one of their own MBeans in Tomcat? I've got a Dynamic MBean I'm trying to deploy and I've had no luck. I've tried both methods listed at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/mbeans-descriptor-howto. html. Neither one seemed to work. I've got my mbean jar in the commons/lib directory, my mbeans-descriptors.xml file in the commons/classes directory, and changed server.xml to point to this file. How can I determine if this MBean has been deployed. I tried going to the jmxproxy page in the manager app but didn't see it loaded there. When I try to look it up in my code I get an InstanceNotFoundException. Could someone please help me? I can supply my entry in the mbeans-descriptors.xml file if needed. Thanks. - 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
Custom MBeans in Tomcat 5
Has anyone had any luck deploying one of their own MBeans in Tomcat? I've got a Dynamic MBean I'm trying to deploy and I've had no luck. I've tried both methods listed at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/mbeans-descriptor-howto. html. Neither one seemed to work. I've got my mbean jar in the commons/lib directory, my mbeans-descriptors.xml file in the commons/classes directory, and changed server.xml to point to this file. How can I determine if this MBean has been deployed. I tried going to the jmxproxy page in the manager app but didn't see it loaded there. When I try to look it up in my code I get an InstanceNotFoundException. Could someone please help me? I can supply my entry in the mbeans-descriptors.xml file if needed. Thanks.
RE: Custom MBeans in Tomcat 5
Thanks for your quick response, Benjamin. I tried including the mbeans-descriptors.xml file in the package com.ihs.config in my mbean jar but this still didn't work. I've included my mbeans-descriptors.xml file and the entry in the server.xml file. Could you take a look and see if anything looks out of place? If there's anything else you would like to see, please let me know. Thanks. mbeans-descriptors.xml file: mbeans-descriptors mbean name=Merchant className=com.ihs.config.AppConfigMBean description=Configuration MBean domain=com.ihs.config group=Realm type=javax.management.DynamicMBean attribute name=configFileLoc description=Location of the application configuration file. type=java.lang.String writeable=falsed:\javaSites\properties\ihs-web\ihs-web.properties/at tribute /mbean /mbeans-descriptors server.xml file: Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0 descriptors=/com/ihs/config/mbeans-descriptors.xml/ Object name used to try and look up the MBean: com.ihs.config:name=Merchant -Original Message- From: Benjamin Armintor [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 4:18 PM To: Tomcat Users List Subject: RE: Custom MBeans in Tomcat 5 Yes: The mbeans-descriptors.xml file needs to be jarred up in a package that corresponds to the path in your server.xml. The reference in the server.xml file is a getResource() parameter, not a file path per se. Benjamin J. Armintor Systems Analyst ITS-Systems: Mainframe Group University of Texas - Austin tele: (512) 232-6562 email: [EMAIL PROTECTED] -Original Message- From: Chad Boyd [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 4:14 PM To: [EMAIL PROTECTED] Subject: Custom MBeans in Tomcat 5 Has anyone had any luck deploying one of their own MBeans in Tomcat? I've got a Dynamic MBean I'm trying to deploy and I've had no luck. I've tried both methods listed at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/mbeans-descriptor-howto. html. Neither one seemed to work. I've got my mbean jar in the commons/lib directory, my mbeans-descriptors.xml file in the commons/classes directory, and changed server.xml to point to this file. How can I determine if this MBean has been deployed. I tried going to the jmxproxy page in the manager app but didn't see it loaded there. When I try to look it up in my code I get an InstanceNotFoundException. Could someone please help me? I can supply my entry in the mbeans-descriptors.xml file if needed. Thanks. - 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]