DO NOT REPLY [Bug 46405] New: content-type appears twice in response header
https://issues.apache.org/bugzilla/show_bug.cgi?id=46405 Summary: content-type appears twice in response header Product: Tomcat 4 Version: 4.1.34 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Connector:Coyote HTTP/1.1 AssignedTo: dev@tomcat.apache.org ReportedBy: klaus.kroe...@atosorigin.com In a response-header of the Tomcat server, the "Content-Type" appears twice: SOAP SEND: POST HTTP/1.1 Host: :43442 User-Agent: gSOAP/2.7 Content-Type: text/xml; charset=utf-8 Content-Length: 2195 Connection: keep-alive SOAPAction: "" …. SOAP-Request HTTP/1.1 200 OK Content-Type: text/xml; charset=UTF-8 Date: Wed, 12 Nov 2008 15:13:00 GMT Content-Type: UTF-8 Server: Apache Tomcat/4.1.34 (HTTP/1.1 Connector) Transfer-Encoding: chunked … SOAP-Response No header-related configurations have been made in either server.xml, or web.xml. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 46406] New: Supporting relative paths in isapi_redirect.properties.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46406 Summary: Supporting relative paths in isapi_redirect.properties. Product: Tomcat Connectors Version: 1.2.27 Platform: PC OS/Version: Windows Server 2003 Status: NEW Severity: enhancement Priority: P2 Component: isapi AssignedTo: dev@tomcat.apache.org ReportedBy: ealva...@motionpoint.com Created an attachment (id=23030) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=23030) Updated version of jk_isapi_plugin.c I have several hundred instances of Tomcat using the IIS ISAPI redirect filter. I updated to version 1.2.27 of the ISAPI_redirect.dll to use the new environment variables (JKISAPI_PATH, JKISAPI_NAME) so that I don't have to edit each property file with full file paths. However, it appears the ISAPI filter gets confused sometimes when it gets reloaded multiple times and writes to log files of other instances on the same machine. So, I would like to propose an enhancement to be able to have an isapi_redirect.properties file with relative file paths like the following: ### # Relative path to the log file for the ISAPI Redirector log_file=isapi_redirect.log # Relative path to the workers.properties file worker_file=workers.properties # Relative path to the uriworkermap.properties file worker_mount_file=uriworkermap.properties ### Attached is a modified version of jk_isapi_plugin.c. The additional lines added start at line number 2630. Existing line: ok = ok && get_config_parameter(src, JK_LOG_FILE_TAG, log_file, sizeof(log_file)); Added lines after 2630: if (ok && strrchr(log_file, '\\') == NULL) { StringCbCopy(tmpbuf, MAX_PATH, log_file); StringCbCopy(log_file, MAX_PATH, dll_file_path); StringCbCat(log_file, MAX_PATH, "\\"); StringCbCat(log_file, MAX_PATH, tmpbuf); } Existing line: ok = ok && get_config_parameter(src, JK_WORKER_FILE_TAG, worker_file, sizeof(worker_file)); Additional lines added after above line: if (ok && strrchr(worker_file, '\\') == NULL) { StringCbCopy(tmpbuf, MAX_PATH, worker_file); StringCbCopy(worker_file, MAX_PATH, dll_file_path); StringCbCat(worker_file, MAX_PATH, "\\"); StringCbCat(worker_file, MAX_PATH, tmpbuf); } Existing line: ok = ok && get_config_parameter(src, JK_MOUNT_FILE_TAG, worker_mount_file, sizeof(worker_mount_file)); Additional lines added after above line: if (ok && strrchr(worker_mount_file, '\\') == NULL) { StringCbCopy(tmpbuf, MAX_PATH, worker_mount_file); StringCbCopy(worker_mount_file, MAX_PATH, dll_file_path); StringCbCat(worker_mount_file, MAX_PATH, "\\"); StringCbCat(worker_mount_file, MAX_PATH, tmpbuf); } -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 46405] content-type appears twice in response header
https://issues.apache.org/bugzilla/show_bug.cgi?id=46405 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID --- Comment #1 from Mark Thomas 2008-12-16 05:46:27 PST --- I can't reproduce this with 4.1.39. I don't recall this being an issue with older Tomcat 4 versions. It looks very much like the application is adding the extra header in error. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r727148 - in /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool: ConnectionPool.java PooledConnection.java jmx/ConnectionPool.java
Author: fhanik Date: Tue Dec 16 13:00:36 2008 New Revision: 727148 URL: http://svn.apache.org/viewvc?rev=727148&view=rev Log: Implemented JMX notifications when connections fail Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=727148&r1=727147&r2=727148&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Tue Dec 16 13:00:36 2008 @@ -106,7 +106,11 @@ * Executor service used to cancel Futures */ protected ThreadPoolExecutor cancellator = new ThreadPoolExecutor(0,1,1000,TimeUnit.MILLISECONDS,new LinkedBlockingQueue()); - + +/** + * reference to mbean + */ +protected org.apache.tomcat.jdbc.pool.jmx.ConnectionPool jmxPool = null; //=== // PUBLIC METHODS @@ -393,8 +397,12 @@ return; try { con.lock(); +String trace = con.getStackTrace(); if (getPoolProperties().isLogAbandoned()) { -log.warn("Connection has been abandoned " + con + ":" +con.getStackTrace()); +log.warn("Connection has been abandoned " + con + ":" + trace); +} +if (jmxPool!=null) { +jmxPool.notify(jmxPool.NOTIFY_ABANDON, trace); } con.abandon(); } finally { @@ -740,7 +748,7 @@ java.io.PrintStream writer = new java.io.PrintStream(bout); x.printStackTrace(writer); String result = bout.toString(); -return result; +return (x.getMessage()!=null && x.getMessage().length()>0)? x.getMessage()+";"+result:result; } //end if } @@ -758,7 +766,8 @@ try { MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName("org.apache.tomcat.jdbc.pool.jmx:type=ConnectionPool,name="+getName()); -mbs.registerMBean(new org.apache.tomcat.jdbc.pool.jmx.ConnectionPool(this), name); +jmxPool = new org.apache.tomcat.jdbc.pool.jmx.ConnectionPool(this); +mbs.registerMBean(jmxPool, name); } catch (Exception x) { log.warn("Unable to start JMX integration for connection pool. Instance["+getName()+"] can't be monitored.",x); } @@ -769,6 +778,7 @@ MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName("org.apache.tomcat.jdbc.pool.jmx:type=ConnectionPool,name="+getName()); mbs.unregisterMBean(name); +jmxPool = null; }catch (Exception x) { log.warn("Unable to stop JMX integration for connection pool. Instance["+getName()+"].",x); } Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java?rev=727148&r1=727147&r2=727148&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/PooledConnection.java Tue Dec 16 13:00:36 2008 @@ -85,7 +85,23 @@ String pwd = poolProperties.getPassword(); poolProperties.getDbProperties().setProperty("user", usr); poolProperties.getDbProperties().setProperty("password", pwd); -connection = driver.connect(driverURL, poolProperties.getDbProperties()); +try { +connection = driver.connect(driverURL, poolProperties.getDbProperties()); +} catch (Exception x) { +if (log.isDebugEnabled()) { +log.debug("Unable to connect to database.", x); +} +if (parent.jmxPool!=null) { +parent.jmxPool.notify(parent.jmxPool.NOTIFY_CONNECT, parent.getStackTrace(x)); +} +if (x instanceof SQLException) { +throw (SQLException)x; +} else { +SQLException ex = new SQLException(x.getMessage()); +ex.initCause(x); +throw ex; +} +} //set up the default state, unless we expect
DO NOT REPLY [Bug 46408] New: Invalid cast in SecurityUtil
https://issues.apache.org/bugzilla/show_bug.cgi?id=46408 Summary: Invalid cast in SecurityUtil Product: Tomcat 6 Version: 6.0.18 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: mori...@ncdc.pl In case of PrivilegedActionException thrown in: private static void execute(final Method method, final Object targetObject, final Object[] targetArguments, Principal principal) method, there is a false assumption in catch block, that PrivilegedActionException.getException() will return InvocationTargetException. It could be also IllegalAccessException and possibly other types of exceptions as well. Here is the stack trace provoked on catalina shutdown when enabled security manager: java.lang.ClassCastException: java.lang.IllegalAccessException cannot be cast to java.lang.reflect.InvocationTargetException at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:278) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:218) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:178) at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:326) at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3744) at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4513) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924) at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1191) at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1162) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1086) at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1098) at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:448) at org.apache.catalina.core.StandardService.stop(StandardService.java:584) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744) at org.apache.catalina.startup.Catalina.stop(Catalina.java:628) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.stop(Bootstrap.java:300) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.commons.daemon.support.DaemonLoader.stop(DaemonLoader.java:200) -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r727266 - in /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool: ConnectionPool.java interceptor/SlowQueryReportJmx.java jmx/ConnectionPool.java
Author: fhanik Date: Tue Dec 16 20:00:46 2008 New Revision: 727266 URL: http://svn.apache.org/viewvc?rev=727266&view=rev Log: Refactor JMX name into a constant, add a notification during init Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java?rev=727266&r1=727265&r2=727266&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java Tue Dec 16 20:00:46 2008 @@ -58,6 +58,8 @@ */ public class ConnectionPool { +public static final String POOL_JMX_TYPE_PREFIX = "org.apache.tomcat.jdbc.pool.jmx:type="; + //logger protected static Log log = LogFactory.getLog(ConnectionPool.class); @@ -346,13 +348,15 @@ properties.setMaxIdle(properties.getMinIdle()); } - +if (this.getPoolProperties().isJmxEnabled()) startJmx(); + PoolProperties.InterceptorDefinition[] proxies = getPoolProperties().getJdbcInterceptorsAsArray(); for (int i=0; ihttp://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java?rev=727266&r1=727265&r2=727266&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/interceptor/SlowQueryReportJmx.java Tue Dec 16 20:00:46 2008 @@ -202,7 +202,7 @@ Registry registry = Registry.getRegistry(null, null); ManagedBean managed = registry.findManagedBean(this.getClass().getName()); if (managed!=null) { -ObjectName oname = new ObjectName("org.apache.tomcat.jdbc.pool.jmx:type="+getClass().getName()+",name=" + poolName); +ObjectName oname = new ObjectName(ConnectionPool.POOL_JMX_TYPE_PREFIX+getClass().getName()+",name=" + poolName); registry.unregisterComponent(oname); registry.removeManagedBean(managed); } @@ -219,15 +219,15 @@ protected void registerJmx() { try { if (getCompositeType()!=null) { -ObjectName oname = new ObjectName("org.apache.tomcat.jdbc.pool.jmx:type="+getClass().getName()+",name=" + poolName); +ObjectName oname = new ObjectName(ConnectionPool.POOL_JMX_TYPE_PREFIX+getClass().getName()+",name=" + poolName); Registry registry = Registry.getRegistry(null, null); registry.loadDescriptors(getClass().getPackage().getName(),getClass().getClassLoader()); ManagedBean managed = registry.findManagedBean(this.getClass().getName()); DynamicMBean mbean = managed!=null?managed.createMBean(this):null; if (mbean!=null && mbeans.putIfAbsent(poolName, mbean)==null) { registry.getMBeanServer().registerMBean( mbean, oname); -} else { -log.warn(SlowQueryReport.class.getName()+ "- No JMX support, composite type was not found."); +} else if (mbean==null){ +log.warn(SlowQueryReport.class.getName()+ "- No JMX support, unable to initiate Tomcat JMX."); } } else { log.warn(SlowQueryReport.class.getName()+ "- No JMX support, composite type was not found."); Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java?rev=727266&r1=727265&r2=727266&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java Tue Dec 16 20:00:46 2008 @@ -43,6 +43,7 @@ //= // NOTIFICATION INFO //= +public static final String NOTIFY_INIT = "INIT FAILED"; public static final String NOTIFY_CONNECT = "CONNECTION FAILED"; public static final
svn commit: r727272 - /tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java
Author: fhanik Date: Tue Dec 16 20:13:45 2008 New Revision: 727272 URL: http://svn.apache.org/viewvc?rev=727272&view=rev Log: Catch any exceptions since we don't handle them later in the chain Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java?rev=727272&r1=727271&r2=727272&view=diff == --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/jmx/ConnectionPool.java Tue Dec 16 20:13:45 2008 @@ -25,9 +25,14 @@ import javax.management.Notification; import javax.management.NotificationBroadcasterSupport; +import org.apache.juli.logging.Log; +import org.apache.juli.logging.LogFactory; import org.apache.tomcat.jdbc.pool.JdbcInterceptor; public class ConnectionPool extends NotificationBroadcasterSupport implements ConnectionPoolMBean { +//logger +protected static Log log = LogFactory.getLog(ConnectionPool.class); + protected org.apache.tomcat.jdbc.pool.ConnectionPool pool = null; protected AtomicInteger sequence = new AtomicInteger(0); @@ -62,14 +67,29 @@ return new MBeanNotificationInfo[] {info}; } -public void notify(final String type, String message) { -Notification n = new Notification( -type, -this, -sequence.incrementAndGet(), -System.currentTimeMillis(), -message!=null?message:""); -sendNotification(n); +/** + * Return true if the notification was sent successfully, false otherwise. + * @param type + * @param message + * @return + */ +public boolean notify(final String type, String message) { +try { +Notification n = new Notification( +type, +this, +sequence.incrementAndGet(), +System.currentTimeMillis(), +message!=null?message:""); +sendNotification(n); +return true; +}catch (Exception x) { +if (log.isDebugEnabled()) { +log.debug("Notify failed. Type="+type+"; Message="+message,x); +} +return false; +} + } //= - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r727303 - /tomcat/trunk/bin/setclasspath.sh
Author: markt Date: Tue Dec 16 23:27:19 2008 New Revision: 727303 URL: http://svn.apache.org/viewvc?rev=727303&view=rev Log: Stop command -z not found complaint Modified: tomcat/trunk/bin/setclasspath.sh Modified: tomcat/trunk/bin/setclasspath.sh URL: http://svn.apache.org/viewvc/tomcat/trunk/bin/setclasspath.sh?rev=727303&r1=727302&r2=727303&view=diff == --- tomcat/trunk/bin/setclasspath.sh (original) +++ tomcat/trunk/bin/setclasspath.sh Tue Dec 16 23:27:19 2008 @@ -96,7 +96,7 @@ fi # Don't override the endorsed dir if the user has set it previously -if [-z "$JAVA_ENDORSED_DIRS"]; then +if [ -z "$JAVA_ENDORSED_DIRS" ]; then # Set the default -Djava.endorsed.dirs argument JAVA_ENDORSED_DIRS="$BASEDIR"/endorsed fi - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r727305 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: markt Date: Tue Dec 16 23:46:38 2008 New Revision: 727305 URL: http://svn.apache.org/viewvc?rev=727305&view=rev Log: Minor fix to proposal. Filip - I assumed you would be OK with this. Shout if not. Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=727305&r1=727304&r2=727305&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Dec 16 23:46:38 2008 @@ -248,6 +248,7 @@ * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=46232 Don't override the endorsed dir if the user has set it http://svn.apache.org/viewvc?rev=723738&view=rev + http://svn.apache.org/viewvc?rev=727303&view=rev +1: markt, fhanik -1: - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org