Re: Problems setting up Webdav folder on Tomcat 5.5
On Monday 26 September 2005 19:32, David Goodenough wrote: On Monday 26 September 2005 16:51, David Goodenough wrote: I am trying to set up a webdav application on a machine running Tomcat 5.5. The effect I want to create is that anyone can use http://machine/app/folder to read files, but only those who have logged on should be able to use webdav to create, update or delete files from the folder. I tried to do this by copying the web.xml file from the webdav WEB-INF folder into the app/WEB-INF directory, and also creating a Context file in conf/Catalina/localhost/app.xml as I want to authenticate those who are having to log on against a database (using JDBCRealm). But having set all this up I have obviously got something messed up as in catalina.out it complains about a NullPointerException, and says the problem happened while processing the default web.xml, at line 5 row 56. Now I take it that this is actually NOT refering to the default web.xml in the conf directory, as it is only this application that is hit (the others including the webdav one initialise correctly). I assume it is actually refering to the one for this webapp. But what is odd is that line 5 is in the middle of a comment, which my xml editor says is quite correctly formed. It is a shame that when putting out such messages the real file name that it is processing is not included, and the line of text it is parsing is not included. The other thing that is odd is that the call stack trace suggests that it is not the web.xml file it is processing, but rather then context file. I assume this out because it talks about functions called:- org.apache.catalina.startup.ContextConfig.processContextConfig(ContextCon fi g.java:778) org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.jav a: 718) org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:974) If it is my context file, that does have something to parse at line 5, and it reads:- Context Realm classname=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.postgresql.Driver connectionURL=jdbc:postgresql:authority connectionName=david connectionPassword= userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=roles roleNameCol=role_name /Realm /Context and for the life of me I can not see what is wrong with line 5 of that - although that is the last line so perhaps it is just an error somewhere in the Realm tag. The Postgresql driver is in common/lib, the db exists and has those tables and columns in them. Any ideas? David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Well it would seem that my suspicions are correct, the problem is with the context file, not the web.xml file. If I comment out the Realm in the context file the problem goes away. I suspect that if it having problems loading one of the two classes mentioned, JDBCRealm or the JDBC driver. But I can not tell which. Both are in JARs in the server/lib directory. Any idea how I debug it. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Is no-one else using Realms in application contexts? My guess is that I am doing something simple wrong, but for the life of me I can not spot it. So I guess I should file a bug as Tomcat should not report that the error is in web.xml when it is a context file, and should not trap with a NullPointerException with no explanation. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems setting up Webdav folder on Tomcat 5.5
I am trying to set up a webdav application on a machine running Tomcat 5.5. The effect I want to create is that anyone can use http://machine/app/folder to read files, but only those who have logged on should be able to use webdav to create, update or delete files from the folder. I tried to do this by copying the web.xml file from the webdav WEB-INF folder into the app/WEB-INF directory, and also creating a Context file in conf/Catalina/localhost/app.xml as I want to authenticate those who are having to log on against a database (using JDBCRealm). But having set all this up I have obviously got something messed up as in catalina.out it complains about a NullPointerException, and says the problem happened while processing the default web.xml, at line 5 row 56. Now I take it that this is actually NOT refering to the default web.xml in the conf directory, as it is only this application that is hit (the others including the webdav one initialise correctly). I assume it is actually refering to the one for this webapp. But what is odd is that line 5 is in the middle of a comment, which my xml editor says is quite correctly formed. It is a shame that when putting out such messages the real file name that it is processing is not included, and the line of text it is parsing is not included. The other thing that is odd is that the call stack trace suggests that it is not the web.xml file it is processing, but rather then context file. I assume this out because it talks about functions called:- org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfig.java:778) org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.java:718) org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:974) If it is my context file, that does have something to parse at line 5, and it reads:- Context Realm classname=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.postgresql.Driver connectionURL=jdbc:postgresql:authority connectionName=david connectionPassword= userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=roles roleNameCol=role_name /Realm /Context and for the life of me I can not see what is wrong with line 5 of that - although that is the last line so perhaps it is just an error somewhere in the Realm tag. The Postgresql driver is in common/lib, the db exists and has those tables and columns in them. Any ideas? David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems setting up Webdav folder on Tomcat 5.5
On Monday 26 September 2005 16:51, David Goodenough wrote: I am trying to set up a webdav application on a machine running Tomcat 5.5. The effect I want to create is that anyone can use http://machine/app/folder to read files, but only those who have logged on should be able to use webdav to create, update or delete files from the folder. I tried to do this by copying the web.xml file from the webdav WEB-INF folder into the app/WEB-INF directory, and also creating a Context file in conf/Catalina/localhost/app.xml as I want to authenticate those who are having to log on against a database (using JDBCRealm). But having set all this up I have obviously got something messed up as in catalina.out it complains about a NullPointerException, and says the problem happened while processing the default web.xml, at line 5 row 56. Now I take it that this is actually NOT refering to the default web.xml in the conf directory, as it is only this application that is hit (the others including the webdav one initialise correctly). I assume it is actually refering to the one for this webapp. But what is odd is that line 5 is in the middle of a comment, which my xml editor says is quite correctly formed. It is a shame that when putting out such messages the real file name that it is processing is not included, and the line of text it is parsing is not included. The other thing that is odd is that the call stack trace suggests that it is not the web.xml file it is processing, but rather then context file. I assume this out because it talks about functions called:- org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfi g.java:778) org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.java: 718) org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:974) If it is my context file, that does have something to parse at line 5, and it reads:- Context Realm classname=org.apache.catalina.realm.JDBCRealm debug=99 driverName=org.postgresql.Driver connectionURL=jdbc:postgresql:authority connectionName=david connectionPassword= userTable=users userNameCol=user_name userCredCol=user_pass userRoleTable=roles roleNameCol=role_name /Realm /Context and for the life of me I can not see what is wrong with line 5 of that - although that is the last line so perhaps it is just an error somewhere in the Realm tag. The Postgresql driver is in common/lib, the db exists and has those tables and columns in them. Any ideas? David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Well it would seem that my suspicions are correct, the problem is with the context file, not the web.xml file. If I comment out the Realm in the context file the problem goes away. I suspect that if it having problems loading one of the two classes mentioned, JDBCRealm or the JDBC driver. But I can not tell which. Both are in JARs in the server/lib directory. Any idea how I debug it. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to stop Tomcat supplying HTML for statues
I have a server which is being used only for XML servlets. I would like to send back error responses either as an XML error or, in the case of a non-200 status code just to send back the status code and a single line text message. I set the status (which seems to work) and the text, which again seems to be sent back on the response header, but I also get a bunch of HTML text which gets in the way of processing the error text which I want to do using XmlHttpRequest. I have not included any ErrorPage tags in my web.xml nor are there any in the global web.xml. I am running Tomcat 5.5 Thanks in advance David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to stop Tomcat supplying HTML for statues
No, this is the reverse of what I want. I want to STOP it sending an HTML page, rather than the error-page tag to set it. David On Tuesday 06 September 2005 15:06, Tim Funk wrote: http://jakarta.apache.org/tomcat/faq/misc.html#error -Tim David Goodenough wrote: I have a server which is being used only for XML servlets. I would like to send back error responses either as an XML error or, in the case of a non-200 status code just to send back the status code and a single line text message. I set the status (which seems to work) and the text, which again seems to be sent back on the response header, but I also get a bunch of HTML text which gets in the way of processing the error text which I want to do using XmlHttpRequest. I have not included any ErrorPage tags in my web.xml nor are there any in the global web.xml. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to stop Tomcat supplying HTML for statues
Maybe we are talking at cross purposes. I will try to explain what I am trying to achieve. When I have a non-200 response ALL I want to send back is the status code and the message inserted with the sendError. Nothing else. Currently I just do a sendError, should I also write a zero length buffer to the OutputStream and flush it? David On Tuesday 06 September 2005 18:55, Tim Funk wrote: Then make the error page a jsp which clears the stream and prints what you want. If your servlet already prints what you need, then force the buffer to be flushed so that the response is committed and an error page is not shown. -Tim David Goodenough wrote: No, this is the reverse of what I want. I want to STOP it sending an HTML page, rather than the error-page tag to set it. David On Tuesday 06 September 2005 15:06, Tim Funk wrote: http://jakarta.apache.org/tomcat/faq/misc.html#error -Tim David Goodenough wrote: I have a server which is being used only for XML servlets. I would like to send back error responses either as an XML error or, in the case of a non-200 status code just to send back the status code and a single line text message. I set the status (which seems to work) and the text, which again seems to be sent back on the response header, but I also get a bunch of HTML text which gets in the way of processing the error text which I want to do using XmlHttpRequest. I have not included any ErrorPage tags in my web.xml nor are there any in the global web.xml. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why 8080 and 8443 ..?
Changing the connector to 80 and 443 is difficult, as then you have to run Tomcat as root (assuming you are running on Linux). 8080 and 8443 are simply non-privileged ports with numbers not a million miles from 80 and 443 as I understand it. If you want to remap them and keep the non-root nature of Tomcat, use iptables to remap the ports. David On Tuesday 26 April 2005 10:31, David Whitehurst wrote: Chuck: Could you elaborate on what those parameters would be? A port is just a number. I'm trying to understand the history, but I would appreciate your comments on the other things required to make Tomcat production ready on top of just changing the Coyote connector from 8080 to 80 and 8443 to 443? Thanks, David L. Whitehurst Caldarale, Charles R wrote: -Original Message- From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Subject: Re: Why 8080 and 8443 ..? So there are two of the possible reasons that an upper port was chosen. Also, Tomcat is distributed in a more-or-less development configuration, rather than a production one. There are several parameters in addition to the ports that should be changed before putting it into a production environment. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: kaffe and tomcat 5.5.4
snip/ If anyone has any helpful information, I would be most grateful. It is disappointing that Tomcat 5.5.4 runs perfectly on Kaffe only to be stopped by limitations in the commons-daemon... Perhaps there is another way to run tomcat 5.54 on port 80 as an unprivileged user in linux? You could use iptables to redirect the port David thank you, Ryan Harris snip/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: kaffe and tomcat 5.5.4
On Monday 03 January 2005 04:57, Ryan Harris wrote: I'm running tomcat 5.54 on the free kaffe vm instead of Sun's JDK. When I start tomcat with the startup.sh script as root, everything runs perfectly. However I'm having trouble launching the process with JSVC. Does anybody know if JSVC can be made to work with java VMs other than SUN's? As an aside, given that Tomcat now does not use the Sun javac compiler but instead the Eclipse compiler (which is open source) why did you feel the need to replace the compiler with the kaffe one? Its a useful exercise to know it can be done, but I am not quite sure why you wanted to do it? David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Java developer friendly Linux distro
On Tuesday 21 December 2004 16:13, Andreas Vombach wrote: .. has somebody experience with gcj? On RHEL eclipse (but only 2.1.2) works with it and it looks faster than with Sun jdk. gcj could be also an option for tomcat, I'll try as soon I have time for it ... There was a note that the most recent version of SableVM runs Eclipse and Tomcat. Given that most of the problems were not in the JVM but in the class library, that bodes well for gcj running both shortly. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SSL Certificate configuration
On Thursday 11 November 2004 11:04, Robert Cole wrote: Hi, I'm having some fun and games getting Tomcat 5.0.19 to use a non-self signed certificate. I've done the following: 1) Using Keytool, generated a new key pair using the genkey switch, into a new keystore 2) Generated a CSR using the new keystore created above 3) Using OpenSSL, where I've created a certificate authority to sign my CSRs, I've then generated a signed certificate valid for 365 days, signed by my root authority 4) I've then imported the Root CA into the keystore created in 1 5) Then I've imported the new, signed certificate into the keystore from 1 6) I've then enabled by HTTPS connector in server.xml, with the keystore entry pointing to the keystore from 1. I bounced Tomcat afterwards I can then connect to Tomcat on port 8443 but when I examine the certificate it is a self signed certificate that expired after 3 months. There is no evidence of the signed certificate. So far I have: 1) Removed the keystore file to check that Tomcat is picking up the correct file. It is as I get loads of errors in the std.out file 2) Listed the contents of the keystore. I can see in the following order, the root CA certificate, the generated keypair and then the signed certificate. 3) I made a copy of the keystore, changed the configuration to use the copy and then fired Tomcat up again. I finally managed to shut Tomcat down again after a large number of errors flooded the log file. 4) I've used the Keytool export and printcert switches to check that the signed certificate in the keystore is the right one, and it is. So, my question is, how is tomcat using a self signed SSL certificate, and where could it be getting it from? Is there a way to force Tomcat to use a certain certificate from a keystore? I'm now very, very stuck and would appreciate some help. Are there any switches I can use to get more information from Tomcat on what it is using, certificate wise? For reference, the connector config looks like this: Connector port=8443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=D:\db\certificates\keystore keystorePass= / My keystore: D:\db\certificateskeytool -keystore keystore -list should that not be .keystore, not keystore? David Enter keystore password: Keystore type: jks Keystore provider: SUN Your keystore contains 3 entries rootca, Nov 9, 2004, trustedCertEntry, Certificate fingerprint (MD5): 7B:CD:2C:5D:AE:79:8A:86:D5:70:25:56:3D:0D:D1:AC mis1_key, Nov 9, 2004, keyEntry, Certificate fingerprint (MD5): BB:6A:10:C7:1C:DC:A2:AE:BD:77:C3:6F:50:B6:50:C1 mis1_cert, Nov 9, 2004, trustedCertEntry, Certificate fingerprint (MD5): 63:A4:57:A1:3E:B9:72:67:14:21:88:F3:3A:90:C5:5A The certificate that should be used is the mis1_cert certificate. From the printcert: D:\db\certificateskeytool -keystore keystore -printcert -file test.crt -v Owner: CN=mis1, OU=gmPrice, O=Deutsche Bank, L=London, ST=England, C=UK Issuer: [EMAIL PROTECTED], CN=gmPrice, OU=Shared Technology, O=Deutsche Bank, L=London, ST=England, C=UK Serial number: 8 Valid from: Tue Nov 09 09:26:01 GMT 2004 until: Wed Nov 09 09:26:01 GMT 2005 Certificate fingerprints: MD5: 63:A4:57:A1:3E:B9:72:67:14:21:88:F3:3A:90:C5:5A SHA1: C7:AA:85:F7:7E:92:AC:E6:77:8B:44:F4:B2:7F:33:11:A7:DC:57:A3 Rob Cole -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SSL Certificate configuration
Maybe its different on Windows, I only use Linux. Certainly on Linux the file is called .keystore, and of course as that is a hidden file one could create keystore files till the sky turned yellow before Tomcat would take any notice of them, i.e. it would use whatever was in the .keystore file. David On Thursday 11 November 2004 11:47, Robert Cole wrote: Hi David, I'm unfortunately on a Wintel server and the OS has problems with files named with a preceding. My connector references the 'keystore' and accessing the keystore via keytool. I've tried it with the .keystore name as an early solution but it didn't make any difference. If the .keystore name is mandatory I can try it again, but it still doesn't explain where the self-signed certificate is coming from. Thanks, Rob Cole +44 (0)20 754 51117 David Goodenough [EMAIL PROTECTED]To: [EMAIL PROTECTED] onnect.com cc: Subject: Re: SSL Certificate configuration 09/11/2004 11:33 Please respond to Tomcat Users List On Thursday 11 November 2004 11:04, Robert Cole wrote: Hi, I'm having some fun and games getting Tomcat 5.0.19 to use a non-self signed certificate. I've done the following: 1) Using Keytool, generated a new key pair using the genkey switch, into a new keystore 2) Generated a CSR using the new keystore created above 3) Using OpenSSL, where I've created a certificate authority to sign my CSRs, I've then generated a signed certificate valid for 365 days, signed by my root authority 4) I've then imported the Root CA into the keystore created in 1 5) Then I've imported the new, signed certificate into the keystore from 1 6) I've then enabled by HTTPS connector in server.xml, with the keystore entry pointing to the keystore from 1. I bounced Tomcat afterwards I can then connect to Tomcat on port 8443 but when I examine the certificate it is a self signed certificate that expired after 3 months. There is no evidence of the signed certificate. So far I have: 1) Removed the keystore file to check that Tomcat is picking up the correct file. It is as I get loads of errors in the std.out file 2) Listed the contents of the keystore. I can see in the following order, the root CA certificate, the generated keypair and then the signed certificate. 3) I made a copy of the keystore, changed the configuration to use the copy and then fired Tomcat up again. I finally managed to shut Tomcat down again after a large number of errors flooded the log file. 4) I've used the Keytool export and printcert switches to check that the signed certificate in the keystore is the right one, and it is. So, my question is, how is tomcat using a self signed SSL certificate, and where could it be getting it from? Is there a way to force Tomcat to use a certain certificate from a keystore? I'm now very, very stuck and would appreciate some help. Are there any switches I can use to get more information from Tomcat on what it is using, certificate wise? For reference, the connector config looks like this: Connector port=8443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=D:\db\certificates\keystore keystorePass= / My keystore: D:\db\certificateskeytool -keystore keystore -list should that not be .keystore, not keystore? David Enter keystore password: Keystore type: jks Keystore provider: SUN Your keystore contains 3 entries rootca, Nov 9, 2004, trustedCertEntry, Certificate fingerprint (MD5): 7B:CD:2C:5D:AE:79:8A:86:D5:70:25:56:3D:0D:D1:AC mis1_key, Nov 9, 2004, keyEntry, Certificate fingerprint (MD5): BB:6A:10:C7:1C:DC:A2:AE:BD:77:C3:6F:50:B6:50:C1 mis1_cert, Nov 9, 2004, trustedCertEntry, Certificate fingerprint (MD5): 63:A4:57:A1:3E:B9:72:67:14:21:88:F3:3A:90:C5:5A The certificate that should be used is the mis1_cert certificate. From the printcert: D:\db\certificateskeytool -keystore keystore -printcert -file test.crt -v Owner: CN=mis1, OU=gmPrice, O=Deutsche Bank, L=London, ST=England, C=UK Issuer: [EMAIL PROTECTED], CN=gmPrice, OU=Shared Technology, O=Deutsche Bank, L=London, ST=England, C=UK Serial number: 8 Valid from: Tue Nov 09 09:26:01 GMT 2004 until: Wed Nov 09 09:26:01 GMT 2005 Certificate fingerprints: MD5: 63:A4:57:A1:3E:B9:72:67:14:21:88:F3:3A:90:C5:5A SHA1: C7:AA:85:F7:7E:92:AC:E6:77:8B:44:F4:B2:7F:33:11:A7:DC:57:A3 Rob Cole -- This e-mail may contain confidential and/or privileged information. If you are not the intended
Re: which Linux Platform is best for Tomcat?
Likewise Debian Sid. Works well, but no .deb file to install it so had to use the tar file. On Tuesday 26 October 2004 16:02, Mike Curwen wrote: What the heck.. haven't heard mine yet. Slack 9, no problems at all. :) -Original Message- From: Giuseppe Briotti [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 26, 2004 9:18 AM To: [EMAIL PROTECTED] Subject: Re: which Linux Platform is best for Tomcat? I use both Suse 9.1 and Mandrake 10 and all works great! :-) G - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Rotation of Catalina.out
I am running Tomcat 5.0.27 on a Debian Unstable system in /usr/local/share/tomcat5. Under this directory is the logs directory and that contains lots of localhost_log.-mm-dd.txt files (one for each day) but only one catalina.out file. In server.xml there are two Logger tags:- !-- Global logger unless overridden at lower levels -- Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/ Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ and I guess that the latter is responsible for all the daily logs. The former however is obviously not responsible for the catalina.out as the file name is wrong. So I assume that Catalina.out is coming from StandardErrLogger and/or StandardOutLogger. My question is how to get daily files for Catalina.out? David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Rotation of Catalina.out
Well actually I am using Log4j (under the covers) I think. I am using the log JSP tags, and they have log4j as a pre-req. But obviously somehow the default config for log4j is writing to stdout rather than a log file. The default log4j.properties file that ships with the log tags is:- # Sample properties to initialise log4j #log4j.rootCategory=debug, stdout, R log4j.rootCategory=debug, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=%5p - %m%n log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=logtags.log log4j.appender.R.MaxFileSize=100KB # Keep one backup file log4j.appender.R.MaxBackupIndex=2 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n Obviously I need to modify this to get it to put the output somewhere else and to rotate it. But reading the log4j manual on the apache site I am not sure I know what I need to modify. TIA David On Friday 03 September 2004 13:55, Andrew Janian wrote: Here is a couple links that should explain the lack of rotation of catalina.out: 1) http://jakarta.apache.org/tomcat/faq/misc.html#catalina.out This one is from the tomcat website and is just the question you are asking. It says that you should not be using stdout (System.out.println) because you should be using a logging package like log4j (good recommendation). 2) http://marc.theaimsgroup.com/?t=10554447261r=1w=2 As reference by the above link, this one is a thread about rotating catalina.out. Hope this helps, Andrew Janian -Original Message- From: David Goodenough [mailto:[EMAIL PROTECTED] Sent: Friday, September 03, 2004 7:49 AM To: [EMAIL PROTECTED] Subject: Rotation of Catalina.out I am running Tomcat 5.0.27 on a Debian Unstable system in /usr/local/share/tomcat5. Under this directory is the logs directory and that contains lots of localhost_log.-mm-dd.txt files (one for each day) but only one catalina.out file. In server.xml there are two Logger tags:- !-- Global logger unless overridden at lower levels -- Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/ Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ and I guess that the latter is responsible for all the daily logs. The former however is obviously not responsible for the catalina.out as the file name is wrong. So I assume that Catalina.out is coming from StandardErrLogger and/or StandardOutLogger. My question is how to get daily files for Catalina.out? David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpUrlConnection.getInputStream() returns empty
Could you list your operating environment. I have (see my other note) a very similar problem, and I think that by working out which components are common to both of us we can narrow this down much quicker. I am using 5.0.27 Tomcat (I also used 4.1 and got the same problem), I am using JSPs with JSTL and the IO taglib, I am running on Sun JVM 1.4.2_05 (also tried 1.4.1) on a Linux system. As you are not using JSPs etc that just about leaves Tomcat itself, JVM and the operating system. David On Monday 26 July 2004 19:15, Honey George wrote: Hi All, I am facing a problem with HttpUrlConnection in Tomcat. I wanted to extract the contents of an https enabled URL, actually from the same site where my application is running(Will not try to access external URLs). My program will look like this. === === import java.net.*; import java.util.*; import java.io.*; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; import javax.net.ssl.*; . System.getProperty(java.protocol.handler.pkgs,javax.net.ssl); java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); . HostnameVerifier hv = new HostnameVerifier() { public boolean verify(String urlHostName, SSLSession session) { System.out.println(Warning: URL Host: +urlHostName+ vs. +session.getPeerHost()); return true; } }; HttpsURLConnection.setDefaultHostnameVerifier(hv); // Create a trust manager that does not validate certificate chains TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType) { } public void checkServerTrusted( java.security.cert.X509Certificate[] certs, String authType) { } } }; // Install the all-trusting trust manager try { SSLContext sc = SSLContext.getInstance(SSL); sc.init(null, trustAllCerts, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (Exception e) { } HttpURLConnection httpCon = (HttpURLConnection) new java.net.URL(https://www.abc.com/test.txt;).openConnection(); httpCon.setRequestProperty(USER_AGENT_HEADER_FIELD, ); httpCon.setRequestProperty(ACCEPT_HEADER_FIELD, text/plain); return httpCon; InputStream is = httpCon.getInputStream(); === === Here the problem is that the InputStream does not return any contents when executed from inside Tomcat. But I am able to extract the contents of the URL when I execute outside tomcat in a command line program. The Connection object returned by new java.net.URL(https://www.abc.com/test.txt;) is sun.net.www.protocol.https.HttpsURLConnectionImpl. Can I get some help on this one? Thanks Regards, George ___ALL-NEW Yahoo! Messenger - all new features - even more fun! http://www.allnewmessenger.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpUrlConnection.getInputStream() returns empty
I am hitting what looks like exactly the same problem. I have a JSP application which uses the io tags to submit XMl requests to a servlet running on the same machine. The XML servlet carries on running quite happily even once the errors start from the webUI which is the JSP bit. Once the errors start first that user just locks up and can not continue until Tomcat is restarted, then it spreads to all the other webUI users (but not the direct XML users who are coming from outside Tomcat). Moving from Tomcat4.1 to Tomcat5 made the problem a bit better, but did not cure it. With Tomcat4.1 the problem was never recoverable, but with Tomcat5 it does sometimes recover by itself. Every now and then I get several responses back as one response, along with a corresponding number of null responses. The XML servlet logs all its transactions and always reports that it worked correctly by the way. It occured to me that it might be because this is an https transaction, and the logic that determines whether this is the same session might be getting confused and multiple requests might be going though the same session at once. So I changes the servlet to accept an HTTP request if it came from localhost, hoping that the session would not be shared and that this would cure the problem and I changed the JSP code to use http rather than https. But it does not help, the problem still happens. The next thing I am going to try is updating, to the latest 1.4.2 version, the Sun SDK that I am using (I am currently using 1.4.1). Lets hope that between us we can get to the bottom of this. This one is driving me nuts. David On Monday 26 July 2004 19:15, Honey George wrote: Hi All, I am facing a problem with HttpUrlConnection in Tomcat. I wanted to extract the contents of an https enabled URL, actually from the same site where my application is running(Will not try to access external URLs). My program will look like this. === === import java.net.*; import java.util.*; import java.io.*; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; import javax.net.ssl.*; . System.getProperty(java.protocol.handler.pkgs,javax.net.ssl); java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); . HostnameVerifier hv = new HostnameVerifier() { public boolean verify(String urlHostName, SSLSession session) { System.out.println(Warning: URL Host: +urlHostName+ vs. +session.getPeerHost()); return true; } }; HttpsURLConnection.setDefaultHostnameVerifier(hv); // Create a trust manager that does not validate certificate chains TrustManager[] trustAllCerts = new TrustManager[]{ new X509TrustManager() { public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted( java.security.cert.X509Certificate[] certs, String authType) { } public void checkServerTrusted( java.security.cert.X509Certificate[] certs, String authType) { } } }; // Install the all-trusting trust manager try { SSLContext sc = SSLContext.getInstance(SSL); sc.init(null, trustAllCerts, new java.security.SecureRandom()); HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); } catch (Exception e) { } HttpURLConnection httpCon = (HttpURLConnection) new java.net.URL(https://www.abc.com/test.txt;).openConnection(); httpCon.setRequestProperty(USER_AGENT_HEADER_FIELD, ); httpCon.setRequestProperty(ACCEPT_HEADER_FIELD, text/plain); return httpCon; InputStream is = httpCon.getInputStream(); === === Here the problem is that the InputStream does not return any contents when executed from inside Tomcat. But I am able to extract the contents of the URL when I execute outside tomcat in a command line program. The Connection object returned by new java.net.URL(https://www.abc.com/test.txt;) is sun.net.www.protocol.https.HttpsURLConnectionImpl. Can I get some help on this one? Thanks Regards, George ___ALL-NEW Yahoo! Messenger - all new features - even more fun! http://www.allnewmessenger.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OT: Eclipse users list/mail group
platform seems to be where the most general questions get asked. David On Tuesday 27 July 2004 15:34, Denis Haskin wrote: When you find it please tell the rest of us! It's unclear to me which of the lists is a general-user list... they seem to be very specific. Thanks, dwh Sternbergh, Cornell wrote: Hi First, my apologies for being off-topic. I've been searching eclipse.org for list/forum/group/whatever, for simple users of Eclipse, not developers, without success. Anybody know such a source? TIA Cornell - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
An odd problem with Tomcat4
I have a perplexing problem with Tomcat 4.1, and I wonder if anyone recognises the symptoms or can make any suggestions. I have a Debian unstable Tomcat 4.1 system which has a servlet which takes XML datastreams and responds with XML responses. This servlet is being used (successfully) by some automated processes. It has been designed for concurrent access. The servlet logs all request and the responses that are returned. The requests and responses are all done using HTTPS. This system is using the Sun 1.4.1 SDK. Recently I added a web front end to this system, which is written using JSP and JSTL and which uses the IO taglib to submit requests to the servlet and then parse the reply onto the screen. Normally this works very well, but recently as we added more users we hit a problem where the response that is received is empty. Once this user is hit any further requests from that user hit the same problem, and also initially other users are unaffected eventually it spreads like a cancer and everyone gets it (all the web users that is, the automated XML users continue unaffected). The servlet log indicates that responses were sent to all requests, and using a network traffic analyser there is a response which looks about the right length (but is of course encrypted). I have looked through the IO taglib source, and I can not find anything that looks like a static or shared variable which might cause this, but I can not see anything. Anyone got any bright ideas? David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: running Tomcat as a service/daemon on Linux
On Sunday 28 July 2002 05:53, you wrote: I don't know what your OS is, but I installed via RPM and I have a script in /etc/rc.d/init.d named tomcat4. No, it's not as handy as service tomcat4 start, but it works :-) I typically wind up doing From what I understand service is a script which runs things out of init.d (where ever it is on your machine). something like !?4 rest? anyway :-P (which grabs the last restart out of my history and executes it). That's even shorter than service tomcat4 restart :-D Chris Ruegger wrote: Is it possible to set up Tomcat on a Linux machine such that I can start it/stop with the service command, i.e. service tomcat start service tomcat stop If so, how would one do this? Do most people set up Tomcat as a daemon on Unix machines? If so, tips on how this is done appreciated!! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: running Tomcat as a service/daemon on Linux
On Saturday 27 July 2002 18:38, you wrote: Is it possible to set up Tomcat on a Linux machine such that I can start it/stop with the service command, i.e. service tomcat start service tomcat stop If so, how would one do this? Do most people set up Tomcat as a daemon on Unix machines? If so, tips on how this is done appreciated!! all service does it to run a script found in /etc/init.d (or /etc/rc.d/init.d on older systems). So write a script that starts and stops tomcat. The Debian tomcat4 package comes with the following script so it might need a bit of modification for your environment:- f#! /bin/sh -e # # /etc/init.d/tomcat4 -- startup script for the Tomcat 4.0 servlet engine # # Written by Miquel van Smoorenburg [EMAIL PROTECTED]. # Modified for Debian GNU/Linux by Ian Murdock [EMAIL PROTECTED]. # Modified for Tomcat by Stefan Gybas [EMAIL PROTECTED]. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=tomcat4 DESC=Tomcat 4.0 servlet engine DAEMON=/usr/bin/$NAME CATALINA_HOME=/usr/share/$NAME # The following variables can be overwritten in /etc/default/tomcat4 # Run Tomcat 4.0 as this user ID (default: tomcat4) # Set this to an empty string to prevent Tomcat from starting automatically TOMCAT4_USER=tomcat4 # The first existing directory is used for JAVA_HOME (if JAVA_HOME is not # defined in /etc/default/tomcat4) JDK_DIRS=/usr/lib/j2se/1.3 /usr/lib/j2sdk1.3 # Arguments to pass to the Java virtual machine (JVM) CATALINA_OPTS= # Use the Java security manager? (yes/no) TOMCAT4_SECURITY=yes # End of variables that can be overwritten in /etc/default/tomcat4 # overwrite settings from default file if [ -f /etc/default/tomcat4 ]; then . /etc/default/tomcat4 fi test -f $DAEMON || exit 0 # Look for the right JVM to use for jdir in $JDK_DIRS; do if [ -d $jdir -a -z ${JAVA_HOME} ]; then JAVA_HOME=$jdir fi done export JAVA_HOME export CATALINA_OPTS # Define other required variables PIDFILE=/var/run/$NAME.pid LOGDIR=$CATALINA_HOME/logs WEBAPPDIR=$CATALINA_HOME/webapps STARTUP_OPTS= if [ $TOMCAT4_SECURITY = yes ]; then STARTUP_OPTS=-security fi case $1 in start) if [ -z $TOMCAT4_USER ]; then echo Not starting $DESC as configured (TOMCAT4_USER is empty in echo /etc/default/tomcat4). exit 0 fi if [ -z $JAVA_HOME ]; then echo Could not start $DESC because no Java Development Kit echo (JDK) was found. Please download and install JDK 1.3 or higher and set echo JAVA_HOME in /etc/default/tomcat4 to the JDK's installation directory. exit 0 fi echo -n Starting $DESC using Java from $JAVA_HOME: # Remove dangling webapp symlinks for webapp in $WEBAPPDIR/*; do if [ $webapp != $WEBAPPDIR/* -a ! -e $webapp ]; then echo Removing obsolete webapp $webapp $LOGDIR/catalina.out rm $webapp $LOGDIR/catalina.out 21 || true fi done # Symlink new webapps from /usr/share/java/webapps for webapp in /usr/share/java/webapps/*; do if [ -e $webapp -a ! -e $WEBAPPDIR/`basename $webapp` \ -a ! -e $WEBAPPDIR/`basename $webapp .war` ]; then echo Symlinking new webapp $webapp $LOGDIR/catalina.out ln -s $webapp $WEBAPPDIR || true fi done # Create catalina.policy (for the security manager) rm -f /var/lib/tomcat4/catalina.policy cat /etc/tomcat4/policy.d/*.policy /var/lib/tomcat4/catalina.policy mkdir -p $CATALINA_HOME/work/_temp touch $PIDFILE $LOGDIR/catalina.out || true chown --dereference $TOMCAT4_USER $PIDFILE $LOGDIR \ $LOGDIR/catalina.out $CATALINA_HOME/work \ $CATALINA_HOME/temp || true if start-stop-daemon --test --start --pidfile $PIDFILE \ --user $TOMCAT4_USER --startas $DAEMON /dev/null; then # -p preserves the environment (for $JAVA_HOME etc.) su -p $TOMCAT4_USER -c \$DAEMON\ start $STARTUP_OPTS \ $LOGDIR/catalina.out 21 echo $NAME. else echo (already running). fi ;; stop) echo -n Stopping $DESC: if start-stop-daemon --test --start --pidfile $PIDFILE \ --user $TOMCAT4_USER --startas $DAEMON /dev/null; then echo (not running). else su -p $TOMCAT4_USER -c \$DAEMON\ stop /dev/null 21 || true # Fallback to kill the JVM process in case stopping did not work sleep 1 start-stop-daemon --stop --oknodo --quiet --pidfile $PIDFILE \ --user $TOMCAT4_USER rm -f $PIDFILE echo $NAME. fi ;; # reload) # echo -n Reloading $DESC configuration files...
Re: Kaffe or gcj JVM and Tomcat
On Wednesday 24 July 2002 09:29, you wrote: Has anyone had any success getting Tomcat to run in the Kaffe JVM? Or running a native compiled Tomcat with gcj? I want to move at some point to a completely open source, free web application environment, and Kaffe or gcj look like the two most likely ways to do that. I doubt you will have any luck with Kaffe, its 1.1.8 with a few bits of 1.2.2 as far as I understand, I doubt Tomcat will run on it. As to gcj, it might work. It will run some complicated things and so it might be worth giving it a go -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Webdav servlet
On Thursday 18 July 2002 19:44, you wrote: I tried using the WebDAV servlet some time back, but it doesn't work as well as I'd hoped (at least, with DW UltraDev that my developers demanded). If you are using Apache-Tomcat you can try mod_webdav instead, though it requires a separate port for each virtual host. If you need, I can post the config. Thanks for the offer, but I am using Tomcat on its own currently. --- David Goodenough [EMAIL PROTECTED] wrote: I am trying to use the webDAV servlet under tomcat 4.0.3 (as shipped with JWSDP). So I copied the directory across from an ordinary 4.0.3, and sure enough I can see the HTML page. But when I connect to the site using the URL http://localhost:8080/webdav all I see is the webdav context files. How do I extend this to other contexts. Do I have to copy the servlet (or rather the bits of web.xml that define it) into all the other contexts or can I someho -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Autos - Get free new car price quotes http://autos.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Webdav servlet
I am trying to use the webDAV servlet under tomcat 4.0.3 (as shipped with JWSDP). So I copied the directory across from an ordinary 4.0.3, and sure enough I can see the HTML page. But when I connect to the site using the URL http://localhost:8080/webdav all I see is the webdav context files. How do I extend this to other contexts. Do I have to copy the servlet (or rather the bits of web.xml that define it) into all the other contexts or can I someho -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Webdav servlet
I am trying to use the webDAV servlet under tomcat 4.0.3 (as shipped with JWSDP). So I copied the directory across from an ordinary 4.0.3, and sure enough I can see the HTML page. But when I connect to the site using the URL http://localhost:8080/webdav all I see is the webdav context files. How do I extend this to other contexts. Do I have to copy the servlet (or rather the bits of web.xml that define it) into all the other contexts or can I somehow configure it to allow access to all contexts. (Sorry about the partial message, I presses the wrong key). David -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: HUP signal stops Tomcat?
On Monday 15 July 2002 11:19, you wrote: Hi, This is rather academic and purely to enhance consistency, but when I send a HUP signal to the Tomcat process I expected it to restart, but it actually stopped the process. Is this behaviour by design? If I submitted a fix/change for this, or put it in as a request - is it likely to be included? Thanks for any help, Kieron Wilkinson Tomcat is written in Java which has no concept of signals as they are not consistantly available on all platforms. It is this unlikely that Tomcat could ever support such signals. Run in conjunction with Apache or some other Web Server yes it can, but on its own, no. David -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat MySQL Run On Read-Only Media ..
On Monday 15 July 2002 13:22, you wrote: On Mon, 2002-07-15 at 13:59, [EMAIL PROTECTED] wrote: I am afraid it is not as as much easy as you think... 1) Will your customer agree to run these applications on their computer? 2) What if they are not using a PC (Mac?) or if they are not using Windows (Linux?)? There is a project (I forget its name) which is building a version of Linux designed to run on a CD. Thus you do not have to make any assumptions about what is on the PC. You can lock this version down so that it does not even look at their disk, and provided you use the VESA framebuffer you are more or less guaranteed to get it to run on the screen. I am sure that this would provide you a very good platform for such an application. Who cares.. If they order it, they have to.. 3) To run JSP you need a JDK, not a JRE. Wrong here.. Just if you want your jsp's to be dynamic.. Just precompile them.. 4) If you copy JDK, Tomcat MySQL files on the CD, will it work? In order to run they need : - DLLs in Windows system directories; - keys in Windows registry; - write access to some of their files... Use hsqldb instead which has a memory database.. 5) What about AUTOEXEC.BAT? It will do nothing if you put it on a CD : it needs to be in C:\, and there is already one there... ?? 6) What if your customers have problems running your CD? Will you create a hotline ;-) ? Not your problem I guess ;).. He was asking HOW not a project plan of things to resolve before hand.. TIP: Search the archives (maybe a year ago or something) there was a big thread about it, which actually worked towards a solution. Mvgr, Martin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Shutting down Tomcat 4.03
On Wednesday 10 July 2002 04:47, you wrote: I have noticed on my dev system (redhat72, jdk14, tc404) running with the JPDA debugger makes tomcat not want to shutdown. Larry [EMAIL PROTECTED] 07/09/02 16:48 PM 99% of the time, that means your app has started a thread someplace and not shut it down. I also notice that when it fails, cancelling the shutdown and then rerunning it usually clears it, so I do not think it can be hanging thread as was suggested elsewhere. David -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Classpath problems
I am having the inevitable initial classpath problems setting up my first servlet under Tomcat 4.0.3 (the one shipped with Sun JWSDP). In the source code I see there are debug levels and some increased debug levels, but I am unsure about how I am supposed to enable them. I tried setting an init-param of debug to 9 in my web.xml, but no luck. Thanks in advance David -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]