RE : Forking high loaded servlet
Hi Rodrigo, My objective is developing an HTTP proxy that receives a request, applies some business logic on it (analysis + modifications), and forwards the result to another host. When the final host responds to the modified request, the response is forwarded to the original client: ++ Request 1 +---+ Request 2 +--+ | Client | --- | Proxy | --- | Host | ++ Reply 1 +---+ Reply 2 +--+ The proxy itself does not spend a long time analyzing and forwarding the request, but the final host may do. The proxy needs to continue forwarding requests while waiting for the final host to respond. I am evaluating the feasibility of the proxy as a servlet that uses Commons HttpClient for forwarding the requests. If performance tests are not satisfactory, I will consider developing a CGI or even an Apache module. Hope this helps understand my requirement for a multithreaded servlet. Regards, Diego -Message d'origine- De : Rodrigo Ruiz [mailto:[EMAIL PROTECTED] Envoyé : lundi 7 juillet 2003 11:53 À : Tomcat Users List Objet : Re: Forking high loaded servlet Depending on the kind of request you are trying to accelerate, you could also do some caching in the response. Depending on what the servlet is intended to do, the strategies to apply can vary a lot. A description of the servlet execution would allow people to help you better :) Regards, Rodrigo Ruiz - Original Message - From: Peter Lin [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, July 04, 2003 5:31 PM Subject: Re: Forking high loaded servlet I haven't followed this thread too closely, but what kind of concurrent requests you looking at? i ask this because the number of concurrent threads in most cases is the result of hardware limitations. if you want to double the concurrent requests, get more cpu and multiple gigabit ethernet cards. trying to do it with servlet tricks (aside from server.xml configuration) won't do much in the long run. peter Sergio Juan [EMAIL PROTECTED] wrote: - Original Message - From: Diego Castillo To: Sent: Friday, July 04, 2003 3:05 PM Subject: Forking high loaded servlet Hi all, I have a servlet that receives a heavy load. I would like to process multiple requests in parallel in order to increase throughput. Tomcat creates one single instance of the servlet. This is right according to servlet specification paragraph 3.2, but it does not suit my needs. I have tried extending SingleThreadModel and Tomcat does create multiple instances, but I get the exact same throughput. Tomcat automatically creates one thread per request. If your servlet does not have synchronization issues, it will be the same creating an object per thread that using the same object (in fact a little heavier in the first case, because of the overhead of creating objects). I have also tried launching a new thread for handling HttpServletRequest HttpServletResponse, but as soon as the servlet exits service(), the response output stream gets closed by Tomcat. Same here.. you are launching a Thread inside of an already independent Thread. Is there any spec compliant strategy to increase the number of requests per second that a servlet can handle? In configuration you can set the processors number, but I think it is not the issue. If the problem is that you got a bottleneck in your host (CPU or disk at nearly 100%) you should consider load balancing between multiple servers in different machines or using common programming performance tricks (but I think you have already done that). Regards. Thanks in advance, Diego - 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] - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! - 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]
Forking high loaded servlet
Hi all, I have a servlet that receives a heavy load. I would like to process multiple requests in parallel in order to increase throughput. Tomcat creates one single instance of the servlet. This is right according to servlet specification paragraph 3.2, but it does not suit my needs. I have tried extending SingleThreadModel and Tomcat does create multiple instances, but I get the exact same throughput. I have also tried launching a new thread for handling HttpServletRequest HttpServletResponse, but as soon as the servlet exits service(), the response output stream gets closed by Tomcat. Is there any spec compliant strategy to increase the number of requests per second that a servlet can handle? Thanks in advance, Diego - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MySQL empty ResultSet on Solaris
Hi, I have an application that accesses data from MySQL via a datasource configured in config.xml. It works fine in W2K with Tomcat 4.0.3 and the mm MySQL driver 2.0.14. Now I need to install it on a Solaris box. I installed the latest Tomcat 4.1.12. The application can write into the database; it can also read (no exceptions), but the resultset is empty: the metadata is available, but I get no rows. I can perform the same searches successfully using the same objects from a standalone test program, and I DO get my rows. Has anybody ever encountered such an issue? Is there any known incompatibility between Tomcat 4.1.12 and the mm MySQL driver 2.0.14 on Solaris? Regards, Diego -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4 mod_webapp in Win2k
Just read the comments of the server.xml file from your Tomcat installation. It worked just fine for me and I have exactly the same software you talk about. Diego -Message d'origine- De : Rama [mailto:[EMAIL PROTECTED]] Envoye : jeudi 20 decembre 2001 09:26 A : [EMAIL PROTECTED] Objet : Tomcat 4 mod_webapp in Win2k Hi, Can anyone explain to me what I should do to make Apache 1.3.22, Tomcat 4.01, and mod_webapp work in my Win2k system? Please do not tell me to read the documentation. I've done exactly what the documentation told me but it seems Apache is always taking 99% of system resource (in other words, it doesn't work!). Rama _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: mod_jk for NT and EAPI
I have the same problem with mod_webapp! I have Apache 1.3.22 on Win2k and I do not manage to compile with the -DEAPI option... Diego -Message d'origine- De : Lauer, Oliver [mailto:[EMAIL PROTECTED]] Envoyé : mercredi 19 décembre 2001 13:36 À : Tomcat Users List (E-Mail) Objet : mod_jk for NT and EAPI Hi, does somebody has compiled mod_jk with EAPI for NT and could share this one with me ? :-) Until now I didn't manage to compile it on my own and I've mod_ssl installed with Apache1.3.22 (NT) and the start-up states: ...[Wed Dec 19 13:35:23 2001] [warn] Loaded DSO modules/mod_jk.dll uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)... Thanx Oliver P.S.: Sorry, but I'm too old for C+ with NT :-) AXA eSolutions GmbH AXA Konzern AG Germany Oliver Lauer Web Architect Wörthstraße 34 D-50668 Köln Germany Tel.: +49 221 148 31277 Fax: +49 221 148 43963 Mobil: +49 179 59 064 59 e-Mail: [EMAIL PROTECTED] _ Konfiguration: mod_jk - Win32 Release Kompilierung läuft... jk_jni_worker.c C:\tomcat3.3\jakarta-tomcat-3.3-src\src\native\mod_jk\common\jk_jni_worker.c (67) : fatal error C1083: Include-Datei kann nicht geoeffnet werden: 'jni.h': No such file or directory mod_jk.c Fehler beim Ausführen von cl.exe. mod_jk.dll - 1 Fehler, 0 Warnung(en) Aus Rechts- und Sicherheitsgruenden ist die in dieser E-Mail gegebene Information nicht rechtsverbindlich. Eine rechtsverbindliche Bestaetigung reichen wir Ihnen gerne auf Anforderung in schriftlicher Form nach. Beachten Sie bitte, dass jede Form der unautorisierten Nutzung, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail nicht gestattet ist.Diese Nachricht ist ausschliesslich fuer den bezeichneten Adressaten oder dessen Vertreter bestimmt. Sollten Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein, so bitten wir Sie, sich mit dem Absender der E-Mail in Verbindung zu setzen. For legal and security reasons the information provided in this e-mail is not legally binding. Upon request we would be pleased to provide you with a legally binding confirmation in written form. Any form of unauthorised use, publication, reproduction, copying or disclosure of the content of this e-mail is not permitted. This message is exclusively for the person addressed or their representative. If you are not the intended recipient of this message and its contents, please notify the sender immediately. --- -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: mod_jk for NT and EAPI
I do not get a warning myself, Apache refuses to start-up without mod_webapp being compiled with the -DEAPI option. I am currently using mod_proxy as a workaround, but I would rather use mod_webapp if I could find a version compatible with mod_ssl. Diego -Message d'origine- De : Lauer, Oliver [mailto:[EMAIL PROTECTED]] Envoyé : mercredi 19 décembre 2001 14:17 À : 'Tomcat Users List'; '[EMAIL PROTECTED]' Objet : AW: mod_jk for NT and EAPI Hi Diego, at least there's someone else on this earth who has the same problem as I have :-)) Did you encounter any problems working with this warning ? Sometimes I get exceptions in apache.dll (Access violation). Oliver AXA eSolutions GmbH AXA Konzern AG Germany Oliver Lauer Web Architect Wörthstraße 34 D-50668 Köln Germany Tel.: +49 221 148 31277 Fax: +49 221 148 43963 Mobil: +49 179 59 064 59 e-Mail: [EMAIL PROTECTED] _ -Ursprüngliche Nachricht- Von: Diego Castillo [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 19. Dezember 2001 14:19 An: Tomcat Users List Betreff: RE: mod_jk for NT and EAPI I have the same problem with mod_webapp! I have Apache 1.3.22 on Win2k and I do not manage to compile with the -DEAPI option... Diego -Message d'origine- De : Lauer, Oliver [mailto:[EMAIL PROTECTED]] Envoyé : mercredi 19 décembre 2001 13:36 À : Tomcat Users List (E-Mail) Objet : mod_jk for NT and EAPI Hi, does somebody has compiled mod_jk with EAPI for NT and could share this one with me ? :-) Until now I didn't manage to compile it on my own and I've mod_ssl installed with Apache1.3.22 (NT) and the start-up states: ...[Wed Dec 19 13:35:23 2001] [warn] Loaded DSO modules/mod_jk.dll uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI)... Thanx Oliver P.S.: Sorry, but I'm too old for C+ with NT :-) AXA eSolutions GmbH AXA Konzern AG Germany Oliver Lauer Web Architect Wörthstraße 34 D-50668 Köln Germany Tel.: +49 221 148 31277 Fax: +49 221 148 43963 Mobil: +49 179 59 064 59 e-Mail: [EMAIL PROTECTED] _ Konfiguration: mod_jk - Win32 Release Kompilierung läuft... jk_jni_worker.c C:\tomcat3.3\jakarta-tomcat-3.3-src\src\native\mod_jk\common\jk_jni_worker.c (67) : fatal error C1083: Include-Datei kann nicht geoeffnet werden: 'jni.h': No such file or directory mod_jk.c Fehler beim Ausführen von cl.exe. mod_jk.dll - 1 Fehler, 0 Warnung(en) Aus Rechts- und Sicherheitsgruenden ist die in dieser E-Mail gegebene Information nicht rechtsverbindlich. Eine rechtsverbindliche Bestaetigung reichen wir Ihnen gerne auf Anforderung in schriftlicher Form nach. Beachten Sie bitte, dass jede Form der unautorisierten Nutzung, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail nicht gestattet ist.Diese Nachricht ist ausschliesslich fuer den bezeichneten Adressaten oder dessen Vertreter bestimmt. Sollten Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein, so bitten wir Sie, sich mit dem Absender der E-Mail in Verbindung zu setzen. For legal and security reasons the information provided in this e-mail is not legally binding. Upon request we would be pleased to provide you with a legally binding confirmation in written form. Any form of unauthorised use, publication, reproduction, copying or disclosure of the content of this e-mail is not permitted. This message is exclusively for the person addressed or their representative. If you are not the intended recipient of this message and its contents, please notify the sender immediately. --- -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] Aus Rechts- und Sicherheitsgruenden ist die in dieser E-Mail gegebene Information nicht rechtsverbindlich. Eine rechtsverbindliche Bestaetigung reichen wir Ihnen gerne auf Anforderung in schriftlicher Form nach. Beachten Sie bitte, dass jede Form der unautorisierten Nutzung, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des Inhalts dieser E-Mail nicht gestattet ist.Diese Nachricht ist ausschliesslich fuer den bezeichneten Adressaten oder dessen Vertreter bestimmt. Sollten Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein, so bitten wir Sie, sich mit dem Absender der E-Mail in Verbindung zu setzen. For legal and security reasons the information provided in this e-mail is not legally binding. Upon request we would be pleased to provide you with a legally binding confirmation in written form. Any form of unauthorised use, publication, reproduction
RE: Question on SSL...
Hi, I am new to SSL and I wondered whether it could be possible to encrypt HTTP without requiring a certificate. I have also generated a self-signed certificate using OpenSSL. I have done so because I wanted to encrypt my data and all the docs I have found explain how to generate and deploy a certificate. But I do not really require to authenticate my server, I just wanted the encryption! Is this possible? Is the certificate really a MUST? In case it was not necessary, could anyone send my a pointer on how to reconfigure my server in order to ignore the certificate while continuing to encrypt the responses? Thanks, Diego -Message d'origine- De : Richard S. Huntrods [mailto:[EMAIL PROTECTED]] Envoye : lundi 17 decembre 2001 20:03 A : [EMAIL PROTECTED] Objet : Question on SSL... Greetings! I have SSL working with a self-signed certificate on Tomcat 4.0 - on a Win2K box. The only difficulty I had was that the jsse jar files had to be placed in jre/lib/ext, as the JSSE_HOME variable did not work for me. Now I am trying to move this work to Solaris. I have Tomcat 4.0.1 working well on a Solaris (SPARC) box. I duplicated the process of putting the jar files in the jre/lib/ext directory, and ***copied*** the self-signed certificate to the same directory (relative to CATALINA_HOME) as on the W2K box. I also appropriately edited server.xml. Starting Tomcat with the -debug parameter on the Solaris box, I found no errors. Likewise, examining the logs reveals no errors, BUT - when I try to access an html file using port 8443 (the same action worked on W2K - same directory structures and html files), I get The page cannot be displayed. The page displays fine using port 8080. In other words, http://xx.xx.xx.xx:8080/index.html; works, but https://xx.xx.xx.xx:8443/index.html; does not. With the same certificate, directory structures, jar files (in the JDK/jre/lib/ext directory), server.xml, etc. on W2K, both work. Question: MUST you generate the certificate on the box you will use (or at least the OS)? I generated the certificate on the W2K box and just copied it (binary FTP) to the Solaris box. Thanks in advance, -Richard -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: MySQL DataSource using Tomcat 4
OK, now I think I'm getting it. I have modified my server.xml file so that it includes a login/password that permits connecting to the database: Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost:3306/pim/value /parameter parameter nameuser/name valuediego/value /parameter parameter namepassword/name valuediego/value /parameter ResourceParams/ This does not seem to improve things that much. What is really important is using as driverClassName property the org.gjt.mm.mysql.Driver from MySQL. As you said, Tyrex requires the driver, not the data source implementation. Now I find a not null object using JNDI and get a default toString() Enabled DataSource message. This object is of type tyrex.jdbc.xa.EnabledDataSource according to the getClass().getName() function. However I can not cast it to any type, this including both javax.sql.DataSource and the tyrex.jdbc.xa.EnabledDataSource itself. Can anybody understand this? Is the object incorrectly initialised? I have put copies of the JDBC driver jar file in both /common/lib and /server/lib directories... Diego -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Craig R. McClanahan Envoye : vendredi 14 decembre 2001 21:05 A : Tomcat Users List; [EMAIL PROTECTED] Objet : RE: MySQL DataSource using Tomcat 4 The thing to remembert is that the ENC does *not* use MySQL's own connection pool implementation -- it uses its own (Tyrex). And Tyrex's mechanism for connectiong to the database requires logging on with a username and password. Craig On Fri, 14 Dec 2001, Diego Castillo wrote: Date: Fri, 14 Dec 2001 19:16:39 +0100 From: Diego Castillo [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: RE: MySQL DataSource using Tomcat 4 Hello Craig, Thanks for your answer. I have tried your suggestion, but I still have the same problem: the object I found using JNDI ENC is not initialised, it's null. This is normal because I have set up my MySQL database so that it requires no login/password for the moment. I am using the following resource definition: Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.MysqlDataSource/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost:3306/pim/value /parameter parameternameuser/namevalue//parameter parameternamepassword/namevalue//parameter /ResourceParams I have read the JNDI How-To hundreds of times, but I am still missing something... Diego -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Craig R. McClanahan Envoye : vendredi 14 decembre 2001 18:40 A : Tomcat Users List; [EMAIL PROTECTED] Objet : Re: MySQL DataSource using Tomcat 4 You also need the database username and password (in the user and password parameters, respectively). More info in the JNDI How-To, which is part of the docs shipped with Tomcat and also available online. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html Craig On Fri, 14 Dec 2001, Diego Castillo wrote: Date: Fri, 14 Dec 2001 10:18:58 +0100 From: Diego Castillo [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: MySQL DataSource using Tomcat 4 Hi all! I have a JSP that must fetch some information from a MySQL database. Everything works fine if I create manually a DataSource in my code: org.gjt.mm.mysql.MysqlDataSource pool = new org.gjt.mm.mysql.MysqlDataSource(); pool.setServerName(localhost); pool.setPort(3306); pool.setDatabaseName(pim); Now I would like Tomcat to create this DataSource object at start-up and find it using JNDI ENC. My code looks like: InitialContext initialContext = new InitialContext(); DataSource pool = (DataSource) initialContext.lookup(java:comp/env/jdbc/pim); This code does find a DataSource object, but it seems that the object found is not initialised. I have tried many different combinations for my server.xml file, but it just looks impossible to figure out what the problem is. The JDBC driver is below common/lib and I am using Tomcat in standalone mode. My server.xml file looks like: Context path= docBase=pim debug=0 Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.MysqlDataSource/value /parameter parameter
RE: MySQL DataSource using Tomcat 4
I found what was going wrong with my DataSource! The configuration (server.xml + web.xml) was OK, and so was the code. But I had put the jar file containing the driver in more than one place: common/lib, server/lib, WEB-INF/lib... I still don't understand why, but this certainly hurts. The class loader must have something wrong which causes a ClassCastException when the jar file is duplicated! Now I have one single copy of my jar file and everything works fine. Thanks to those who have help me with this problem. Diego -Message d'origine- De : Diego Castillo [mailto:[EMAIL PROTECTED]] Envoye : lundi 17 decembre 2001 12:34 A : Tomcat Users List Objet : RE: MySQL DataSource using Tomcat 4 OK, now I think I'm getting it. I have modified my server.xml file so that it includes a login/password that permits connecting to the database: Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.Driver/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost:3306/pim/value /parameter parameter nameuser/name valuediego/value /parameter parameter namepassword/name valuediego/value /parameter ResourceParams/ This does not seem to improve things that much. What is really important is using as driverClassName property the org.gjt.mm.mysql.Driver from MySQL. As you said, Tyrex requires the driver, not the data source implementation. Now I find a not null object using JNDI and get a default toString() Enabled DataSource message. This object is of type tyrex.jdbc.xa.EnabledDataSource according to the getClass().getName() function. However I can not cast it to any type, this including both javax.sql.DataSource and the tyrex.jdbc.xa.EnabledDataSource itself. Can anybody understand this? Is the object incorrectly initialised? I have put copies of the JDBC driver jar file in both /common/lib and /server/lib directories... Diego -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Craig R. McClanahan Envoye : vendredi 14 decembre 2001 21:05 A : Tomcat Users List; [EMAIL PROTECTED] Objet : RE: MySQL DataSource using Tomcat 4 The thing to remembert is that the ENC does *not* use MySQL's own connection pool implementation -- it uses its own (Tyrex). And Tyrex's mechanism for connectiong to the database requires logging on with a username and password. Craig On Fri, 14 Dec 2001, Diego Castillo wrote: Date: Fri, 14 Dec 2001 19:16:39 +0100 From: Diego Castillo [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: RE: MySQL DataSource using Tomcat 4 Hello Craig, Thanks for your answer. I have tried your suggestion, but I still have the same problem: the object I found using JNDI ENC is not initialised, it's null. This is normal because I have set up my MySQL database so that it requires no login/password for the moment. I am using the following resource definition: Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.MysqlDataSource/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost:3306/pim/value /parameter parameternameuser/namevalue//parameter parameternamepassword/namevalue//parameter /ResourceParams I have read the JNDI How-To hundreds of times, but I am still missing something... Diego -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Craig R. McClanahan Envoye : vendredi 14 decembre 2001 18:40 A : Tomcat Users List; [EMAIL PROTECTED] Objet : Re: MySQL DataSource using Tomcat 4 You also need the database username and password (in the user and password parameters, respectively). More info in the JNDI How-To, which is part of the docs shipped with Tomcat and also available online. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html Craig On Fri, 14 Dec 2001, Diego Castillo wrote: Date: Fri, 14 Dec 2001 10:18:58 +0100 From: Diego Castillo [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: MySQL DataSource using Tomcat 4 Hi all! I have a JSP that must fetch some information from a MySQL database. Everything works fine if I create manually a DataSource in my code: org.gjt.mm.mysql.MysqlDataSource pool = new org.gjt.mm.mysql.MysqlDataSource(); pool.setServerName(localhost); pool.setPort(3306); pool.setDatabaseName(pim); Now I would like Tomcat to create this DataSource object at start-up and find it using JNDI ENC. My code looks like: InitialContext initialContext = new InitialContext(); DataSource pool
MySQL DataSource using Tomcat 4
Hi all! I have a JSP that must fetch some information from a MySQL database. Everything works fine if I create manually a DataSource in my code: org.gjt.mm.mysql.MysqlDataSource pool = new org.gjt.mm.mysql.MysqlDataSource(); pool.setServerName(localhost); pool.setPort(3306); pool.setDatabaseName(pim); Now I would like Tomcat to create this DataSource object at start-up and find it using JNDI ENC. My code looks like: InitialContext initialContext = new InitialContext(); DataSource pool = (DataSource) initialContext.lookup(java:comp/env/jdbc/pim); This code does find a DataSource object, but it seems that the object found is not initialised. I have tried many different combinations for my server.xml file, but it just looks impossible to figure out what the problem is. The JDBC driver is below common/lib and I am using Tomcat in standalone mode. My server.xml file looks like: Context path= docBase=pim debug=0 Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.MysqlDataSource/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost:3306/pim/value /parameter /ResourceParams /Context Does anybody know what is happening? How do I instruct tyrex about the factory it should use? Any help would be welcome! Diego Castillo -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
MySQL DataSource using Tomcat 4
Hello again, I'm sorry for sending a second message on the same problem, but this is the second day I am stuck with this problem. I try to configure a DataSource to MySQL using Tomcat 4.0.1. The JNDI binding is created, but the object found through the ENC is null (not initialised). I use the following resource definition: Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.MysqlDataSource/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost:3306/pim/value /parameter /ResourceParams My database does not require any login/password. I manage to run my JSP on a different servlet container: same code, same JNDI binding, same database, same URL, etc. Has anybody ever managed to create a pool to MySQL using Tomcat? Where can I find some further documentation on the possible parameters to be used for the ResourceParams tag? The standard documentation looks really insufficient to me on this point... Thanks for any help you can offer. Diego -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: MySQL DataSource using Tomcat 4
Hello Craig, Thanks for your answer. I have tried your suggestion, but I still have the same problem: the object I found using JNDI ENC is not initialised, it's null. This is normal because I have set up my MySQL database so that it requires no login/password for the moment. I am using the following resource definition: Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.MysqlDataSource/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost:3306/pim/value /parameter parameternameuser/namevalue//parameter parameternamepassword/namevalue//parameter /ResourceParams I have read the JNDI How-To hundreds of times, but I am still missing something... Diego -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]De la part de Craig R. McClanahan Envoye : vendredi 14 decembre 2001 18:40 A : Tomcat Users List; [EMAIL PROTECTED] Objet : Re: MySQL DataSource using Tomcat 4 You also need the database username and password (in the user and password parameters, respectively). More info in the JNDI How-To, which is part of the docs shipped with Tomcat and also available online. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html Craig On Fri, 14 Dec 2001, Diego Castillo wrote: Date: Fri, 14 Dec 2001 10:18:58 +0100 From: Diego Castillo [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: MySQL DataSource using Tomcat 4 Hi all! I have a JSP that must fetch some information from a MySQL database. Everything works fine if I create manually a DataSource in my code: org.gjt.mm.mysql.MysqlDataSource pool = new org.gjt.mm.mysql.MysqlDataSource(); pool.setServerName(localhost); pool.setPort(3306); pool.setDatabaseName(pim); Now I would like Tomcat to create this DataSource object at start-up and find it using JNDI ENC. My code looks like: InitialContext initialContext = new InitialContext(); DataSource pool = (DataSource) initialContext.lookup(java:comp/env/jdbc/pim); This code does find a DataSource object, but it seems that the object found is not initialised. I have tried many different combinations for my server.xml file, but it just looks impossible to figure out what the problem is. The JDBC driver is below common/lib and I am using Tomcat in standalone mode. My server.xml file looks like: Context path= docBase=pim debug=0 Resource name=jdbc/pim auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/pim parameter namedriverClassName/name valueorg.gjt.mm.mysql.MysqlDataSource/value /parameter parameter namedriverName/name valuejdbc:mysql://localhost:3306/pim/value /parameter /ResourceParams /Context Does anybody know what is happening? How do I instruct tyrex about the factory it should use? Any help would be welcome! Diego Castillo -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Problem mapping servlets to /servlets/*
Hi, I am quite new to Tomcat and I have encountered problems in mapping servlets to specific URLs. Basically, I want my servlets to be activated when invoked through an URL that contains /servlets/* in addition to default /servlet/*. I have added the following to my %TOMCAT_HOME%\conf\web.xml: web-app [...] servlet-mapping servlet-name invoker /servlet-name url-pattern /servlets/* /url-pattern /servlet-mapping [...] /web-app This does not work. If I point to http://localhost/servlets/IsItWorking instead of http://localhost/servlet/IsItWorking, Apache is not able to find the appropriate page. Any suggestions? Regards, Diego Castillo