[Bug 58766] New: Embedded Tomcat 8 startup hangs on RedHat when calling addWebapp

2015-12-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58766

Bug ID: 58766
   Summary: Embedded Tomcat 8 startup hangs on RedHat when calling
addWebapp
   Product: Tomcat 8
   Version: 8.0.29
  Hardware: PC
OS: Linux
Status: NEW
  Severity: blocker
  Priority: P2
 Component: Catalina
  Assignee: dev@tomcat.apache.org
  Reporter: nitsan_dan...@bmc.com

Created attachment 33373
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33373&action=edit
thread dump

After upgrading to Tomcat 8.0.29 (used Tomcat 7 before), starting from the
second startup of the application, tomcat hangs when calling addWebapp.

At the first startup everything works OK. Just after stopping the service of my
application and starting it again the problem will occur.
I assume it's related to exploding the war file.

This happens on RedHat only (Suse works just fine).

Moreover, when I start my application from script, rather than as a service,
everything works well. 

Any idea what can I do to solve this?

Thanks.

-- 
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 58765] Default behavior change in tomcat 8.0.29-30 context root redirect process

2015-12-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58765

--- Comment #1 from Konstantin Kolinko  ---
1. Behaviour can change between minor versions. Actually you are asking for
such a change.

The old behaviour was not removed. You can opt-in for the old behaviour by
setting mapperContextRootRedirectEnabled="true" either on your own web
application or globally in conf/context.xml file.

2. Relying on mapperContextRootRedirectEnabled="true" is bad.

1) It is a Tomcat-specific feature.

2) It is application responsibility to process requests. Relying on Tomcat here
is wrong. E.g. it is incompatible with RemoteIpValve.

http://tomcat.apache.org/tomcat-8.0-doc/config/valve.html#Remote_IP_Valve

You filter calls sendRedirect(). You have to change that call to correctly
process requests to the root of web application (getServletPath() is "" and
getPathInfo() is null) by appending '/' to the request URI.


The code to test for this condition looks like the following:

  if (request.getServletPath().length() == 0 && request.getPathInfo() == null)

The code to append '/' to requestURI looks like the following:

  StringBuilder location = new StringBuilder(requestURI);
  location.append('/');
  if (request.getQueryString() != null) {
  location.append('?');
  location.append(request.getQueryString());
  }
  response.sendRedirect(response.encodeRedirectURL(location.toString()));


Note, that handling such URIs by yourself will improve the network latency of
your application.

Old behaviour:
step 1: request to /test, responds with redirect to /test/
step 2: request to /test/, your filter responds with redirect to
/test/?value=random
step 3: request to /test/?value=random

Now you can send the correct redirect on step 1, skipping step 2 and omitting
one 302 response round trip.



BTW, the following filter mapping in your WEB-INF/web.xml is wrong:

  *

I guess you meant '/*' here.

The '*' pattern does not end with '/*'. Thus it has to be used as exact match,
not as a prefix match. See chapter 12.2 Specification of Mappings of the
Servlet 3.1 specification.

-- 
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 58768] New: Add Logging to Response.sendRedirect

2015-12-24 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=58768

Bug ID: 58768
   Summary: Add Logging to Response.sendRedirect
   Product: Tomcat 7
   Version: 7.0.67
  Hardware: PC
OS: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Servlet & JSP API
  Assignee: dev@tomcat.apache.org
  Reporter: gsex...@mhsoftware.com

The new behavior introduced in:

https://bz.apache.org/bugzilla/show_bug.cgi?id=56917

Can cause strange and mysterious errors. For example, passing an invalid value
fo sendRedirect():

response.sendRedirect("SomePage.html?value=Some Word")

will now generate a 404 error indicating that the page containing the
sendRedirect() call is not found. In this case the real error is that the
parameter is not URI encoded.

Additionally, because of the manner it's called, no diagnostic page is
generated. The developer is left scratching their head wonder what went wrong.

It would be very helpful if the IllegalArgumentException that get's caught in
o.a.c.c.Response at line 1412 could be logged.

-- 
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



[GUMP@vmgump]: Project tomcat-tc7.0.x-test-nio (in module tomcat-7.0.x) failed

2015-12-24 Thread Bill Barker
To whom it may engage...

This is an automated request, but not an unsolicited one. For 
more information please visit http://gump.apache.org/nagged.html, 
and/or contact the folk at gene...@gump.apache.org.

