Re: SSL on TOMCAT with keytool
Alexey Eronko wrote: Hello Guys! Don't beat me because I found so much docs about ssl and keystore but I can't get it working with together. I have pem cert,rsa_key and ca cert from my own CA. I don't understand what kind of cert do I need in keystore to make it works on tomcat. I tried keytool -import -alias tomcat -trustcacerts –file myserver.pem -keystore keystore.jks And I Got error in tomcat : java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException: No available certificate or key corresponds to the SSL cipher suites which are enabled. at org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESocketFactory.java:150) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310) at java.lang.Thread.run(Thread.java:619) Aug 27, 2008 5:56:28 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run SEVERE: Socket accept failed I thought that I need to Impot rsa key also, I tried : keytool -import -alias tomcat3 -keyalg RSA -file key -trustcacerts -keystore .keystore I got : keytool error: java.lang.Exception: Input not an X.509 certificate I've already lost 5 hours to solve this problem, could you please assist me . Thanks a lot Alex AFAIK java uses DER format for keystore so , you have to convert .pem to .der openssl x509 -in cacert.pem -inform PEM -out cacert.der -outform DER keytool -import -alias tomcat -keystore /usr/java/jdk1.6.0_04/jre/lib/security/cacerts -file cacert.der Alex - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Can't execute servlet project
HI there, According to the tomcat online document, do I have to modify the context.xml file? $CATALINA_HOME/conf/context.xml with the following new setup: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/javatest?autoReconnect=true/ where username/password is the root/admin user/password of the mysql database? thanks - Original Message - From: David Smith Sent: 28/08/08 03:06 am To: Tomcat Users List Subject: Re: Can't execute servlet project The datasource for your webapp isn't setup correctly. Take a look at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html for help on how to properly setup a database connection pool. My only edit that article I would recommend is don't add ?autoReconnect=true to the end of the mysql database url. Instead, add validationQuery=select 1 to the Resource ... / element in your context.xml file so connections are tested and regenerated as needed. --David sam wun wrote: HI there, I managed to fix the jdk version error, now it comes with a different error. The url I am trying to put on the firefox browser is http://10.1.9.1:8080/DBTest/CreateCustomerServlet The error is: TTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause java.sql.SQLException: No suitable driver java.sql.DriverManager.getDriver(Unknown Source) org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs. - Original Message - From: David Smith Sent: 28/08/08 12:44 am To: Tomcat Users List Subject: Re: Can't execute servlet project Looks normal .. you won't get a file named CreateCustomerServlet under DbTest. You should get a class named CreateCustomerServlet.class in WEB-INF/classes/servlet. That class will be called when your webapp receive's a request for http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat was installed with listening on port 8080 and it's installed on your local workstation). That's what the servlet-mapping ... /servlet-mapping part of web.xml is all about -- mapping URLs to servlets. --David sam wun wrote: I got a similar web.xml, but the is different. Here is the entire content of my web.xml. ?xml version=1.0 encoding=UTF-8? web-app id=WebApp_ID version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-name DBTest/display-name servlet description Servlet to create customers/description display-name CreateCustomerServlet/display-name servlet-nameCreateCustomerServlet/servlet-name servlet-class servlet.CreateCustomerServlet/servlet-class /servlet servlet-mapping servlet-nameCreateCustomerServlet/servlet-name url-pattern/CreateCustomerServlet/url-pattern /servlet-mapping
Re: Can't execute servlet project
Do I need to put mysql driver in the common/lib/ directory in linux? Currently this tomcat server (in linux) has the following jar flies in the common/lib/ folder: linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls . commons-el.jar jasper-compiler.jar jsp-api.jar naming-factory.jar servlet-api.jar .. jasper-compiler-jdt.jar jasper-runtime.jar naming-factory-dbcp.jar naming-resources.jar If I need to have that, where can I download it? Thanks - Original Message - From: sam wun Sent: 28/08/08 04:44 pm To: Tomcat Users List Subject: Re: Re: Can't execute servlet project HI there, According to the tomcat online document, do I have to modify the context.xml file? $CATALINA_HOME/conf/context.xml with the following new setup: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/javatest?autoReconnect=true/ where username/password is the root/admin user/password of the mysql database? thanks - Original Message - From: David Smith Sent: 28/08/08 03:06 am To: Tomcat Users List Subject: Re: Can't execute servlet project The datasource for your webapp isn't setup correctly. Take a look at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html for help on how to properly setup a database connection pool. My only edit that article I would recommend is don't add ?autoReconnect=true to the end of the mysql database url. Instead, add validationQuery=select 1 to the Resource ... / element in your context.xml file so connections are tested and regenerated as needed. --David sam wun wrote: HI there, I managed to fix the jdk version error, now it comes with a different error. The url I am trying to put on the firefox browser is http://10.1.9.1:8080/DBTest/CreateCustomerServlet The error is: TTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause java.sql.SQLException: No suitable driver java.sql.DriverManager.getDriver(Unknown Source) org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs. - Original Message - From: David Smith Sent: 28/08/08 12:44 am To: Tomcat Users List Subject: Re: Can't execute servlet project Looks normal .. you won't get a file named CreateCustomerServlet under DbTest. You should get a class named CreateCustomerServlet.class in WEB-INF/classes/servlet. That class will be called when your webapp receive's a request for http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat was installed with listening on port 8080 and it's installed on your local workstation). That's what the servlet-mapping ... /servlet-mapping part of web.xml is all about -- mapping URLs to servlets. --David sam wun wrote: I got a similar web.xml, but the is different. Here is the entire content of my web.xml. ?xml version=1.0 encoding=UTF-8?
Re: antioJarLocking not working
Aaron Axelsen wrote: I set the workdir on the global context - I can see that files are being created there, however that same error still exists. For some reason it insists on looking in Tomcat 6\temp-Foo5 Any suggestions? It looks like a bug in the jar. It might be using a non-portable way to find the file. Mark Mark Thomas wrote: | Aaron Axelsen wrote: | I understand how it works - the problem is that the folder is not | actually getting created. I double checked permissions - and the apache | user does have full permissions to that tomcat 6 folder. Any thoughts? | | The name of the war is temp Foo5.war. I can see folders getting created | inside of the temp folder, but the temp-Foo5 folder inside of the tomcat | 6 directory is not getting created. | | It looks like the lib is looking in the wrong place. If you haven't set an | explicit workDir then underneath %CATALINA_BASE%\work is where I would | expect the war to be unpacked and from what you say, that is what is happening. | | Mark | | | | - | To start a new topic, e-mail: users@tomcat.apache.org | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | | - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SSL on TOMCAT with keytool
The point was that keytool can't import existing private key. If you need to build keystore from existed cert + prv key you need to do this by external java(or smt) program. Key and Cer must be in der format. Example is here : http://www.agentbob.info/agentbob/79-AB.html Alex 2008/8/28 Alex Mestiashvili [EMAIL PROTECTED] Alexey Eronko wrote: Hello Guys! Don't beat me because I found so much docs about ssl and keystore but I can't get it working with together. I have pem cert,rsa_key and ca cert from my own CA. I don't understand what kind of cert do I need in keystore to make it works on tomcat. I tried keytool -import -alias tomcat -trustcacerts –file myserver.pem -keystore keystore.jks And I Got error in tomcat : java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException: No available certificate or key corresponds to the SSL cipher suites which are enabled. at org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESocketFactory.java:150) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310) at java.lang.Thread.run(Thread.java:619) Aug 27, 2008 5:56:28 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run SEVERE: Socket accept failed I thought that I need to Impot rsa key also, I tried : keytool -import -alias tomcat3 -keyalg RSA -file key -trustcacerts -keystore .keystore I got : keytool error: java.lang.Exception: Input not an X.509 certificate I've already lost 5 hours to solve this problem, could you please assist me . Thanks a lot Alex AFAIK java uses DER format for keystore so , you have to convert .pem to .der openssl x509 -in cacert.pem -inform PEM -out cacert.der -outform DER keytool -import -alias tomcat -keystore /usr/java/jdk1.6.0_04/jre/lib/security/cacerts -file cacert.der Alex - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: config problem
Eric, thanks... i thought to this solution yesterday afternoon and i gave it to the person who's facing to the problem. i don't know if it works today i will see on monday! thanks again Assuming you are running private IP's in your internal network and a public IP on the external network, you can create a dns such as mynetwork.mydomain.com which will resolve to the private IP when accessed inside the network and public IP when accessed externally. use this name as the hostname in server.xml Eric -Original Message- From: [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Date: Wed, 27 Aug 2008 11:20:07 +0200 Subject: config problem hello, we are facing a problem! config: jdk 1.4 tomcat 4 the server is configured to be accessed by an network internal IP but it is not working with an external IP . i did the config in the server.xml but it is not working [...] Host name=my.network.internal.ip debug=0 appBase=/usr/tomcat/webapps unpackWARs=true autoDeploy=true Context path= docBase=gedai debug=1/ Aliasmy.external.ip/Alias Aliasmy.network.internal.ip/Alias Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=gedai_access_log. suffix=.txt pattern=common resolveHosts=false/ /Host [...] when i try to access to the IP, i've got an error 500 - no context configured... what did i do wrong?? supareno - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't execute servlet project
sam wun wrote: Do I need to put mysql driver in the common/lib/ directory in linux? Yes, that's a basic requirement. If I need to have that, where can I download it? The MySQL site - you could probably have guessed that. http://dev.mysql.com/usingmysql/java/ Thanks - Original Message - From: sam wun Sent: 28/08/08 04:44 pm To: Tomcat Users List Subject: Re: Re: Can't execute servlet project HI there, According to the tomcat online document, do I have to modify the context.xml file? $CATALINA_HOME/conf/context.xml with the following new setup: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/javatest?autoReconnect=true/ where username/password is the root/admin user/password of the mysql database? thanks - Original Message - From: David Smith Sent: 28/08/08 03:06 am To: Tomcat Users List Subject: Re: Can't execute servlet project The datasource for your webapp isn't setup correctly. Take a look at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html for help on how to properly setup a database connection pool. My only edit that article I would recommend is don't add ?autoReconnect=true to the end of the mysql database url. Instead, add validationQuery=select 1 to the Resource ... / element in your context.xml file so connections are tested and regenerated as needed. --David sam wun wrote: HI there, I managed to fix the jdk version error, now it comes with a different error. The url I am trying to put on the firefox browser is http://10.1.9.1:8080/DBTest/CreateCustomerServlet The error is: TTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause java.sql.SQLException: No suitable driver java.sql.DriverManager.getDriver(Unknown Source) org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs. - Original Message - From: David Smith Sent: 28/08/08 12:44 am To: Tomcat Users List Subject: Re: Can't execute servlet project Looks normal .. you won't get a file named CreateCustomerServlet under DbTest. You should get a class named CreateCustomerServlet.class in WEB-INF/classes/servlet. That class will be called when your webapp receive's a request for http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat was installed with listening on port 8080 and it's installed on your local workstation). That's what the servlet-mapping ... /servlet-mapping part of web.xml is all about -- mapping URLs to servlets. --David sam wun wrote: I got a similar web.xml, but the is different. Here is the entire content of my web.xml. ?xml version=1.0 encoding=UTF-8? web-app id=WebApp_ID version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-name DBTest/display-name servlet description Servlet to create customers/description display-name CreateCustomerServlet/display-name
Re: Can't execute servlet project
sam wun wrote: HI there, According to the tomcat online document, do I have to modify the context.xml file? $CATALINA_HOME/conf/context.xml Not that one, that one affects *all* deployed contexts. Add a context.xml file to your webapp, in the META-INF folder. DBTest/index.jsp DBTest/META-INF/context.xml DBTest/WEB-INF/web.xml p with the following new setup: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/javatest?autoReconnect=true/ where username/password is the root/admin user/password of the mysql database? thanks - Original Message - From: David Smith Sent: 28/08/08 03:06 am To: Tomcat Users List Subject: Re: Can't execute servlet project The datasource for your webapp isn't setup correctly. Take a look at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html for help on how to properly setup a database connection pool. My only edit that article I would recommend is don't add ?autoReconnect=true to the end of the mysql database url. Instead, add validationQuery=select 1 to the Resource ... / element in your context.xml file so connections are tested and regenerated as needed. --David sam wun wrote: HI there, I managed to fix the jdk version error, now it comes with a different error. The url I am trying to put on the firefox browser is http://10.1.9.1:8080/DBTest/CreateCustomerServlet The error is: TTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause java.sql.SQLException: No suitable driver java.sql.DriverManager.getDriver(Unknown Source) org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs. - Original Message - From: David Smith Sent: 28/08/08 12:44 am To: Tomcat Users List Subject: Re: Can't execute servlet project Looks normal .. you won't get a file named CreateCustomerServlet under DbTest. You should get a class named CreateCustomerServlet.class in WEB-INF/classes/servlet. That class will be called when your webapp receive's a request for http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat was installed with listening on port 8080 and it's installed on your local workstation). That's what the servlet-mapping ... /servlet-mapping part of web.xml is all about -- mapping URLs to servlets. --David sam wun wrote: I got a similar web.xml, but the is different. Here is the entire content of my web.xml. ?xml version=1.0 encoding=UTF-8? web-app id=WebApp_ID version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-name DBTest/display-name servlet description Servlet to create customers/description display-name CreateCustomerServlet/display-name servlet-nameCreateCustomerServlet/servlet-name servlet-class servlet.CreateCustomerServlet/servlet-class /servlet servlet-mapping
Re: Re: Can't execute servlet project
Hi, I couldn't find an installation document about installing the driver. I;ve downloaded the driver: linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls mysql-connector-java-5.1.3-rc-bin.jar mysql-connector-java-5.1.3-rc-bin.jar Do you know how to configure tomcat to make use of it? Thanks Sam - Original Message - From: Pid Sent: 28/08/08 06:47 pm To: Tomcat Users List Subject: Re: Can't execute servlet project sam wun wrote: Do I need to put mysql driver in the common/lib/ directory in linux? Yes, that's a basic requirement. If I need to have that, where can I download it? The MySQL site - you could probably have guessed that. http://dev.mysql.com/usingmysql/java/ Thanks - Original Message - From: sam wun Sent: 28/08/08 04:44 pm To: Tomcat Users List Subject: Re: Re: Can't execute servlet project HI there, According to the tomcat online document, do I have to modify the context.xml file? $CATALINA_HOME/conf/context.xml with the following new setup: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/javatest?autoReconnect=true/ where username/password is the root/admin user/password of the mysql database? thanks - Original Message - From: David Smith Sent: 28/08/08 03:06 am To: Tomcat Users List Subject: Re: Can't execute servlet project The datasource for your webapp isn't setup correctly. Take a look at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html for help on how to properly setup a database connection pool. My only edit that article I would recommend is don't add ?autoReconnect=true to the end of the mysql database url. Instead, add validationQuery=select 1 to the Resource ... / element in your context.xml file so connections are tested and regenerated as needed. --David sam wun wrote: HI there, I managed to fix the jdk version error, now it comes with a different error. The url I am trying to put on the firefox browser is http://10.1.9.1:8080/DBTest/CreateCustomerServlet The error is: TTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause java.sql.SQLException: No suitable driver java.sql.DriverManager.getDriver(Unknown Source) org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs. - Original Message - From: David Smith Sent: 28/08/08 12:44 am To: Tomcat Users List Subject: Re: Can't execute servlet project Looks normal .. you won't get a file named CreateCustomerServlet under DbTest. You should get a class named CreateCustomerServlet.class in WEB-INF/classes/servlet. That class will be called when your webapp receive's a request for http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat was installed with listening on port 8080 and it's installed on your local workstation). That's what the servlet-mapping ... /servlet-mapping part of web.xml is all about -- mapping URLs to servlets.
Securing Tomcat: HELP
Hi Experts, I am trying to secure my tomcat manager web console from been seen from the internet. For example if i open the browser and type the internet address of the server, it displays the console where ever i am in the world and therefore want to hide it from been displayed to WAN users. Can someone help me:working: -- View this message in context: http://www.nabble.com/Securing-Tomcat%3A-HELP-tp19197181p19197181.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5 won't use APR
Hm, rather quiete here about my problem... Is there anybody on this list who is using Tomcat together with APR on any Linux and could let me know about his/her configs? Gregor -- what's puzzlin' you, is the nature of my game gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Securing Tomcat: HELP
losintikfos wrote: Hi Experts, I am trying to secure my tomcat manager web console from been seen from the internet. For example if i open the browser and type the internet address of the server, it displays the console where ever i am in the world and therefore want to hide it from been displayed to WAN users. Can someone help me:working: http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html You want the remote address filter. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5 won't use APR
Gregor Schneider wrote: Hm, rather quiete here about my problem... Is there anybody on this list who is using Tomcat together with APR on any Linux and could let me know about his/her configs? Is the right listener defined in web.xml? Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat won't start
jackarta_service log says: [...] [2008-08-28 05:56:52] [info] Starting service... [2008-08-28 05:56:52] [174 javajni.c] [error] The specified module could not be found. [2008-08-28 05:56:52] [994 prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll [2008-08-28 05:56:52] [1269 prunsrv.c] [error] ServiceStart returned 1 [2008-08-28 05:56:52] [info] Run service finished. [2008-08-28 05:56:52] [info] Procrun finished. [2008-08-28 05:57:06] [info] Procrun (2.0.4.0) started [2008-08-28 05:57:06] [info] Running Service... [2008-08-28 05:57:06] [info] Starting service... [2008-08-28 05:57:06] [174 javajni.c] [error] The specified module could not be found. [2008-08-28 05:57:06] [994 prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll [2008-08-28 05:57:06] [1269 prunsrv.c] [error] ServiceStart returned 1 [2008-08-28 05:57:06] [info] Run service finished. [2008-08-28 05:57:06] [info] Procrun finished. stderr and stdout logs are empty. Any hint will be highly appreaciated. Benny
Re: Securing Tomcat: HELP
Thanks for your reply Mark! unfurtunatly the url sent to me contains only language reference which i am not familier with. Do you know the original command and where to put, to enforce the security? I am using Tomcat 6 markt-2 wrote: losintikfos wrote: Hi Experts, I am trying to secure my tomcat manager web console from been seen from the internet. For example if i open the browser and type the internet address of the server, it displays the console where ever i am in the world and therefore want to hide it from been displayed to WAN users. Can someone help me:working: http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html You want the remote address filter. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Securing-Tomcat%3A-HELP-tp19197181p19198705.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: Tomcat won't start - solved
Solution found here: http://www.icurtain.co.uk/blog.php?article=92 When tomcat generates something similar to the following log output chances are its missing the Windows C dll MSVCR71.dllhttp://www.icurtain.co.uk/assets/msvcr71.zip- Tomcat needs this to initialise java when the service starts. Put a copy in your c:\windows\system32 directory or wherever you want as long as its in your system path -- Forwarded message -- From: Benny Lipsicas [EMAIL PROTECTED] Date: Thu, Aug 28, 2008 at 7:24 AM Subject: Tomcat won't start To: users@tomcat.apache.org jackarta_service log says: [...] [2008-08-28 05:56:52] [info] Starting service... [2008-08-28 05:56:52] [174 javajni.c] [error] The specified module could not be found. [2008-08-28 05:56:52] [994 prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll [2008-08-28 05:56:52] [1269 prunsrv.c] [error] ServiceStart returned 1 [2008-08-28 05:56:52] [info] Run service finished. [2008-08-28 05:56:52] [info] Procrun finished. [2008-08-28 05:57:06] [info] Procrun (2.0.4.0) started [2008-08-28 05:57:06] [info] Running Service... [2008-08-28 05:57:06] [info] Starting service... [2008-08-28 05:57:06] [174 javajni.c] [error] The specified module could not be found. [2008-08-28 05:57:06] [994 prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll [2008-08-28 05:57:06] [1269 prunsrv.c] [error] ServiceStart returned 1 [2008-08-28 05:57:06] [info] Run service finished. [2008-08-28 05:57:06] [info] Procrun finished. stderr and stdout logs are empty. Any hint will be highly appreaciated. Benny
Re: Can't execute servlet project
The jndi resource howto page link I posted should have mentioned the .jar file get's placed in tomcat's common/lib. --David sam wun wrote: Hi, I couldn't find an installation document about installing the driver. I;ve downloaded the driver: linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls mysql-connector-java-5.1.3-rc-bin.jar mysql-connector-java-5.1.3-rc-bin.jar Do you know how to configure tomcat to make use of it? Thanks Sam - Original Message - From: Pid Sent: 28/08/08 06:47 pm To: Tomcat Users List Subject: Re: Can't execute servlet project sam wun wrote: Do I need to put mysql driver in the common/lib/ directory in linux? Yes, that's a basic requirement. If I need to have that, where can I download it? The MySQL site - you could probably have guessed that. http://dev.mysql.com/usingmysql/java/ Thanks - Original Message - From: sam wun Sent: 28/08/08 04:44 pm To: Tomcat Users List Subject: Re: Re: Can't execute servlet project HI there, According to the tomcat online document, do I have to modify the context.xml file? $CATALINA_HOME/conf/context.xml with the following new setup: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/javatest?autoReconnect=true/ where username/password is the root/admin user/password of the mysql database? thanks - Original Message - From: David Smith Sent: 28/08/08 03:06 am To: Tomcat Users List Subject: Re: Can't execute servlet project The datasource for your webapp isn't setup correctly. Take a look at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html for help on how to properly setup a database connection pool. My only edit that article I would recommend is don't add ?autoReconnect=true to the end of the mysql database url. Instead, add validationQuery=select 1 to the Resource ... / element in your context.xml file so connections are tested and regenerated as needed. --David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: errors in deploying war file to tomcat 5.5
Hi, sam wun! It is https://issues.apache.org/bugzilla/show_bug.cgi?id=44463 The problem is in the manager application, not in yours. The commons-io*.jar should be placed into {your tomcat 5.5 installation folder}/server/webapps/manager/WEB-INF/lib Best regards, Konstantin Kolinko 2008/8/23 sam wun [EMAIL PROTECTED]: Hi, I tried to deploy a war file (built from Eclipse in windows) into tomcat 5.5(in linux). I got the following errors: Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost' Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Global resources are available Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' Aug 24, 2008 12:32:53 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' Aug 24, 2008 12:33:24 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet HTMLManager threw exception java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream at org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:103) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:350) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) What is the problem and how to fix it? Your suggestion is highly appreciated. Thanks Sam - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't execute servlet project
The docs should have been clear the context.xml to modify would exist in one of a couple of places: - context.xml file in DbTest/META-INF - DbTest.xml in $CATALINA_HOME/conf/Catalina/localhost Also username/password for the db connection should *NOT* be the root/admin user/password for your database. That's just a huge, crazy security hole waiting to be exploited. Create a new user in MySQL with privileges on the javatest database and use that in the Resource username and password attributes. You can do this easily using the MySQL command line tool (and the root MySQL account): grant all on javatest.* to 'mywebappuser'@'localhost' identified by 'mywebapppassword' ; This creates a user named 'mywebappuser' with full privileges on the javatest tables. Because I added @'localhost' in the command, the user account is only valid when the user log's in from the same machine MySQL is running on. That helps protect the db server. Then the Resource element becomes: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=mywebappuser password=mywebapppassword driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/javatest validationQuery=select 1/ Note I also dropped ?autoReconnect=true from the url (bad idea to leave that in, I should submit a patch to the tomcat docs at some point), replacing it with a new attribute: validationQuery=select 1 --David sam wun wrote: HI there, According to the tomcat online document, do I have to modify the context.xml file? $CATALINA_HOME/conf/context.xml with the following new setup: Resource name=jdbc/TestDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/javatest?autoReconnect=true/ where username/password is the root/admin user/password of the mysql database? thanks - Original Message - From: David Smith Sent: 28/08/08 03:06 am To: Tomcat Users List Subject: Re: Can't execute servlet project The datasource for your webapp isn't setup correctly. Take a look at http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html for help on how to properly setup a database connection pool. My only edit that article I would recommend is don't add ?autoReconnect=true to the end of the mysql database url. Instead, add validationQuery=select 1 to the Resource ... / element in your context.xml file so connections are tested and regenerated as needed. --David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5 won't use APR
Hi Mark, On Thu, Aug 28, 2008 at 1:15 PM, Mark Thomas [EMAIL PROTECTED] wrote: Is the right listener defined in web.xml? hm, what do you mean by right listener? and what web.xml? I figure you mean $catalina_home/conf/web.xml? As a how-two I used the tomcat-docs as described here http://tomcat.apache.org/tomcat-5.5-doc/apr.html, and I don't see any remark about specifying any listener. What I see is, that the HTTP-connector now can take some more attributes. I also guess that the term HTTP-connector refers to the entry Connector port=8080 / in $catalina_home/conf, or am I wrong? Cheers Gregor -- what's puzzlin' you, is the nature of my game gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5 won't use APR
Gregor Schneider wrote: Hi Mark, On Thu, Aug 28, 2008 at 1:15 PM, Mark Thomas [EMAIL PROTECTED] wrote: Is the right listener defined in web.xml? hm, what do you mean by right listener? and what web.xml? I figure you mean $catalina_home/conf/web.xml? As a how-two I used the tomcat-docs as described here http://tomcat.apache.org/tomcat-5.5-doc/apr.html, and I don't see any remark about specifying any listener. What I see is, that the HTTP-connector now can take some more attributes. I also guess that the term HTTP-connector refers to the entry Connector port=8080 / in $catalina_home/conf, or am I wrong? Sorry, I meant server.xml. The APR listener needs to be present (it is by default). Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Why GlassFish
Hi, Just a quick question, I found that Tomcat is quite capable with servlet application, but lack of EJB support. Is GlassFish designed to fill the gaps to support EJB application only? Thanks
mod_jk help!
I am currently using mod_jk as the connector and I have Apache as a front for tomcat5 by adding something like JkMount /helloworld/* ajp13 to the httpd.conf So when I go to www.domain.com/helloworld/ it forwards the request to tomcat and looks for the webapp who's context path is helloworld. This is all fine and good but what if i wanted something like www.domain.com/test/helloworld and i use JkMount /test/helloworld/* ajp13 how do i create the mapping then? Does it try to look for an app context path of /test/helloworld?? In tomcat can you even have an web application with that sort of path? Currently I have my Host container in server.xml set to www.domain.com, i even tried to www.domain.com/test/ but i dont think that did anything. -- View this message in context: http://www.nabble.com/mod_jk-help%21-tp19200757p19200757.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why GlassFish
On Aug 28, 2008, at 9:31 AM, sam wun wrote: Hi, Just a quick question, I found that Tomcat is quite capable with servlet application, but lack of EJB support. Is GlassFish designed to fill the gaps to support EJB application only? As Pythagoras said, just say no to beans. Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IPv6 support for Tomcat 5.0.28
Hi, I have been trying to figure out if Tomcat 5.0.28 will support an IPv6 only network. I have read a few messages that mention that during startup tomcat will still try to bind to 127.0.0.1, but there was no resolution to the problem. So does anyone know if Tomcat 5.0.28 will work in an IPv6 only network where IPv4 is disabled? Thanks in advance,=20 Richard Kao Richard Kao CA Senior Director, Software Engineering Tel: +1-609-583-9495 [EMAIL PROTECTED] http://www.ca.com
Re: mod_jk help!
WillF wrote: I am currently using mod_jk as the connector and I have Apache as a front for tomcat5 by adding something like JkMount /helloworld/* ajp13 to the httpd.conf So when I go to www.domain.com/helloworld/ it forwards the request to tomcat and looks for the webapp who's context path is helloworld. This is all fine and good but what if i wanted something like www.domain.com/test/helloworld and i use JkMount /test/helloworld/* ajp13 how do i create the mapping then? Does it try to look for an app context path of /test/helloworld?? In tomcat can you even have an web application with that sort of path? Yes and yes. For multi-level context paths see e.g. http://tomcat.apache.org/tomcat-5.5-doc/config/context.html and look out for the character #. Currently I have my Host container in server.xml set to www.domain.com, i even tried to www.domain.com/test/ but i dont think that did anything. If you want to have a direct context path on the front end Apache then on the backend Tomcat, you can rewrite Requests and Location headers (Redirect) with mod_rewrite, but that's a little tedious and can be easily broken by the webapp (which can then be fixed with even ,more work with mod_substitute). Think twice, if you really need different context paths on the frontend and on the backend. For the request rewriting and redirect/cookie manipulation, mod_proxy might be in better shape then mod_jk (which has other strengths but not especially this area), for the correction of wrong links embedded in content, you might want to look ak mod_substitute, mod_sed or mod_proxy_html (note: mod_proxy_html != mod_proxy_http). Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk help!
What are some best practices surrounding explicitly specifying context path? I remember reading somewhere that said it is ignored and should not be used? Is there any truth to this? Instead of mod_jk do you think mod_proxy would make things easier for something like this? Rainer Jung-3 wrote: WillF wrote: I am currently using mod_jk as the connector and I have Apache as a front for tomcat5 by adding something like JkMount /helloworld/* ajp13 to the httpd.conf So when I go to www.domain.com/helloworld/ it forwards the request to tomcat and looks for the webapp who's context path is helloworld. This is all fine and good but what if i wanted something like www.domain.com/test/helloworld and i use JkMount /test/helloworld/* ajp13 how do i create the mapping then? Does it try to look for an app context path of /test/helloworld?? In tomcat can you even have an web application with that sort of path? Yes and yes. For multi-level context paths see e.g. http://tomcat.apache.org/tomcat-5.5-doc/config/context.html and look out for the character #. Currently I have my Host container in server.xml set to www.domain.com, i even tried to www.domain.com/test/ but i dont think that did anything. If you want to have a direct context path on the front end Apache then on the backend Tomcat, you can rewrite Requests and Location headers (Redirect) with mod_rewrite, but that's a little tedious and can be easily broken by the webapp (which can then be fixed with even ,more work with mod_substitute). Think twice, if you really need different context paths on the frontend and on the backend. For the request rewriting and redirect/cookie manipulation, mod_proxy might be in better shape then mod_jk (which has other strengths but not especially this area), for the correction of wrong links embedded in content, you might want to look ak mod_substitute, mod_sed or mod_proxy_html (note: mod_proxy_html != mod_proxy_http). Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/mod_jk-help%21-tp19200757p19202129.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk help!
WillF wrote: What are some best practices surrounding explicitly specifying context path? E.g. naming the war file like the context path, replacing '/' by '#'. Or using a context descriptor (the xml file that's called context.xml inside your webapp/META-INF resp. my#webapp#something.xml inside CATALINA_BASE/conf/ENGINE/HOST. I remember reading somewhere that said it is ignored and should not be used? Is there any truth to this? No, you shouldn't define things like that in server.xml, and it's best to simply name the war file correctly. Instead of mod_jk do you think mod_proxy would make things easier for something like this? Easier for changing the request URLs and fixing Redirect and Cookie paths. Not easier with respect to wrong links in request pages themselves. Regards, Rainer Rainer Jung-3 wrote: WillF wrote: I am currently using mod_jk as the connector and I have Apache as a front for tomcat5 by adding something like JkMount /helloworld/* ajp13 to the httpd.conf So when I go to www.domain.com/helloworld/ it forwards the request to tomcat and looks for the webapp who's context path is helloworld. This is all fine and good but what if i wanted something like www.domain.com/test/helloworld and i use JkMount /test/helloworld/* ajp13 how do i create the mapping then? Does it try to look for an app context path of /test/helloworld?? In tomcat can you even have an web application with that sort of path? Yes and yes. For multi-level context paths see e.g. http://tomcat.apache.org/tomcat-5.5-doc/config/context.html and look out for the character #. Currently I have my Host container in server.xml set to www.domain.com, i even tried to www.domain.com/test/ but i dont think that did anything. If you want to have a direct context path on the front end Apache then on the backend Tomcat, you can rewrite Requests and Location headers (Redirect) with mod_rewrite, but that's a little tedious and can be easily broken by the webapp (which can then be fixed with even ,more work with mod_substitute). Think twice, if you really need different context paths on the frontend and on the backend. For the request rewriting and redirect/cookie manipulation, mod_proxy might be in better shape then mod_jk (which has other strengths but not especially this area), for the correction of wrong links embedded in content, you might want to look ak mod_substitute, mod_sed or mod_proxy_html (note: mod_proxy_html != mod_proxy_http). Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat, APR and OpenSSL
And the story continues OS: Debian Etch Tomcat: 5.5.20 Java: 1.5.0_10-b03 Happily having setup TC Native and APR, now I'm trying to configure SSL Since I'm using the APR, Tomcat uses OpenSSL instead of the JSSE-implementation - ok, got that: I created my connector in $CATALINA_HOME/conf/server.xml: Connector port=8443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true SSLEngine=on SSLCertificateFile=${catalina.base}/certs/mycert.crt SSLCertificateKeyFile=${catalina.base}/certs/mycert.key / The cert-files are from a different server of my company (meaning not valid for this very ip-adress), however, for testing-purposes I don't mind getting a warning when calling the test-web-page. However, when starting Tomcat, I can see that Tomcat is listening on the specified port, but it doesn't load my web-apps and seems to be hanging: tcp6 0 0 :::8080 :::*LISTEN - tcp6 0 0 :::80 :::*LISTEN - tcp6 0 0 :::22 :::*LISTEN - tcp6 0 0 :::8443 :::*LISTEN - tcp6 0 0 :::443 :::*LISTEN - I've started jsvc with the -debug-option, and here is some of it's output: 28/08/2008 18:07:56 6474 jsvc.exec debug: Running w/ LD_LIBRARY_PATH=/home/tomcat/www/bin/tomcat-native-1.1.3/jni/native/.libs:/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client:/usr/lib/jvm/java-1.5.0-sun/jre/lib/i386 When I finally stop Tomcat, I get an error-message : 28/08/2008 18:07:56 6478 jsvc.exec debug: user changed to 'tomcat' 28/08/2008 18:07:56 6478 jsvc.exec debug: Using default JVM in /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client/libjvm.so 28/08/2008 18:07:56 6478 jsvc.exec debug: Attemtping to load library /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client/libjvm.so 28/08/2008 18:07:56 6478 jsvc.exec debug: JVM library /usr/lib/jvm/java-1.5.0-sun/jre/lib/i386/client/libjvm.so loaded 28/08/2008 18:07:56 6478 jsvc.exec debug: JVM library entry point found (0xB777BE60) 28/08/2008 18:07:56 6478 jsvc.exec debug: +-- DUMPING JAVA VM CREATION ARGUMENTS - 28/08/2008 18:07:56 6478 jsvc.exec debug: | Version: 10004 28/08/2008 18:07:56 6478 jsvc.exec debug: | Ignore Unrecognized Arguments: False 28/08/2008 18:07:56 6478 jsvc.exec debug: | Extra options: 7 28/08/2008 18:07:56 6478 jsvc.exec debug: | -Dcatalina.home=/home/tomcat/www/ (0x) 28/08/2008 18:07:56 6478 jsvc.exec debug: | -Dcatalina.base=/home/tomcat/www (0x) 28/08/2008 18:07:56 6478 jsvc.exec debug: | -Djava.io.tmpdir=/var/tmp (0x) 28/08/2008 18:07:56 6478 jsvc.exec debug: | -Dlog4j.configuration=log4j.xml (0x) 28/08/2008 18:07:56 6478 jsvc.exec debug: | -Djava.library.path=/home/tomcat/www/bin/tomcat-native-1.1.3/jni/native/.libs (0x) 28/08/2008 18:07:56 6478 jsvc.exec debug: | -Djava.class.path=/usr/lib/jvm/java-1.5.0-sun/lib/tools.jar:/home/tomcat/www//bin/commons-daemon.jar:/home/tomc at/www//bin/bootstrap.jar (0x) 28/08/2008 18:07:56 6478 jsvc.exec debug: +--- 28/08/2008 18:07:56 6478 jsvc.exec debug: Java VM created successfully 28/08/2008 18:07:56 6478 jsvc.exec debug: Class org/apache/commons/daemon/support/DaemonLoader found 28/08/2008 18:07:56 6478 jsvc.exec debug: Native methods registered 28/08/2008 18:10:08 6477 jsvc.exec error: Service exit with a return value of 143 When I take a look at tomcat.log.info, I can see that Tomcat started to hang after having configured port 8080: 2008-08-28 18:07:58,994 INFO[main]: An older version 1.1.3 of the Apache Tomcat Native library is installed, while Tomcat recommends versi on greater than 1.1.4 2008-08-28 18:07:59,884 INFO[main]: Initializing Coyote HTTP/1.1 on http-8080 Well, now I'm running out of ideas... What I do know is, that the OpenSSL-libraries are not in the LD_LIBRARY_PATH specified (-Djava.library.path=/home/tomcat/www/bin/tomcat-native-1.1.3/jni/native/.libs ) - is it necessary to tell jsvc where to look for them? Since I had to specify them during compilation of Tomcat Native, I thought this would be needed...?? Any hints to solve that issue much appreciated! Gregor -- what's puzzlin' you, is the nature of my game gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5, connection pooling with commons-dbcp 1.2.1
I have configured my web app to use tomcat's connection pooling. and also I have modfied the default value of the factory attribute: factory=org.apache.commons.dbcp.BasicDataSourceFactory Here is the context.xml Context Resource name=jdbc/testDB factory=org.apache.commons.dbcp.BasicDataSourceFactory auth=Container type=javax.sql.DataSource maxActive=10 maxIdle=5 maxWait=1 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true username=username password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test / /Context Here is how I retrieve the data source so that I later can ask for a connection: private static BasicDataSource ds = null; public static DataSource getDataSource() throws SQLException { if (ds == null) { try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/testDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } I have read somewhere that you have to create a PoolingDataSource if you want use connection pooling. Here is a sample code that I have found: GenericObjectPool connectionPool = new GenericObjectPool(null); DriverManagerConnectionFactory connectionFactory = new DriverConnectionFactory(jdbc:some:connect:string,null); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true); PoolingDataSource dataSource = new PoolingDataSource(connectionPool); Question: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Or do I have to include a few lines of complicated as above as well? Thanks! -- View this message in context: http://www.nabble.com/Tomcat-5.5%2C-connection-pooling-with-commons-dbcp-1.2.1-tp19204896p19204896.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, connection pooling with commons-dbcp 1.2.1
When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Essentially yes. You still have to be sure you close your database objects, but the rest is done by DBCP. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Yes. Implement finally blocks on your try/catch exception management to guarantee they are closed and returned to the database pool regardless of outcome. Or do I have to include a few lines of complicated as above as well? Nope. The BasicDataSourceFactory class will handle that stuff for you. The code you cite below looks like it's for when you are creating the pool and managing it yourself, which you aren't doing in this case. Also you didn't mention it, but I'm assuming your one and only copy of the DBCP jar file is in common/lib for tomcat 5 or /lib for tomcat 6, right? --David jerrycat wrote: I have configured my web app to use tomcat's connection pooling. and also I have modfied the default value of the factory attribute: factory=org.apache.commons.dbcp.BasicDataSourceFactory Here is the context.xml Context Resource name=jdbc/testDB factory=org.apache.commons.dbcp.BasicDataSourceFactory auth=Container type=javax.sql.DataSource maxActive=10 maxIdle=5 maxWait=1 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true username=username password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test / /Context Here is how I retrieve the data source so that I later can ask for a connection: private static BasicDataSource ds = null; public static DataSource getDataSource() throws SQLException { if (ds == null) { try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/testDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } I have read somewhere that you have to create a PoolingDataSource if you want use connection pooling. Here is a sample code that I have found: GenericObjectPool connectionPool = new GenericObjectPool(null); DriverManagerConnectionFactory connectionFactory = new DriverConnectionFactory(jdbc:some:connect:string,null); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true); PoolingDataSource dataSource = new PoolingDataSource(connectionPool); Question: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Or do I have to include a few lines of complicated as above as well? Thanks! -- David Smith Programmer/Analyst College of Agriculture and Life Sciences Cornell University B32 Morrison Hall Ithaca, NY 14853 Phone: (607) 255-4521 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, connection pooling with commons-dbcp 1.2.1
No, I have commons-dbcp.1.2.2 jar in the lib directory of all of my web app as well. Should I remove the commons-dbcp1.2.2.jar from the web apps and put the jar files in the common/lib directory. The jar files are: commons-dbcp-1.2.2 commons-pool-1.3 I assume that the naming-factory-dbcp.jar that comes with tomcat under common/lib do not include the above jars. Thanks again. David Smith-2 wrote: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Essentially yes. You still have to be sure you close your database objects, but the rest is done by DBCP. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Yes. Implement finally blocks on your try/catch exception management to guarantee they are closed and returned to the database pool regardless of outcome. Or do I have to include a few lines of complicated as above as well? Nope. The BasicDataSourceFactory class will handle that stuff for you. The code you cite below looks like it's for when you are creating the pool and managing it yourself, which you aren't doing in this case. Also you didn't mention it, but I'm assuming your one and only copy of the DBCP jar file is in common/lib for tomcat 5 or /lib for tomcat 6, right? --David jerrycat wrote: I have configured my web app to use tomcat's connection pooling. and also I have modfied the default value of the factory attribute: factory=org.apache.commons.dbcp.BasicDataSourceFactory Here is the context.xml Context Resource name=jdbc/testDB factory=org.apache.commons.dbcp.BasicDataSourceFactory auth=Container type=javax.sql.DataSource maxActive=10 maxIdle=5 maxWait=1 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true username=username password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test / /Context Here is how I retrieve the data source so that I later can ask for a connection: private static BasicDataSource ds = null; public static DataSource getDataSource() throws SQLException { if (ds == null) { try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/testDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } I have read somewhere that you have to create a PoolingDataSource if you want use connection pooling. Here is a sample code that I have found: GenericObjectPool connectionPool = new GenericObjectPool(null); DriverManagerConnectionFactory connectionFactory = new DriverConnectionFactory(jdbc:some:connect:string,null); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true); PoolingDataSource dataSource = new PoolingDataSource(connectionPool); Question: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Or do I have to include a few lines of complicated as above as well? Thanks! -- David Smith Programmer/Analyst College of Agriculture and Life Sciences Cornell University B32 Morrison Hall Ithaca, NY 14853 Phone: (607) 255-4521 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Tomcat-5.5%2C-connection-pooling-with-commons-dbcp-1.2.1-tp19204896p19205409.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat ssl problems with funambol 7.0.4 bundle
Okay, working to get the Funambol linux server bundle to work with ssl for syncing email with my pda/cellphone https://www.forge.funambol.org/download/ It uses tomcat and I've followed the instructions here https://wiki.objectweb.org/sync4j/Wiki.jsp?page=HowtouseHttps http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html and here http://blogs.sun.com/swchan/entry/how_to_use_verisign_cert I've created a keystore file as /opt/Funambol/tools/tomcat/conf/keystore.jks I've imported the ca chained cert (godaddy) and the actual cert into the said keystore, the relevant section in /opt/Funambol/tools/tomcat/conf/server.xml Connector port=8443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true keystorefile=/opt/Funambol/tools/tomcat/conf/keystore.jks clientAuth=false sslProtocol=TLS / I've restarted funambol using the supplied init scrip which restarts tomcat, but when I goto lynx https://localhost:8443/funambol/ds I get lynx https://localhost:8443/funambol Looking up localhost:8443 Making HTTPS connection to localhost:8443 Retrying connection without TLS. Looking up localhost:8443 Making HTTPS connection to localhost:8443 Alert!: Unable to make secure connection to remote host. lynx: Can't access startfile https://localhost:8443/funambol https://servername (same as cert CN):8443/funambol/ds or https://ipaddress:8443/funambol/ds I just get a message in the browser (ff 2.x)that the connection was interrupted, same class of error in any other browser From the end of cat ../../tomcat/logs/catalina.out Aug 27, 2008 11:58:45 PM org.apache.catalina.loader.WebappClassLoader validateJarFile INFO: validateJarFile(/opt/Funambol/tools/tomcat/webapps/webdemo/WEB- INF/lib/servlet-api-2.3.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class Starting configuration monitor [funambol-directory-monitor-17ba38f] on: /opt/Funambol/config Aug 27, 2008 11:58:47 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Aug 27, 2008 11:58:48 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8443 log4j:WARN No appenders could be found for logger (org.apache.axis.transport.http.AxisServlet). log4j:WARN Please initialize the log4j system properly. Aug 27, 2008 11:58:48 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Aug 27, 2008 11:58:48 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/191 config=null Aug 27, 2008 11:58:48 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 9748 ms The non ssl page works fine and shows what I would expect, and syncing without ssl works fine. Funambol DS Server Version 7.0.4 Web Demo Client Terms Conditions Any ideas what I am missing here, I've been banging my head against this for a couple of days and have done a LOT of reading -- Harondel J. Sibble Sibble Computer Consulting Creating solutions for the small business and home computer user. [EMAIL PROTECTED] (use pgp keyid 0x3AD5C11D) http://www.pdscc.com (604) 739-3709 (voice/fax) (604) 686-2253 (pager) - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, connection pooling with commons-dbcp 1.2.1
Yes, remove all copies except one and that one should be in the common/lib directory. It has to be in common/lib to essentially be visible to both tomcat internal code as well as all the webapps. There can't be a copy anywhere else in tomcat because ... well I'll let the classloader how-to on tomcat's website explain that: http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html (assuming you have tomcat 5.5.x). What it comes down to is there can't be two of the same class (package name and class name) visible from different classloaders. Tomcat internal code will see the one in common/lib first, your webapps will see it's own copy first and you'll end up with many a wonderous and strange error to ask us about. --David jerrycat wrote: No, I have commons-dbcp.1.2.2 jar in the lib directory of all of my web app as well. Should I remove the commons-dbcp1.2.2.jar from the web apps and put the jar files in the common/lib directory. The jar files are: commons-dbcp-1.2.2 commons-pool-1.3 I assume that the naming-factory-dbcp.jar that comes with tomcat under common/lib do not include the above jars. Thanks again. David Smith-2 wrote: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Essentially yes. You still have to be sure you close your database objects, but the rest is done by DBCP. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Yes. Implement finally blocks on your try/catch exception management to guarantee they are closed and returned to the database pool regardless of outcome. Or do I have to include a few lines of complicated as above as well? Nope. The BasicDataSourceFactory class will handle that stuff for you. The code you cite below looks like it's for when you are creating the pool and managing it yourself, which you aren't doing in this case. Also you didn't mention it, but I'm assuming your one and only copy of the DBCP jar file is in common/lib for tomcat 5 or /lib for tomcat 6, right? --David jerrycat wrote: I have configured my web app to use tomcat's connection pooling. and also I have modfied the default value of the factory attribute: factory=org.apache.commons.dbcp.BasicDataSourceFactory Here is the context.xml Context Resource name=jdbc/testDB factory=org.apache.commons.dbcp.BasicDataSourceFactory auth=Container type=javax.sql.DataSource maxActive=10 maxIdle=5 maxWait=1 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true username=username password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test / /Context Here is how I retrieve the data source so that I later can ask for a connection: private static BasicDataSource ds = null; public static DataSource getDataSource() throws SQLException { if (ds == null) { try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/testDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } I have read somewhere that you have to create a PoolingDataSource if you want use connection pooling. Here is a sample code that I have found: GenericObjectPool connectionPool = new GenericObjectPool(null); DriverManagerConnectionFactory connectionFactory = new DriverConnectionFactory(jdbc:some:connect:string,null); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true); PoolingDataSource dataSource = new PoolingDataSource(connectionPool); Question: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Or do I have to include a few lines of complicated as above as well? Thanks! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, connection pooling with commons-dbcp 1.2.1
David Smith wrote: Yes, remove all copies except one and that one should be in the common/lib directory. It has to be in common/lib to essentially be visible to both tomcat internal code as well as all the webapps. There can't be a copy anywhere else in tomcat because ... well I'll let the classloader how-to on tomcat's website explain that: http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html (assuming you have tomcat 5.5.x). What it comes down to is there can't be two of the same class (package name and class name) visible from different classloaders. Tomcat internal code will see the one in common/lib first, your webapps will see it's own copy first and you'll end up with many a wonderous and strange error to ask us about. Tomcat already contains all DBCP/Pool classes it needs to provide the DataSources configured in server.xml or context.ml. Look at the contents of ${CATALINA_HOME}/common/lib/naming-factory-dbcp.jar It contains dbcp, but in a repackaged form (name of Java package changed, so that it doesn't collide with webapp provided ones). It is also mentioned shortly in the RELEASE-NOTES file in ${CATALINA_HOME}. Regards, Rainer --David jerrycat wrote: No, I have commons-dbcp.1.2.2 jar in the lib directory of all of my web app as well. Should I remove the commons-dbcp1.2.2.jar from the web apps and put the jar files in the common/lib directory. The jar files are: commons-dbcp-1.2.2 commons-pool-1.3 I assume that the naming-factory-dbcp.jar that comes with tomcat under common/lib do not include the above jars. Thanks again. David Smith-2 wrote: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Essentially yes. You still have to be sure you close your database objects, but the rest is done by DBCP. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Yes. Implement finally blocks on your try/catch exception management to guarantee they are closed and returned to the database pool regardless of outcome. Or do I have to include a few lines of complicated as above as well? Nope. The BasicDataSourceFactory class will handle that stuff for you. The code you cite below looks like it's for when you are creating the pool and managing it yourself, which you aren't doing in this case. Also you didn't mention it, but I'm assuming your one and only copy of the DBCP jar file is in common/lib for tomcat 5 or /lib for tomcat 6, right? --David jerrycat wrote: I have configured my web app to use tomcat's connection pooling. and also I have modfied the default value of the factory attribute: factory=org.apache.commons.dbcp.BasicDataSourceFactory Here is the context.xml Context Resource name=jdbc/testDB factory=org.apache.commons.dbcp.BasicDataSourceFactory auth=Container type=javax.sql.DataSource maxActive=10 maxIdle=5 maxWait=1 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true username=username password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test / /Context Here is how I retrieve the data source so that I later can ask for a connection: private static BasicDataSource ds = null; public static DataSource getDataSource() throws SQLException { if (ds == null) { try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/testDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } I have read somewhere that you have to create a PoolingDataSource if you want use connection pooling. Here is a sample code that I have found: GenericObjectPool connectionPool = new GenericObjectPool(null); DriverManagerConnectionFactory connectionFactory = new DriverConnectionFactory(jdbc:some:connect:string,null); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true); PoolingDataSource dataSource = new PoolingDataSource(connectionPool); Question: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Or do I have to include a few
Re: Why GlassFish
- Original Message - From: sam wun [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, August 28, 2008 3:31 PM Subject: Why GlassFish Hi, Just a quick question, I found that Tomcat is quite capable with servlet application, but lack of EJB support. Is GlassFish designed to fill the gaps to support EJB application only? Ha ha... time to have some fun... They stole Tomcat... and messed it up ;) On a more serious not (if I can do it)... J2EE is a bit of a confusing definition... its got a wide scope. Within that... you have servlet containers... like Tomcat... aimed at the web but are actually capable of just about anything in a POJO designers hands. And then you get EJB what the hell does it do again... oh yes, it runs beans, and you have to join AA and find a good therapist ;) Tomcat can also do beans but they have rolled it up into what they call biz logic, and tried to add many other tools, like for example they also plug RMI into it so you can call it from other Java applications, not just from a browser... They overlap alot... but they are different tools In general... WEB == TOMCAT And its true that Tomcat is inside Glassfish somewhere... in fact if you drop a war into the fish... it will probably work... but not the other way around. Thats why some people in this group... with doubtful principles... say things like... something fishy going on, or I just like my pussy ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, connection pooling with commons-dbcp 1.2.1
Thanks, that really helped. David Smith-2 wrote: Yes, remove all copies except one and that one should be in the common/lib directory. It has to be in common/lib to essentially be visible to both tomcat internal code as well as all the webapps. There can't be a copy anywhere else in tomcat because ... well I'll let the classloader how-to on tomcat's website explain that: http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html (assuming you have tomcat 5.5.x). What it comes down to is there can't be two of the same class (package name and class name) visible from different classloaders. Tomcat internal code will see the one in common/lib first, your webapps will see it's own copy first and you'll end up with many a wonderous and strange error to ask us about. --David jerrycat wrote: No, I have commons-dbcp.1.2.2 jar in the lib directory of all of my web app as well. Should I remove the commons-dbcp1.2.2.jar from the web apps and put the jar files in the common/lib directory. The jar files are: commons-dbcp-1.2.2 commons-pool-1.3 I assume that the naming-factory-dbcp.jar that comes with tomcat under common/lib do not include the above jars. Thanks again. David Smith-2 wrote: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Essentially yes. You still have to be sure you close your database objects, but the rest is done by DBCP. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Yes. Implement finally blocks on your try/catch exception management to guarantee they are closed and returned to the database pool regardless of outcome. Or do I have to include a few lines of complicated as above as well? Nope. The BasicDataSourceFactory class will handle that stuff for you. The code you cite below looks like it's for when you are creating the pool and managing it yourself, which you aren't doing in this case. Also you didn't mention it, but I'm assuming your one and only copy of the DBCP jar file is in common/lib for tomcat 5 or /lib for tomcat 6, right? --David jerrycat wrote: I have configured my web app to use tomcat's connection pooling. and also I have modfied the default value of the factory attribute: factory=org.apache.commons.dbcp.BasicDataSourceFactory Here is the context.xml Context Resource name=jdbc/testDB factory=org.apache.commons.dbcp.BasicDataSourceFactory auth=Container type=javax.sql.DataSource maxActive=10 maxIdle=5 maxWait=1 removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true username=username password=password driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test / /Context Here is how I retrieve the data source so that I later can ask for a connection: private static BasicDataSource ds = null; public static DataSource getDataSource() throws SQLException { if (ds == null) { try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/testDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } I have read somewhere that you have to create a PoolingDataSource if you want use connection pooling. Here is a sample code that I have found: GenericObjectPool connectionPool = new GenericObjectPool(null); DriverManagerConnectionFactory connectionFactory = new DriverConnectionFactory(jdbc:some:connect:string,null); PoolableConnectionFactory poolableConnectionFactory = new PoolableConnectionFactory(connectionFactory,connectionPool,null,null,false,true); PoolingDataSource dataSource = new PoolingDataSource(connectionPool); Question: When getting the DataSource (Or BasicDataSource in my case) from tomcat's JNDI/JDBC service does Tomcat manage the connection pooling itself. Do I just need to retrieve the DataSource and then get the Connection and close the Connection after usage? Or do I have to include a few lines of complicated as above as well? Thanks!
Re: Setting up Comet on Tomcat 6
Filip: I set up the server.xml with the connector and web.xml as you have indicated, but I am unable to get any comet response. I am using tomcat 6.0.16, and it does not seem to recognize the tomcatAuthentication or keepAliveTimeout attributes, and it complains about listeners.ContextListener and listener.SessionListener having already been configured for this context.I do not know if these are relevant here. I have it set up in catalina_home/webapps/comet, with classes and web.xml under catalina_home/webapps/comet/WEB-INF directory. Yes, the class file is in the correct directory, catalina_home/webapps/comet/WEB-INF/classes/testing/comet. The tomcat manager tells me the comet servlet is running, and if I put load-on-startup1/load-on-startup in web.xml I get the 'Comet test servlet initialized.' and Comet test initialized. lines. But no comet response just from hitting http://localhost:3809/comet. Yes, I am using port 3809, and have the connector set up that way with Http11NioProtocol. Any thoughts why this is not working? Thanks Filip Hanik - Dev Lists wrote: I took your servlet, compiled it, put it in WEB-INF/classes/testing/comet then in web.xml I put servlet servlet-nametestcomet/servlet-name servlet-classtesting.comet.CometConnection/servlet-class /servlet servlet-mapping servlet-nametestcomet/servlet-name url-pattern/comet/url-pattern /servlet-mapping server.xml has Connector port=8080 protocol=org.apache.coyote.http11.Http11NioProtocol connectionTimeout=1 tomcatAuthentication=false keepaliveTimeout=5000 backlog=50 maxThreads=300 / hit http://localhost:8080/comet with my browser, output is Comet test servlet initialized. Comet test initialized. Received event BEGIN Filip Talal Rabaa wrote: package testing.comet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.catalina.CometEvent; import org.apache.catalina.CometProcessor; public class CometConnection extends HttpServlet implements CometProcessor { public CometConnection() { System.err.println(Comet test servlet initialized.); } public void init() { System.err.println(Comet test initialized.); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { System.err.println(doGet called.); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { System.err.println(doPost called.); } public void event(CometEvent cometEvent) throws IOException, ServletException { System.err.println(Received event + cometEvent.getEventType().toString()); } protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, You must be using the APR or NIO connector to get the event method called.); } } -Original Message- From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2008 1:28 PM To: Tomcat Users List Subject: Re: Setting up Comet on Tomcat 6 send us your test class - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Setting-up-Comet-on-Tomcat-6-tp18711436p19208047.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: antioJarLocking not working
The jar's its probably having issues with are jruby-complete-1.1.3.jar and jruby-rack-0.9.1.jar since those are the ones that were getting locked. Any suggestions on anything else I can try to attempt to resolve it? -- Aaron Mark Thomas wrote: Aaron Axelsen wrote: I set the workdir on the global context - I can see that files are being created there, however that same error still exists. For some reason it insists on looking in Tomcat 6\temp-Foo5 Any suggestions? It looks like a bug in the jar. It might be using a non-portable way to find the file. Mark Mark Thomas wrote: | Aaron Axelsen wrote: | I understand how it works - the problem is that the folder is not | actually getting created. I double checked permissions - and the apache | user does have full permissions to that tomcat 6 folder. Any thoughts? | | The name of the war is temp Foo5.war. I can see folders getting created | inside of the temp folder, but the temp-Foo5 folder inside of the tomcat | 6 directory is not getting created. | | It looks like the lib is looking in the wrong place. If you haven't set an | explicit workDir then underneath %CATALINA_BASE%\work is where I would | expect the war to be unpacked and from what you say, that is what is happening. | | Mark | | | | - | To start a new topic, e-mail: users@tomcat.apache.org | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | | - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Aaron Axelsen [EMAIL PROTECTED] Great hosting, low prices. Modevia Web Services LLC -- http://www.modevia.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ClassNotFoundException when moving from Java 1.5 to 1.6
I have an app currently running on Tomcat 5.5.26/CentOS 4.6/jre1.5.0_16. This configuration is working just fine. But if I run Tomcat with jre1.6.0_07, my application gets a ClassNotFoundException when I try to use it. The application starts up OK, but throws the exception upon first use. If I restart Tomcat under Java 5, all is well again. I am changing nothing but the symlink /usr/java/default when I switch Java versions. The class in question is packaged in WEB-INF/lib/mylib.jar. No doubt of great importance is that the instance of the class is used as a field in an object being returned from a call to a JBoss 4.2.2 EJB session bean on a remote server. JBoss is running under jre1.5.0_14. So is this simply a serialization compatibility problem? Then why am I getting ClassNotFound instead of an unmarshalling error? The class files on both Tomcat and JBoss are the same (compiled once, packaged twice). Leaving no stone unturned, I installed Java 6 on the development JBoss system and configured JBoss to use it, but Tomcat (under Java 6) still gives me ClassNotFoundException. The JBoss server reports no errors. The classes are actually compiled with 1.4 so there should not be any code compatibility problems. So why is Tomcat not finding my classes in WEB-INF/lib when running under Java 6? I really want to get everything running under Java 6 so I can start compiling with that version. Here's the stack trace: 2008-08-28 14:54:46,849 ERROR TP-Processor2 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/online].[LoginServlet] - Servlet.service() for servlet LoginServlet threw exce ption java.lang.reflect.UndeclaredThrowableException at $Proxy1.loginWebUser(Unknown Source) at com.anon.offsite.servlet.LoginServlet.login(Unknown Source) at com.anon.offsite.servlet.LoginServlet.processLogin(Unknown Source) at com.anon.offsite.servlet.LoginServlet.doPost(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.anon.offsite.servlet.NoCacheFilter.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.cluster.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.anon.util.Ticket at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at java.io.ObjectInputStream.resolveClass(Unknown Source) at org.jboss.invocation.MarshalledValueInputStream.resolveClass(MarshalledValueInputStream.java:109) at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source) at java.io.ObjectInputStream.readClassDesc(Unknown Source) at java.io.ObjectInputStream.readArray(Unknown Source) at java.io.ObjectInputStream.readObject0(Unknown Source) at java.io.ObjectInputStream.defaultReadFields(Unknown Source) at java.io.ObjectInputStream.readSerialData(Unknown Source) at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
Unable to find valid Certification Path to Requested Target
Good afternoon, I am trying to quickly implement SSL ability into our existing Apache Tomcat 5.5.23 installation (JDK 1.5.0_12 as base) and have gotten reasonably far but have run into a bit of a wall. I can navigate to https://www.sslhost.com/webapp/ and get the index page and it shows the proper SSL cert attached, but when I try to launch the application (Electronic Medical Record), I am getting the following error: Error Sending POST: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target Details = [SOAPException: faultCode=Error Sending POST: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetURL: I do not believe it is related directly to the EMR product but instead to perhaps the format of the cert I have from Network Solutions. I am using a PFX file for the keystore since this cert, so my server.xml looks like this: Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreType=PKCS12 keystorePass=password keystoreFile=C:\Program Files\Apache Software Foundation\Tomcat 5.5\unitypg.pfx / I believe the error has to do with the fact that the certificate we received from Network Solutions had 3 other certs along with it: AddTrustExternalCARoot.crt, UTNAddTrustServer_CA.crt and NetworkSolutions_CA.crt. I ran the following commands to get these chain certs into the cacerts file (which I presume is what the error is complaining about… I'm new to this): keytool -import -trustcacerts -alias root -file C:\SSLCerts\AddTrustExternalCARoot.crt -keystore C:\Program Files\Java\jdk1.5.0_12\jre\lib\security\cacerts keytool -import -trustcacerts –alias INTER -file C:\SSLCerts\UTNAddTrustServer_CA.crt -keystore C:\Program Files\Java\jdk1.5.0_12\jre\lib\security\cacerts where I ran into a problem perhaps is with the third cert… keytool -import -trustcacerts -alias INTER2 -file C:\SSLCerts\NetworkSolutions_CA.crt -keystore C:\Program Files\Java\jdk1.5.0_12\jre\lib\security\cacerts No where I could find mentioned three certs…. Just a root and an INTER… so what is the extra cert? Is it right to think this is what is causing my error? Thanks for any and all help in advance, it is greatly appreciated! -Craig Regester
Balancing solution which allows graceful partial node migrations
Hi all. This is just a question out of curiousity. Is there a balancer solution that can allow for controlled migration/upgrade of nodes? To explain, suppose you have Apache/mod_jk and you have N Tomcats in balance over that setup, same web application on all of them. Now, suppose you would like to upgrade the application without disrupting the service. Suppose you have fixed a bug. It would be nice if one of the nodes in cluster could be brought out of the cluster, but gracefully. By gracefully I refer to stopping new requests to the node and letting existing requests drain out. When all requests are over, it can be brought down and upgraded. Then it would obviously need to be brought back in. Let us suppose that the new web application is not in semantical inbalanace with the old nodes. Of course, this brings into question what is draining out existing requests? Does that mean open HTTP sessions or just rrunning requests. I suppose, in case of session, we could turn to sticky sessions, right? So, what are your thoughts on the subject? Ever seen something like that in the wild? Or at least in the lab? A balancer that can be reconfigured (almost) online and one that allows for requests to the node being evicted to finish, first. Nix.
Re: antioJarLocking not working
- Original Message - From: Aaron Axelsen [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, August 28, 2008 10:19 PM Subject: Re: antioJarLocking not working The jar's its probably having issues with are jruby-complete-1.1.3.jar and jruby-rack-0.9.1.jar since those are the ones that were getting locked. Any suggestions on anything else I can try to attempt to resolve it? -- Aaron Hi... I have no idea, we actually run mostly on XP and I've never had a locking issue yet... thank goodness, probably because the dev env is windows so it wont get past go to begin with But maybe a good clue would be to explain what actuall happens when you dont use antiJarLocking... ie what happens and what is the actual error when you just run it on a stock standard TC... may wake up a few brilliant minds in the group ;) Thanks... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: antioJarLocking not working
Johnny Kewl wrote: - Original Message - From: Aaron Axelsen [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, August 28, 2008 10:19 PM Subject: Re: antioJarLocking not working The jar's its probably having issues with are jruby-complete-1.1.3.jar and jruby-rack-0.9.1.jar since those are the ones that were getting locked. Any suggestions on anything else I can try to attempt to resolve it? I wouldn't normally recommend it but what happens if you just stick those jars in %CATALINA_HOME%\lib so they are available to every web app and never get reloaded? Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Balancing solution which allows graceful partial node migrations
Nikola Milutinovic wrote: Hi all. This is just a question out of curiousity. Is there a balancer solution that can allow for controlled migration/upgrade of nodes? To explain, suppose you have Apache/mod_jk and you have N Tomcats in balance over that setup, same web application on all of them. Now, suppose you would like to upgrade the application without disrupting the service. Suppose you have fixed a bug. It would be nice if one of the nodes in cluster could be brought out of the cluster, but gracefully. By gracefully I refer to stopping new requests to the node and letting existing requests drain out. When all requests are over, it can be brought down and upgraded. Then it would obviously need to be brought back in. Let us suppose that the new web application is not in semantical inbalanace with the old nodes. Of course, this brings into question what is draining out existing requests? Does that mean open HTTP sessions or just rrunning requests. I suppose, in case of session, we could turn to sticky sessions, right? So, what are your thoughts on the subject? Ever seen something like that in the wild? Or at least in the lab? A balancer that can be reconfigured (almost) online and one that allows for requests to the node being evicted to finish, first. Nix. If you want to drain sessions, you can do that with mod_jk by simply setting load balancer members to state disabled. It will still send requests with routing suffix attached to their session id to the sticky node, but will not send new sessions to the disabled node. It's not perfect in case your users have bookmarked requests with URL encoded sessions but it works well enough very often. How long it takes to drain depends of course a lot on the average session duration. In this scenario cluster could be simply farm, without session replication. If you only want to drain requests, you can do that by setting a load balancer member to stopped. This will immediately stopping forwarding any new requests. In this case you want to add session replication (or use stateless webapps). Both actions are possible via the status worker GUI. What's missing is making the change persistent from the GUI. If you change a workers state only via the GUI and restart Apache, the change will be overwritten by the configuration on disk. So in order to make those changes persist over the next httpd restart, you'll also need to enter it into the config file. Chaning the status in mod_jk does not need you to restart (even gracefully) Apache though. The change applied via the status GUI will immediately become active for all Apache children. And yes, session draining is used in real life environments. Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ERROR Starting 2nd instance of Tomcat
I am trying to run a 2nd instace of tomcat. For this, ive duplicated the tomcat folder and modified the server.xml files with different ports. I've also created a startup script, but when I run the script I am getting this error... Can anyone help please!! [EMAIL PROTECTED] tomcat5-test]# tomcat5-test start In the config file Starting tomcat5-test: [ FAILED ] This is what i get in my catalina.out -sh: line 0: export: `In the config file': not a valid identifier /bin/bash: /usr/bin/tomcat5-test: Permission denied -sh: line 0: export: `In the config file': not a valid identifier /bin/bash: /usr/bin/tomcat5-test: Permission denied This is my startup script... #!/bin/bash # # tomcat5 This shell script takes care of starting and stopping Tomcat # # chkconfig: - 80 20 # ### BEGIN INIT INFO # Provides: tomcat5 # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: # Default-Stop: # Description: Release implementation for Servlet 2.4 and JSP 2.0 # Short-Description: start and stop tomcat ### END INIT INFO # # - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot # - heavily rewritten by Deepak Bhole and Jason Corley # # commented out until the RHEL and FC daemon functions converge # Source the function library #if [ -r /etc/rc.d/init.d/functions ]; then #. /etc/rc.d/init.d/functions #fi NAME=$(basename $0) unset ISBOOT if [ ${NAME:0:1} = S -o ${NAME:0:1} = K ]; then NAME=${NAME:3} ISBOOT=1 fi # For SELinux we need to use 'runuser' not 'su' if [ -x /sbin/runuser ]; then SU=/sbin/runuser else SU=su fi # Get the tomcat config (use this for environment specific settings) TOMCAT_CFG=/etc/tomcat5/tomcat5.conf if [ -r $TOMCAT_CFG ]; then . ${TOMCAT_CFG} fi # Get instance specific config file if [ -r /etc/sysconfig/${NAME} ]; then . /etc/sysconfig/${NAME} fi # Define which connector port to use CONNECTOR_PORT=${CONNECTOR_PORT:-8080} # Path to the tomcat launch script TOMCAT_SCRIPT=/usr/bin/tomcat5-test # Path to the script that will refresh jar symlinks on startup TOMCAT_RELINK_SCRIPT=${CATALINA_HOME}/bin/relink # Tomcat program name TOMCAT_PROG=$NAME # Define the tomcat username TOMCAT_USER=${TOMCAT_USER:-tomcat} # Define the tomcat log file TOMCAT_LOG=${TOMCAT_LOG:-/usr/share/tomcat5-test/logs/logscatalina.out} RETVAL=0 # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function checkpid() { local i for i in $* ; do if [ -d /proc/${i} ]; then return 0 fi done return 1 } # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function echo_failure() { echo -en \\033[60G file:///\\033[60G echo -n [ echo -n $FAILED echo -n ] echo -ne \r return 1 } # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function echo_success() { echo -en \\033[60G file:///\\033[60G echo -n [ echo -n $OK echo -n ] echo -ne \r return 0 } # Look for open ports, as the function name might imply function findFreePorts() { local isSet1=false local isSet2=false local isSet3=false local lower=8000 randomPort1=0 randomPort2=0 randomPort3=0 local -a listeners=( $( netstat -ntl | \ awk '/^tcp/ {gsub((.)*:, , $4); print $4}') ) while [ $isSet1 = false ] || \ [ $isSet2 = false ] || \ [ $isSet3 = false ]; do let port=${lower}+${RANDOM:0:4} if [ -z `expr ${listeners[*]} : .*\( $port \).*` ]; then if [ $isSet1 = false ]; then export randomPort1=$port isSet1=true elif [ $isSet2 = false ]; then export randomPort2=$port isSet2=true elif [ $isSet3 = false ]; then export randomPort3=$port isSet3=true fi fi done } function makeHomeDir() { if [ ! -d $CATALINA_HOME ]; then echo $CATALINA_HOME does not exist, creating if [ ! -d /var/lib/${NAME} ]; then mkdir -p /var/lib/${NAME} cp -pLR /var/lib/tomcat5-test/* /var/lib/${NAME} fi mkdir -p $CATALINA_HOME ${CATALINA_HOME}/conf /var/cache/${NAME}/temp \ /var/cache/${NAME}/work /var/log/${NAME} for i in temp work; do ln -fs /var/cache/${NAME}/${i} ${CATALINA_HOME}/${i} done for i in common server shared webapps; do ln -fs /var/lib/${NAME}/${i} ${CATALINA_HOME}/${i} done ln -fs /var/log/${NAME} ${CATALINA_HOME}/logs cp -pLR /usr/share/tomcat5-test/* ${CATALINA_HOME}/conf/ cp -pLR /usr/share/tomcat5-test/bin $CATALINA_HOME cp -pLR /usr/share/tomcat5-test/* ${CATALINA_HOME}/work/ chown ${TOMCAT_USER}:${TOMCAT_USER} /var/log/${NAME} fi } function parseOptions() { options= options=$options $( awk '!/^#/ !/^$/ { ORS= ; print export , $0, ; }' \ $TOMCAT_CFG ) if [ -r /etc/sysconfig/${NAME} ]; then options=$options $( awk '!/^#/ !/^$/ { ORS= ; print export , $0, ; }' \ /etc/sysconfig/${NAME} ) fi TOMCAT_SCRIPT=$options $TOMCAT_SCRIPT } # See how we were called. function start() { echo -n Starting ${TOMCAT_PROG}: if [ -f /var/lock/subsys/${NAME} ] ; then if [ -f /var/run/${NAME}.pid ]; then read kpid /var/run/${NAME}.pid if checkpid $kpid 21; then echo $NAME process already running return -1 else echo lock file found but no
Re: Issue in connecting to tomcat via Apache
You don't specify exactly what you mean by it fails, but assuming you're saying that requests to Apache aren't getting passed along to Tomcat, your answer is right here: (from httpd.conf) # Send everything for context /examples to worker named worker1 (ajp13) #JkMount /examples/* worker1 if you want everything to go to Tomcat, add a line like: JkMount / worker1 and you're all set. If you want just a certain portion of the url namespace to get passed along to Tomcat, you could use some thing like the commented out example. In that case: http://yourserver/index.html would be served by Apache httpd, but http://yourserver/examples/someexample.jsp would be served by Tomcat. Vasanth Kumar ravi wrote: Hi, I am using the mod_jk to connect the apache webserver and the tomcat server. Though I am able to access them individually, when I try to access the tomcat via the apache webserver, it fails. I used the examples given the apache site to configure the workers.properties and the httpd.conf files. Apache :2.2.8 Tomcat :6.0.16 jdk :1.5.014 from Sun OS : Suse Linux.. -- RegardsThanks, Vasanth Kumar Ravi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Issue in connecting to tomcat via Apache
Hi Larry, Thanks for the headsup. Well I tried using the commented line earlier but it failed. So I tried again by commenting out the JMount parameter. I was trying to access the URL : http://localhost/examples with a JKMount details as follows.. JkMount /examples/* worker1. It did not redirect the request from httpd to the tomcat. So I commented the line JkMount and tried accessing the url, it still failed... Thanks On Fri, Aug 29, 2008 at 9:34 AM, Larry J Prikockis [EMAIL PROTECTED]wrote: You don't specify exactly what you mean by it fails, but assuming you're saying that requests to Apache aren't getting passed along to Tomcat, your answer is right here: (from httpd.conf) # Send everything for context /examples to worker named worker1 (ajp13) #JkMount /examples/* worker1 if you want everything to go to Tomcat, add a line like: JkMount / worker1 and you're all set. If you want just a certain portion of the url namespace to get passed along to Tomcat, you could use some thing like the commented out example. In that case: http://yourserver/index.html would be served by Apache httpd, but http://yourserver/examples/someexample.jsp would be served by Tomcat. Vasanth Kumar ravi wrote: Hi, I am using the mod_jk to connect the apache webserver and the tomcat server. Though I am able to access them individually, when I try to access the tomcat via the apache webserver, it fails. I used the examples given the apache site to configure the workers.properties and the httpd.conf files. Apache :2.2.8 Tomcat :6.0.16 jdk :1.5.014 from Sun OS : Suse Linux.. -- RegardsThanks, Vasanth Kumar Ravi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- RegardsThanks, Vasanth Kumar Ravi
Re: Issue in connecting to tomcat via Apache
Martin, I m trying to access the folder /examples on the localhost which is actualy hosted in the TOMCAT. http://localhost/examples . The tomcat is running on port 8080 and the httpd is running on 8000. When I access the same folder using the port like http://localhost:8080/examples is successful. I tried the two options on worker properties like JkMount /examples/* worker1 JkMount / worker1 But both of them did not fwd the request to tomcat via the httpd. There are no pointers in the log files of jk/httpd/tomcat etc.. Thanks. Thanks. On Fri, Aug 29, 2008 at 10:01 AM, Martin Gainty [EMAIL PROTECTED] wrote: dont forget jsp mapping in httpd.conf JkMount /*.jsp worker1 Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Thu, 28 Aug 2008 21:34:07 -0400 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Issue in connecting to tomcat via Apache You don't specify exactly what you mean by it fails, but assuming you're saying that requests to Apache aren't getting passed along to Tomcat, your answer is right here: (from httpd.conf) # Send everything for context /examples to worker named worker1 (ajp13) #JkMount /examples/* worker1 if you want everything to go to Tomcat, add a line like: JkMount / worker1 and you're all set. If you want just a certain portion of the url namespace to get passed along to Tomcat, you could use some thing like the commented out example. In that case: http://yourserver/index.html would be served by Apache httpd, but http://yourserver/examples/someexample.jsp would be served by Tomcat. Vasanth Kumar ravi wrote: Hi, I am using the mod_jk to connect the apache webserver and the tomcat server. Though I am able to access them individually, when I try to access the tomcat via the apache webserver, it fails. I used the examples given the apache site to configure the workers.properties and the httpd.conf files. Apache :2.2.8 Tomcat :6.0.16 jdk :1.5.014 from Sun OS : Suse Linux.. -- RegardsThanks, Vasanth Kumar Ravi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ See what people are saying about Windows Live. Check out featured posts. http://www.windowslive.com/connect?ocid=TXT_TAGLM_WL_connect2_082008 -- RegardsThanks, Vasanth Kumar Ravi
Re: Issue in connecting to tomcat via Apache
All, A brief on wat i did. 1. Downloaded the httpd 2.2.8 and tomcat 6.0.16 versions. 2. Httpd installation ./configure --with-included-apr --prefix=install directory Listening on port 8000 3. Tomcat installation Modified the catalina.sh file to point to the tomcat home/jdk home STarted and listening on 8080 4.mod_jk installation Tried the build and install method using the source code file. Also the binary file downloaded from the apache site was copied to /modules dir of the httpd. jk logs doesnot show any error , while starting the httpd process. As wel the httpd and tomcat doesnt show any errors. On Fri, Aug 29, 2008 at 10:07 AM, Vasanth Kumar ravi [EMAIL PROTECTED]wrote: Martin, I m trying to access the folder /examples on the localhost which is actualy hosted in the TOMCAT. http://localhost/examples . The tomcat is running on port 8080 and the httpd is running on 8000. When I access the same folder using the port like http://localhost:8080/examples is successful. I tried the two options on worker properties like JkMount /examples/* worker1 JkMount / worker1 But both of them did not fwd the request to tomcat via the httpd. There are no pointers in the log files of jk/httpd/tomcat etc.. Thanks. Thanks. On Fri, Aug 29, 2008 at 10:01 AM, Martin Gainty [EMAIL PROTECTED]wrote: dont forget jsp mapping in httpd.conf JkMount /*.jsp worker1 Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Thu, 28 Aug 2008 21:34:07 -0400 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Issue in connecting to tomcat via Apache You don't specify exactly what you mean by it fails, but assuming you're saying that requests to Apache aren't getting passed along to Tomcat, your answer is right here: (from httpd.conf) # Send everything for context /examples to worker named worker1 (ajp13) #JkMount /examples/* worker1 if you want everything to go to Tomcat, add a line like: JkMount / worker1 and you're all set. If you want just a certain portion of the url namespace to get passed along to Tomcat, you could use some thing like the commented out example. In that case: http://yourserver/index.html would be served by Apache httpd, but http://yourserver/examples/someexample.jsp would be served by Tomcat. Vasanth Kumar ravi wrote: Hi, I am using the mod_jk to connect the apache webserver and the tomcat server. Though I am able to access them individually, when I try to access the tomcat via the apache webserver, it fails. I used the examples given the apache site to configure the workers.properties and the httpd.conf files. Apache :2.2.8 Tomcat :6.0.16 jdk :1.5.014 from Sun OS : Suse Linux.. -- RegardsThanks, Vasanth Kumar Ravi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ See what people are saying about Windows Live. Check out featured posts. http://www.windowslive.com/connect?ocid=TXT_TAGLM_WL_connect2_082008 -- RegardsThanks, Vasanth Kumar Ravi -- RegardsThanks, Vasanth Kumar Ravi
Servlet Memory Leak
I have a fairly small memory leak in a servlet (Tomcat 6.0) running on a Windows 2003 server. I have been looking into memory profiling to help me find the leak but nothing seems to be or do what I need. Simply put I want a list of all of the objects/primitives (and if possible their values) that are in memory. It would be really nice if I didn't have to bring Tomcat down at all to do this analysis as the servlet is running in a production environment. Does anyone know of a decent free tool that does such a thing? If not, what would be a good route to take to find this leak? Thanks a ton.
Re: ERROR Starting 2nd instance of Tomcat
Where does that In the config file come from? It's not in a Tomcat script, is it? -- Len On Thu, Aug 28, 2008 at 18:54, Eduardo Ponce de León [EMAIL PROTECTED] wrote: I am trying to run a 2nd instace of tomcat. For this, ive duplicated the tomcat folder and modified the server.xml files with different ports. I've also created a startup script, but when I run the script I am getting this error... Can anyone help please!! [EMAIL PROTECTED] tomcat5-test]# tomcat5-test start In the config file Starting tomcat5-test: [ FAILED ] This is what i get in my catalina.out -sh: line 0: export: `In the config file': not a valid identifier /bin/bash: /usr/bin/tomcat5-test: Permission denied -sh: line 0: export: `In the config file': not a valid identifier /bin/bash: /usr/bin/tomcat5-test: Permission denied This is my startup script... #!/bin/bash # # tomcat5 This shell script takes care of starting and stopping Tomcat # # chkconfig: - 80 20 # ### BEGIN INIT INFO # Provides: tomcat5 # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: # Default-Stop: # Description: Release implementation for Servlet 2.4 and JSP 2.0 # Short-Description: start and stop tomcat ### END INIT INFO # # - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot # - heavily rewritten by Deepak Bhole and Jason Corley # # commented out until the RHEL and FC daemon functions converge # Source the function library #if [ -r /etc/rc.d/init.d/functions ]; then #. /etc/rc.d/init.d/functions #fi NAME=$(basename $0) unset ISBOOT if [ ${NAME:0:1} = S -o ${NAME:0:1} = K ]; then NAME=${NAME:3} ISBOOT=1 fi # For SELinux we need to use 'runuser' not 'su' if [ -x /sbin/runuser ]; then SU=/sbin/runuser else SU=su fi # Get the tomcat config (use this for environment specific settings) TOMCAT_CFG=/etc/tomcat5/tomcat5.conf if [ -r $TOMCAT_CFG ]; then . ${TOMCAT_CFG} fi # Get instance specific config file if [ -r /etc/sysconfig/${NAME} ]; then . /etc/sysconfig/${NAME} fi # Define which connector port to use CONNECTOR_PORT=${CONNECTOR_PORT:-8080} # Path to the tomcat launch script TOMCAT_SCRIPT=/usr/bin/tomcat5-test # Path to the script that will refresh jar symlinks on startup TOMCAT_RELINK_SCRIPT=${CATALINA_HOME}/bin/relink # Tomcat program name TOMCAT_PROG=$NAME # Define the tomcat username TOMCAT_USER=${TOMCAT_USER:-tomcat} # Define the tomcat log file TOMCAT_LOG=${TOMCAT_LOG:-/usr/share/tomcat5-test/logs/logscatalina.out} RETVAL=0 # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function checkpid() { local i for i in $* ; do if [ -d /proc/${i} ]; then return 0 fi done return 1 } # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function echo_failure() { echo -en \\033[60G file:///\\033[60G echo -n [ echo -n $FAILED echo -n ] echo -ne \r return 1 } # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function echo_success() { echo -en \\033[60G file:///\\033[60G echo -n [ echo -n $OK echo -n ] echo -ne \r return 0 } # Look for open ports, as the function name might imply function findFreePorts() { local isSet1=false local isSet2=false local isSet3=false local lower=8000 randomPort1=0 randomPort2=0 randomPort3=0 local -a listeners=( $( netstat -ntl | \ awk '/^tcp/ {gsub((.)*:, , $4); print $4}') ) while [ $isSet1 = false ] || \ [ $isSet2 = false ] || \ [ $isSet3 = false ]; do let port=${lower}+${RANDOM:0:4} if [ -z `expr ${listeners[*]} : .*\( $port \).*` ]; then if [ $isSet1 = false ]; then export randomPort1=$port isSet1=true elif [ $isSet2 = false ]; then export randomPort2=$port isSet2=true elif [ $isSet3 = false ]; then export randomPort3=$port isSet3=true fi fi done } function makeHomeDir() { if [ ! -d $CATALINA_HOME ]; then echo $CATALINA_HOME does not exist, creating if [ ! -d /var/lib/${NAME} ]; then mkdir -p /var/lib/${NAME} cp -pLR /var/lib/tomcat5-test/* /var/lib/${NAME} fi mkdir -p $CATALINA_HOME ${CATALINA_HOME}/conf /var/cache/${NAME}/temp \ /var/cache/${NAME}/work /var/log/${NAME} for i in temp work; do ln -fs /var/cache/${NAME}/${i} ${CATALINA_HOME}/${i} done for i in common server shared webapps; do ln -fs /var/lib/${NAME}/${i} ${CATALINA_HOME}/${i} done ln -fs /var/log/${NAME} ${CATALINA_HOME}/logs cp -pLR /usr/share/tomcat5-test/* ${CATALINA_HOME}/conf/ cp -pLR /usr/share/tomcat5-test/bin $CATALINA_HOME cp -pLR /usr/share/tomcat5-test/* ${CATALINA_HOME}/work/ chown ${TOMCAT_USER}:${TOMCAT_USER} /var/log/${NAME} fi } function parseOptions() { options= options=$options $( awk '!/^#/ !/^$/ { ORS= ; print export , $0, ; }' \ $TOMCAT_CFG ) if [ -r /etc/sysconfig/${NAME} ]; then options=$options $( awk '!/^#/ !/^$/ { ORS= ; print export , $0, ; }' \ /etc/sysconfig/${NAME} ) fi
Re: Servlet Memory Leak
Nathan Thatcher wrote: I have a fairly small memory leak in a servlet (Tomcat 6.0) running on a Windows 2003 server. I have been looking into memory profiling to help me find the leak but nothing seems to be or do what I need. Simply put I want a list of all of the objects/primitives (and if possible their values) that are in memory. It would be really nice if I didn't have to bring Tomcat down at all to do this analysis as the servlet is running in a production environment. Does anyone know of a decent free tool that does such a thing? I've used YourKit (http://www.yourkit.com/) in cases exactly like the one you describe. It's not free, but I find it well worth the price (and a free evaluation version is available). I wouldn't be surprised to see free tools emerging with similar functionality, but as I've been content with YourKit, I haven't been looking. -- ..Juha - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ERROR Starting 2nd instance of Tomcat
Ok ... taking a second look at this, why on earth are you using the command 'tomcat5-test start In the config file' to start tomcat? In particular, 'In the config file' phrase has no place on the command line. --David Eduardo Ponce de León wrote: I am trying to run a 2nd instace of tomcat. For this, ive duplicated the tomcat folder and modified the server.xml files with different ports. I've also created a startup script, but when I run the script I am getting this error... Can anyone help please!! [EMAIL PROTECTED] tomcat5-test]# tomcat5-test start In the config file Starting tomcat5-test: [ FAILED ] This is what i get in my catalina.out -sh: line 0: export: `In the config file': not a valid identifier /bin/bash: /usr/bin/tomcat5-test: Permission denied -sh: line 0: export: `In the config file': not a valid identifier /bin/bash: /usr/bin/tomcat5-test: Permission denied This is my startup script... #!/bin/bash # # tomcat5 This shell script takes care of starting and stopping Tomcat # # chkconfig: - 80 20 # ### BEGIN INIT INFO # Provides: tomcat5 # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: # Default-Stop: # Description: Release implementation for Servlet 2.4 and JSP 2.0 # Short-Description: start and stop tomcat ### END INIT INFO # # - originally written by Henri Gomez, Keith Irwin, and Nicolas Mailhot # - heavily rewritten by Deepak Bhole and Jason Corley # # commented out until the RHEL and FC daemon functions converge # Source the function library #if [ -r /etc/rc.d/init.d/functions ]; then #. /etc/rc.d/init.d/functions #fi NAME=$(basename $0) unset ISBOOT if [ ${NAME:0:1} = S -o ${NAME:0:1} = K ]; then NAME=${NAME:3} ISBOOT=1 fi # For SELinux we need to use 'runuser' not 'su' if [ -x /sbin/runuser ]; then SU=/sbin/runuser else SU=su fi # Get the tomcat config (use this for environment specific settings) TOMCAT_CFG=/etc/tomcat5/tomcat5.conf if [ -r $TOMCAT_CFG ]; then . ${TOMCAT_CFG} fi # Get instance specific config file if [ -r /etc/sysconfig/${NAME} ]; then . /etc/sysconfig/${NAME} fi # Define which connector port to use CONNECTOR_PORT=${CONNECTOR_PORT:-8080} # Path to the tomcat launch script TOMCAT_SCRIPT=/usr/bin/tomcat5-test # Path to the script that will refresh jar symlinks on startup TOMCAT_RELINK_SCRIPT=${CATALINA_HOME}/bin/relink # Tomcat program name TOMCAT_PROG=$NAME # Define the tomcat username TOMCAT_USER=${TOMCAT_USER:-tomcat} # Define the tomcat log file TOMCAT_LOG=${TOMCAT_LOG:-/usr/share/tomcat5-test/logs/logscatalina.out} RETVAL=0 # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function checkpid() { local i for i in $* ; do if [ -d /proc/${i} ]; then return 0 fi done return 1 } # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function echo_failure() { echo -en \\033[60G file:///\\033[60G echo -n [ echo -n $FAILED echo -n ] echo -ne \r return 1 } # remove when the RHEL and FC daemon functions converge # (pulled from /etc/rc.d/init.d/functions) function echo_success() { echo -en \\033[60G file:///\\033[60G echo -n [ echo -n $OK echo -n ] echo -ne \r return 0 } # Look for open ports, as the function name might imply function findFreePorts() { local isSet1=false local isSet2=false local isSet3=false local lower=8000 randomPort1=0 randomPort2=0 randomPort3=0 local -a listeners=( $( netstat -ntl | \ awk '/^tcp/ {gsub((.)*:, , $4); print $4}') ) while [ $isSet1 = false ] || \ [ $isSet2 = false ] || \ [ $isSet3 = false ]; do let port=${lower}+${RANDOM:0:4} if [ -z `expr ${listeners[*]} : .*\( $port \).*` ]; then if [ $isSet1 = false ]; then export randomPort1=$port isSet1=true elif [ $isSet2 = false ]; then export randomPort2=$port isSet2=true elif [ $isSet3 = false ]; then export randomPort3=$port isSet3=true fi fi done } function makeHomeDir() { if [ ! -d $CATALINA_HOME ]; then echo $CATALINA_HOME does not exist, creating if [ ! -d /var/lib/${NAME} ]; then mkdir -p /var/lib/${NAME} cp -pLR /var/lib/tomcat5-test/* /var/lib/${NAME} fi mkdir -p $CATALINA_HOME ${CATALINA_HOME}/conf /var/cache/${NAME}/temp \ /var/cache/${NAME}/work /var/log/${NAME} for i in temp work; do ln -fs /var/cache/${NAME}/${i} ${CATALINA_HOME}/${i} done for i in common server shared webapps; do ln -fs /var/lib/${NAME}/${i} ${CATALINA_HOME}/${i} done ln -fs /var/log/${NAME} ${CATALINA_HOME}/logs cp -pLR /usr/share/tomcat5-test/* ${CATALINA_HOME}/conf/ cp -pLR /usr/share/tomcat5-test/bin $CATALINA_HOME cp -pLR /usr/share/tomcat5-test/* ${CATALINA_HOME}/work/ chown ${TOMCAT_USER}:${TOMCAT_USER} /var/log/${NAME} fi } function parseOptions() { options= options=$options $( awk '!/^#/ !/^$/ { ORS= ; print export , $0, ; }' \ $TOMCAT_CFG ) if [ -r /etc/sysconfig/${NAME} ]; then options=$options $( awk '!/^#/ !/^$/ { ORS= ; print export , $0, ; }' \ /etc/sysconfig/${NAME} ) fi TOMCAT_SCRIPT=$options $TOMCAT_SCRIPT } # See how we were called. function
Re: Why GlassFish
Disclaimer: I am a Glassfish developer, working for Sun. So you can ignore whatever I say. :) I run Tomcat for my server (diglloyd.com), for specific reasons. Glassfish is a terrific product and so is Tomcat. Which is better depends on the goal, as with any product. Glassfish URL: https://glassfish.dev.java.net/ Glassfish V2 has a number of differences with Tomcat, here are just a few: - it's a full Java EE compliant server (eg, servlet, ejb, etc) - it offers a fantastic web-based management interface, along with an extensive command-line interface - it offers an extensive MBean interface for management and monitoring - support for MySQL and Java DB built in - commercial support from Sun at a variety of levels It does indeed incorporate Tomcat, though there are some differences with Valves and configuration and deployment. Glassfish V3 moves to a powerful OSGi-based modular system. With V3, you'll essentially be able to pare a system down to any form you like, one that could run (for example), just Tomcat. Tomcat is a great technology. Glassfish is too, but has a much wider range of features. Sometimes simple is better, sometimes more features are better. Lloyd Chambers http://diglloyd.com [Mac OS X 10.5.2 Intel, Tomcat 6.0.16] On Aug 28, 2008, at 6:31 AM, sam wun wrote: Hi, Just a quick question, I found that Tomcat is quite capable with servlet application, but lack of EJB support. Is GlassFish designed to fill the gaps to support EJB application only? Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Get! YahooAutoMailer $9.95 - Auto-Post to Unlimited Yahoo Groups
Automatic Posting to Google Groups.Did you know Yahoo Groups is THE MOSTnbsp; USED INTERNET GROUP Today!nbsp;How About MSN GROUPS and GOOGLE GROUPS?nbsp; nbsp;These are the BIG 3 Of Group Advertising. http://www.forex-futures-trading.info/mailer.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups RishBusiness - Internet Home Business Excellence group. To post to this group, send email to Internet-Business-Excellence@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Internet-Business-Excellence?hl=en -~--~~~~--~~--~--~---