Summary: | DNS lookup mix of threads | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Susanne <susnet> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P2 | ||
Version: | 5.0.27 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
URL: | http://susnet.se | ||
Attachments: |
server.xml Tomcat
workers.properties |
Description
Susanne
2005-03-11 22:29:50 UTC
Please provide detailed instructions on how to reproduce this. Created attachment 14467 [details]
server.xml Tomcat
Using virtual hosts and AJP1.3.
Created attachment 14468 [details]
workers.properties
This is what i have in httpd.conf <VirtualHost *> ServerName susnet.se ServerAlias www.susnet.se ServerAdmin webmaster@susnet.se DocumentRoot /usr/tomcat-5/webapps/susnet ErrorLog /usr/tomcat-5/logs/susnet.se-errorlog CustomLog /usr/tomcat-5/logs/susnet.se-customlog combined jkMount /* ajp13 </VirtualHost> In the code for my application i have boolean insertOk = stat.insertLogs(id, request.getRemoteAddr(), request.getRemoteHost(), referer); public boolean insertLogs(int counterId, String ip, String hostname, String referer) { try { PreparedStatement pstmt = connection.prepareStatement( "INSERT INTO service.logs VALUES(?, NOW(), ?, ?, ?)"); synchronized (pstmt) { pstmt.clearParameters(); pstmt.setInt(1, counterId); pstmt.setString(2, ip); pstmt.setString(3, hostname); pstmt.setString(4, referer); pstmt.executeUpdate(); } } catch (Exception e) { System.out.println( "Error i susnet.se/tjanster statistics.java insertLogs."); return false; } return true; } this is executed in a standard Struts executeLogic. There is no problem with anything else and it worked fine when I used Tomcat 5.0.49 and JK2. Tell me if you want some more input! It was Tomcat 5.0.27 it worked fine in, not 5.0.49. Sorry. Summerized the problem occures with Tomcat 5.5.7 JK 1.2.8 Apache 2.0.53 (and also 2.0.49) It seems that we do have a bug here. You can fix your system today by including: HostnameLookups On in your httpd.conf. This is much more efficient anyway if you want host names, since then Apache looks it up and tells Tomcat what it is. This is fixed now in the CVS, and will appear in 5.5.9. |