Project tomcat-tc7.0.x-test-nio has an issue affecting its community 
integration.
This issue affects 1 projects.
The current state of this project is 'Failed', with reason 'Build Failed'.
For reference only, the following projects are affected by this:
- tomcat-tc7.0.x-test-nio :  Tomcat 7.x, a web server implementing Java 
Servlet 3.0,
...


Full details are available at:

http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test-nio/index.html

That said, some information snippets are provided here.

The following annotations (debug/informational/warning/error messages) were 
provided:
 -DEBUG- Dependency on tomcat-tc7.0.x-dbcp exists, no need to add for property 
tomcat-dbcp-src.jar.
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
commons-daemon.native.src.tgz.
 -DEBUG- Dependency on commons-daemon exists, no need to add for property 
tomcat-native.tar.gz.
 -DEBUG- Dependency on tomcat-tc7.0.x-dbcp exists, no need to add for property 
tomcat-dbcp.home.
 -INFO- Failed with reason build failed
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-7.0.x/output/logs-NIO
 -INFO- Project Reports in: 
/srv/gump/public/workspace/tomcat-7.0.x/output/test-tmp-NIO/logs



The following work was performed:
http://vmgump.apache.org/gump/public/tomcat-7.0.x/tomcat-tc7.0.x-test-nio/gump_work/build_tomcat-7.0.x_tomcat-tc7.0.x-test-nio.html
Work Name: build_tomcat-7.0.x_tomcat-tc7.0.x-test-nio (Type: Build)
Work ended in a state of : Failed
Elapsed: 29 mins 44 secs
Command Line: /usr/lib/jvm/java-8-oracle/bin/java -Djava.awt.headless=true 
-Dbuild.sysclasspath=only org.apache.tools.ant.Main 
-Dgump.merge=/srv/gump/public/gump/work/merge.xml 
-Dcommons-pool.home=/srv/gump/public/workspace/commons-pool-1.x 
-Dtest.temp=output/test-tmp-NIO 
-Djunit.jar=/srv/gump/public/workspace/junit/target/junit-4.13-SNAPSHOT.jar 
-Dobjenesis.jar=/srv/gump/public/workspace/objenesis/main/target/objenesis-2.3-SNAPSHOT.jar
 -Dexamples.sources.skip=true 
-Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-20151224.jar
 
-Dtomcat-dbcp-src.jar=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-src.jar
 -Dtomcat-dbcp.home=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps 
-Dtest.excludePerformance=true 
-Dhamcrest.jar=/srv/gump/packages/hamcrest/hamcrest-core-1.3.jar 
-Dcommons-dbcp.home=/srv/gump/public/workspace/commons-dbcp-1.x 
-Dexecute.test.apr=false -Dexecute.test.bio=false 
-Dcommons-daemon.native.src.tgz=/srv/gump/public/w
 
orkspace/apache-commons/daemon/dist/bin/commons-daemon-20151224-native-src.tar.gz
 -Dtest.reports=output/logs-NIO 
-Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20151224-native-src.tar.gz
 -Djdt.jar=/srv/gump/packages/eclipse/plugins/R-4.5-201506032000/ecj-4.5.jar 
-Dexecute.test.nio=true -Dtest.accesslog=true 
-Dtomcat-dbcp.jar=/srv/gump/public/workspace/tomcat-7.0.x/tomcat-deps/tomcat-dbcp-20151224.jar
 
-Deasymock.jar=/srv/gump/public/workspace/easymock/core/target/easymock-3.5-SNAPSHOT.jar
 -Dcglib.jar=/srv/gump/packages/cglib/cglib-nodep-2.2.jar test 
[Working Directory: /srv/gump/public/workspace/tomcat-7.0.x]
CLASSPATH: 
/usr/lib/jvm/java-8-oracle/lib/tools.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-7.0.x/output/testclasses:/srv/gump/public/workspace/ant/dist/lib/ant.jar:/srv/gump/public/workspace/ant/dist/lib/ant-launcher.jar:/srv/gump/public/workspace/ant/dist/lib/ant-jmf.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit.jar:/srv/gump/public/workspace/ant/dist/lib/ant-junit4.jar:/srv/gump/public/workspace/ant/dist/lib/ant-swing.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-resolver.jar:/srv/gump/public/workspace/ant/dist/lib/ant-apache-xalan2.jar:/srv/gump/public/workspace/xml-commons/java/build/resolver.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/servlet-api.ja
 
r:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-7.0.x/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomca