Re: [tomcat] branch 9.0.x updated: Fix Response#sendRedirect() if no request context exists.
вт, 1 мар. 2022 г. в 18:08, : > > This is an automated email from the ASF dual-hosted git repository. > > markt pushed a commit to branch 9.0.x > in repository https://gitbox.apache.org/repos/asf/tomcat.git > > > The following commit(s) were added to refs/heads/9.0.x by this push: > new e7d4ec3 Fix Response#sendRedirect() if no request context exists. > e7d4ec3 is described below > > commit e7d4ec3cd0802da3898273d55f3d0496743153a5 > Author: Knut Sander > AuthorDate: Thu Feb 24 18:40:16 2022 +0100 > > Fix Response#sendRedirect() if no request context exists. > > If no ROOT context is defined, the context may be null in special cases, > e.g. RewriteValve may use Response#sendRedirect() without any application > context associated. > In this case, the Tomcat behaviors for the context attributes > useRelativeRedirects and sendRedirectBody are assumed, but without > considering org.apache.catalina.STRICT_SERVLET_COMPLIANCE. > --- > java/org/apache/catalina/connector/Response.java | 9 +++-- > webapps/docs/changelog.xml | 5 + > 2 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/java/org/apache/catalina/connector/Response.java > b/java/org/apache/catalina/connector/Response.java > index 0950bcb..1295922 100644 > --- a/java/org/apache/catalina/connector/Response.java > +++ b/java/org/apache/catalina/connector/Response.java > @@ -1363,17 +1363,22 @@ public class Response implements HttpServletResponse { > > // Generate a temporary redirect to the specified location > try { > +Context context = getContext(); > +// If no ROOT context is defined, the context can be null. > +// In this case, the default Tomcat values are assumed, but > without > +// reference to org.apache.catalina.STRICT_SERVLET_COMPLIANCE. > +boolean reqHasContext = context == null; I think it was meant to be (context != null) above... > String locationUri; > // Relative redirects require HTTP/1.1 > if > (getRequest().getCoyoteRequest().getSupportsRelativeRedirects() && > -getContext().getUseRelativeRedirects()) { > +(!reqHasContext || context.getUseRelativeRedirects())) { > locationUri = location; > } else { > locationUri = toAbsolute(location); > } > setStatus(status); > setHeader("Location", locationUri); > -if (getContext().getSendRedirectBody()) { > +if (reqHasContext && context.getSendRedirectBody()) { > PrintWriter writer = getWriter(); > writer.print(sm.getString("coyoteResponse.sendRedirect.note", > Escape.htmlElementContent(locationUri))); > diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml > index c747b30..ef55841 100644 > --- a/webapps/docs/changelog.xml > +++ b/webapps/docs/changelog.xml > @@ -112,6 +112,11 @@ > rewrite valve should set the content type for the response, not the > request. (markt) > > + > +479: Enable the rewrite valve to redirect requests when the > +original request cannot be mapped to a context. This typically > happens > +when no ROOT context is defined. Pull request by elkman. (markt) > + > > > > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 65932] PreparedStatement 'getConnection' returns physical connection instead of pooled one
https://bz.apache.org/bugzilla/show_bug.cgi?id=65932 Alexey Kutishchev changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #4 from Alexey Kutishchev --- Closing this as a duplicated. *** This bug has been marked as a duplicate of bug 48392 *** -- 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
[Bug 48392] jdbc-pool is not returning the proxied connection in resultSet and statement
https://bz.apache.org/bugzilla/show_bug.cgi?id=48392 Alexey Kutishchev changed: What|Removed |Added CC||okutishc...@apple.com --- Comment #10 from Alexey Kutishchev --- *** Bug 65932 has been marked as a duplicate of this bug. *** -- 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
[Bug 65940] New: DefaultInstanceManager.destroyInstance can lead to a NullPointerException
https://bz.apache.org/bugzilla/show_bug.cgi?id=65940 Bug ID: 65940 Summary: DefaultInstanceManager.destroyInstance can lead to a NullPointerException Product: Tomcat 9 Version: 9.0.55 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: reda-ala...@hey.com Target Milestone: - On our Tomcat instance, we noticed the following stack trace: 19:46:49.556 [Catalina-utility-12] [ - ] ERROR o.a.catalina.core.StandardWrapper - InstanceManager.destroy() pour le Servlet [AtmosphereServlet] a renvoyé une exception java.lang.NullPointerException: null at org.apache.catalina.core.DefaultInstanceManager.destroyInstance(DefaultInstanceManager.java:196) at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1343) at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1627) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5465) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:257) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3811) at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1443) at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1415) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1654) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:315) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1162) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1365) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1369) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1347) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:829) https://github.com/apache/tomcat/blob/662cc9171c22ac790532d38a2b59990faaa7b971/java/org/apache/catalina/core/DefaultInstanceManager.java#L196 gives this : @Override public void destroyInstance(Object instance) throws IllegalAccessException, InvocationTargetException { if (!ignoreAnnotations) { preDestroy(instance, instance.getClass()); // NPE on this line } } So I guess parameter "instance" is null here. -- 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
[Bug 65932] PreparedStatement 'getConnection' returns physical connection instead of pooled one
https://bz.apache.org/bugzilla/show_bug.cgi?id=65932 --- Comment #3 from Christopher Schultz --- It's probably a performance consideration NOT to wrap the connections returned by Statement.getConnection(). Do you find different behavior if you use Tomcat's default database connection pool (the one based upon commons DBCP2)? -- 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
[Bug 65932] PreparedStatement 'getConnection' returns physical connection instead of pooled one
https://bz.apache.org/bugzilla/show_bug.cgi?id=65932 --- Comment #2 from Alexey Kutishchev --- That helped. I'm surprised to see that it is not a default behavior. Any plans to change this? -- 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