Debugging tomcat server - how to?
Hello , I am newbie. I wanted to know as how to debug the tomcat server code using eclipse. Any links to blogs or articles or your inputs would be helpful. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: Debugging tomcat server - how to?
On 02/01/2015 08:39, MyList wrote: > Hello , > > I am newbie. I wanted to know as how to debug the tomcat server code > using eclipse. Any links to blogs or articles or your inputs would be > helpful. http://wiki.apache.org/tomcat/FAQ/Developing Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1648998 - /tomcat/jk/trunk/xdocs/ajp/ajpv13a.xml
Author: rjung Date: Fri Jan 2 11:19:51 2015 New Revision: 1648998 URL: http://svn.apache.org/r1648998 Log: Correct docs error introduced by r1648589. Modified: tomcat/jk/trunk/xdocs/ajp/ajpv13a.xml Modified: tomcat/jk/trunk/xdocs/ajp/ajpv13a.xml URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/ajp/ajpv13a.xml?rev=1648998&r1=1648997&r2=1648998&view=diff == --- tomcat/jk/trunk/xdocs/ajp/ajpv13a.xml (original) +++ tomcat/jk/trunk/xdocs/ajp/ajpv13a.xml Fri Jan 2 11:19:51 2015 @@ -651,9 +651,10 @@ Details: Signals the end of this request-handling cycle. If the - reuse flag is true (==1), this TCP connection can now be used to - handle new incoming requests. If reuse is true (anything - other than 0 in the actual C code), the connection should be closed. + reuse flag is true (anything other than 0 in the actual + C code), this TCP connection can now be used to handle new incoming + requests. If reuse is false (==0), the connection + should be closed. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1649049 - in /tomcat/jk/trunk/native: apache-1.3/mod_jk.c apache-2.0/mod_jk.c
Author: rjung Date: Fri Jan 2 14:38:38 2015 New Revision: 1649049 URL: http://svn.apache.org/r1649049 Log: Apache: Fix get_content_length(). clength in request_rec is for response sizes, not request body size. It is initialized to 0, so the "if" branch was never taken. Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c tomcat/jk/trunk/native/apache-2.0/mod_jk.c Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-1.3/mod_jk.c?rev=1649049&r1=1649048&r2=1649049&view=diff == --- tomcat/jk/trunk/native/apache-1.3/mod_jk.c (original) +++ tomcat/jk/trunk/native/apache-1.3/mod_jk.c Fri Jan 2 14:38:38 2015 @@ -709,17 +709,12 @@ static void jk_error_exit(const char *fi /* Return the content length associated with an Apache request structure */ static jk_uint64_t get_content_length(request_rec * r) { -if (r->clength > 0) { -return (jk_uint64_t)r->clength; -} -else { -char *lenp = (char *)ap_table_get(r->headers_in, "Content-Length"); +char *lenp = (char *)ap_table_get(r->headers_in, "Content-Length"); -if (lenp) { -jk_uint64_t rc = 0; -if (sscanf(lenp, "%" JK_UINT64_T_FMT, &rc) > 0 && rc > 0) { -return rc; -} +if (lenp) { +jk_uint64_t rc = 0; +if (sscanf(lenp, "%" JK_UINT64_T_FMT, &rc) > 0 && rc > 0) { +return rc; } } Modified: tomcat/jk/trunk/native/apache-2.0/mod_jk.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?rev=1649049&r1=1649048&r2=1649049&view=diff == --- tomcat/jk/trunk/native/apache-2.0/mod_jk.c (original) +++ tomcat/jk/trunk/native/apache-2.0/mod_jk.c Fri Jan 2 14:38:38 2015 @@ -770,10 +770,7 @@ static void jk_error_exit(const char *fi static jk_uint64_t get_content_length(request_rec * r) { -if (r->clength > 0) { -return (jk_uint64_t)r->clength; -} -else if (r->main == NULL || r->main == r) { +if (r->main == NULL || r->main == r) { char *lenp = (char *)apr_table_get(r->headers_in, "Content-Length"); if (lenp) { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1649064 - in /tomcat/jk/trunk: native/apache-1.3/mod_jk.c native/apache-2.0/mod_jk.c xdocs/miscellaneous/changelog.xml xdocs/reference/apache.xml
Author: rjung Date: Fri Jan 2 15:15:52 2015 New Revision: 1649064 URL: http://svn.apache.org/r1649064 Log: BZ 34526: Apache: Improve compatibility with mod_deflate request body inflation. An automatic detection of mod_deflate inflation is not implemented. Allow to use the new Apache environment variable JK_IGNORE_CL instead, to let mod_jk ignore an existing Content-Length request header. All body data that can be read from the web server will be send to the backend. No Content-Length header will be send to the backend. Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c tomcat/jk/trunk/native/apache-2.0/mod_jk.c tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml tomcat/jk/trunk/xdocs/reference/apache.xml Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-1.3/mod_jk.c?rev=1649064&r1=1649063&r2=1649064&view=diff == --- tomcat/jk/trunk/native/apache-1.3/mod_jk.c (original) +++ tomcat/jk/trunk/native/apache-1.3/mod_jk.c Fri Jan 2 15:15:52 2015 @@ -73,6 +73,7 @@ #define JK_ENV_LOCAL_NAME ("JK_LOCAL_NAME") #define JK_ENV_LOCAL_ADDR ("JK_LOCAL_ADDR") #define JK_ENV_LOCAL_PORT ("JK_LOCAL_PORT") +#define JK_ENV_IGNORE_CL("JK_IGNORE_CL") #define JK_ENV_HTTPS("HTTPS") #define JK_ENV_CERTS("SSL_CLIENT_CERT") #define JK_ENV_CIPHER ("SSL_CIPHER") @@ -186,6 +187,14 @@ typedef struct char *local_port_indicator; /* + * Configurable environment variable to force + * ignoring a request Content-Length header + * (useful to make mod_deflate request inflation + * compatible with mod_jk). + */ +char *ignore_cl_indicator; + +/* * SSL Support */ int ssl_enable; @@ -914,6 +923,11 @@ static int init_ws_service(apache_privat s->method = (char *)r->method; s->content_length = get_content_length(r); s->is_chunked = r->read_chunked; +if (s->content_length > 0 && +get_env_string(r, NULL, conf->ignore_cl_indicator, 0) != NULL) { +s->content_length = 0; +s->is_chunked = 1; +} s->no_more_chunks = 0; s->query_string = r->args; @@ -1063,6 +1077,7 @@ static int init_ws_service(apache_privat array_header *t = ap_table_elts(r->headers_in); if (t && t->nelts) { int i; +int off = 0; table_entry *elts = (table_entry *) t->elts; s->num_headers = t->nelts; /* allocate an extra header slot in case we need to add a content-length header */ @@ -1074,12 +1089,17 @@ static int init_ws_service(apache_privat return JK_FALSE; for (i = 0; i < t->nelts; i++) { char *hname = ap_pstrdup(r->pool, elts[i].key); -s->headers_values[i] = ap_pstrdup(r->pool, elts[i].val); -s->headers_names[i] = hname; -if (need_content_length_header && -!strcasecmp(s->headers_names[i], "content-length")) { -need_content_length_header = JK_FALSE; +if (!strcasecmp(hname, "content-length")) { +if (need_content_length_header) { +need_content_length_header = JK_FALSE; +} else if (s->is_chunked) { +s->num_headers--; +off++; +continue; +} } +s->headers_values[i - off] = ap_pstrdup(r->pool, elts[i].val); +s->headers_names[i - off] = hname; } /* Add a content-length = 0 header if needed. * Ajp13 assumes an absent content-length header means an unknown, @@ -2002,6 +2022,16 @@ static const char *jk_set_local_port_ind return NULL; } +static const char *jk_set_ignore_cl_indicator(cmd_parms * cmd, + void *dummy, const char *indicator) +{ +server_rec *s = cmd->server; +jk_server_conf_t *conf = +(jk_server_conf_t *) ap_get_module_config(s->module_config, &jk_module); +conf->ignore_cl_indicator = ap_pstrdup(cmd->pool, indicator); +return NULL; +} + /* * JkExtractSSL Directive Handling * @@ -2419,6 +2449,9 @@ static const command_rec jk_cmds[] = { "Name of the Apache environment that contains the local IP address"}, {"JkLocalPortIndicator", jk_set_local_port_indicator, NULL, RSRC_CONF, TAKE1, "Name of the Apache environment that contains the local port"}, +{"JkIgnoreCLIndicator", jk_set_ignore_cl_indicator, NULL, RSRC_CONF, TAKE1, + "Name of the Apache environment that forces to ignore a request " + "Content-Length header"}, /* * Apache has multiple SSL modules (for example apache_ssl, stronghold @@ -2772,6 +2805,8 @@ static void *create_j
[Bug 34526] Truncated content in decompressed requests from mod_deflate
https://issues.apache.org/bugzilla/show_bug.cgi?id=34526 Rainer Jung changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |FIXED --- Comment #14 from Rainer Jung --- The situation has been improved in r1649064. Unfortunately it doesn't seem to be possible to detect request body inflation by mod_deflate before mod_jk actually starts to read the body. Because it needs to send the request headers to the backend before reading the body, there's no easy way to detect the situation. We would need to implement some buffering and change the flow of processing in mod_jk quite a lot. I decided to implement a workaround: you can set the new Apache environment variable JK_IGNORE_CL instead, to tell mod_jk that it should ignore an existing Content-Length request header. All body data that can be read from the web server will then be send to the backend. No Content-Length header will be send to the backend. The environment variable can be set using mod_setenvif or mod_rewrite as usual. You should choose conditions for setting the variable that trigger for the requests, for which you have configured request body inflation by mod_deflate. Setting the variable for other requests as well should work, but might lead to less efficient behavior and maybe also bugs we are not yet aware of. -- 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-native-make (in module tomcat-native) failed
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-native-make has an issue affecting its community integration. This issue affects 4 projects, and has been outstanding for 60 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - tomcat-native-make : Tomcat native library using Apache Portable Runtime - tomcat-native-make-install : Tomcat native library using Apache Portable Runtime - tomcat-tc8.0.x-test-apr : Tomcat 8.x, a web server implementing the Java Servlet 3.1, ... - tomcat-trunk-test-apr : Tomcat 9.x, a web server implementing the Java Servlet 4.0, ... Full details are available at: http://vmgump.apache.org/gump/public/tomcat-native/tomcat-native-make/index.html That said, some information snippets are provided here. The following annotations (debug/informational/warning/error messages) were provided: -INFO- Failed with reason build failed The following work was performed: http://vmgump.apache.org/gump/public/tomcat-native/tomcat-native-make/gump_work/build_tomcat-native_tomcat-native-make.html Work Name: build_tomcat-native_tomcat-native-make (Type: Build) Work ended in a state of : Failed Elapsed: 7 secs Command Line: make [Working Directory: /srv/gump/public/workspace/tomcat-native/native] - make[1]: Entering directory `/srv/gump/public/workspace/tomcat-native/native' /bin/bash /srv/gump/public/workspace/apr-1/dest-20150103/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/srv/gump/public/workspace/tomcat-native/native/include -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux -I/srv/gump/public/workspace/openssl/dest-20150103/include -I/srv/gump/public/workspace/apr-1/dest-20150103/include/apr-1 -o src/address.lo -c src/address.c && touch src/address.lo /bin/bash /srv/gump/public/workspace/apr-1/dest-20150103/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/srv/gump/public/workspace/tomcat-native/native/include -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux -I/srv/gump/public/workspace/openssl/dest-20150103/include -I/srv/gump/public/workspace/apr-1/dest-20150103/include/apr-1 -o src/bb.lo -c src/bb.c && touch src/bb.lo /bin/bash /srv/gump/public/workspace/apr-1/dest-20150103/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/srv/gump/public/workspace/tomcat-native/native/include -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux -I/srv/gump/public/workspace/openssl/dest-20150103/include -I/srv/gump/public/workspace/apr-1/dest-20150103/include/apr-1 -o src/dir.lo -c src/dir.c && touch src/dir.lo /bin/bash /srv/gump/public/workspace/apr-1/dest-20150103/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/srv/gump/public/workspace/tomcat-native/native/include -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux -I/srv/gump/public/workspace/openssl/dest-20150103/include -I/srv/gump/public/workspace/apr-1/dest-20150103/include/apr-1 -o src/error.lo -c src/error.c && touch src/error.lo /bin/bash /srv/gump/public/workspace/apr-1/dest-20150103/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/srv/gump/public/workspace/tomcat-native/native/include -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux -I/srv/gump/public/workspace/openssl/dest-20150103/include -I/srv/gump/public/workspace/apr-1/dest-20150103/include/apr-1 -o src/file.lo -c src/file.c && touch src/file.lo /bin/bash /srv/gump/public/workspace/apr-1/dest-20150103/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/srv/gump/public/workspace/tomcat-native/native/include -I/usr/lib/jvm/java-8-oracle/include -I/usr/lib/jvm/java-8-oracle/include/linux -I/srv/gump/public/workspace/openssl/dest-20150103/include -I/srv/gump/public/workspace/apr-1/dest-20150103/include/apr-1 -o src/info.lo -c src/info.c && touch src/info.lo /bin/bash /srv/gump/public/workspace/apr-1/dest-20150103/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -DHAVE_OPENSSL -I/srv/gump/public/workspace/tomcat
[GUMP@vmgump]: Project tomcat-trunk-test-nio (in module tomcat-trunk) failed
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-trunk-test-nio has an issue affecting its community integration. This issue affects 1 projects, and has been outstanding for 4 runs. The current state of this project is 'Failed', with reason 'Build Failed'. For reference only, the following projects are affected by this: - tomcat-trunk-test-nio : Tomcat 9.x, a web server implementing the Java Servlet 4.0, ... Full details are available at: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-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 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. -INFO- Failed with reason build failed -INFO- Project Reports in: /srv/gump/public/workspace/tomcat-trunk/output/logs-NIO -INFO- Project Reports in: /srv/gump/public/workspace/tomcat-trunk/output/test-tmp-NIO/logs The following work was performed: http://vmgump.apache.org/gump/public/tomcat-trunk/tomcat-trunk-test-nio/gump_work/build_tomcat-trunk_tomcat-trunk-test-nio.html Work Name: build_tomcat-trunk_tomcat-trunk-test-nio (Type: Build) Work ended in a state of : Failed Elapsed: 25 mins 39 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 -Djunit.jar=/srv/gump/public/workspace/junit/target/junit-4.13-SNAPSHOT.jar -Dobjenesis.jar=/srv/gump/public/workspace/objenesis/main/target/objenesis-2.2-SNAPSHOT.jar -Dtest.reports=output/logs-NIO -Dtomcat-native.tar.gz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20150103-native-src.tar.gz -Dexamples.sources.skip=true -Djdt.jar=/srv/gump/packages/eclipse/plugins/R-4.4-201406061215/ecj-4.4.jar -Dcommons-daemon.jar=/srv/gump/public/workspace/apache-commons/daemon/dist/commons-daemon-20150103.jar -Dcommons-daemon.native.src.tgz=/srv/gump/public/workspace/apache-commons/daemon/dist/bin/commons-daemon-20150103-native-src.tar.gz -Dtest.temp=output/test-tmp-NIO -Dtest.accesslog=true -Dexecute.test.nio=true -Dtest.openssl.path=/srv/gump/public/workspace/openssl/dest-20150103/bin/openssl -Dexecute.test.apr=false -Dexecute.test.nio2=false -Deasymock.jar=/srv/gump/public/workspace/easymock/easymock/target/easymock-3.3.1-SNAPSHOT.jar -Dhamcrest.jar=/srv/gump/public/workspace/hamcrest/build/hamcrest-all-20150103.jar -Dcglib.jar=/srv/gump/packages/cglib/cglib-nodep-2.2.jar test [Working Directory: /srv/gump/public/workspace/tomcat-trunk] CLASSPATH: /usr/lib/jvm/java-8-oracle/lib/tools.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/webapps/examples/WEB-INF/classes:/srv/gump/public/workspace/tomcat-trunk/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-trunk/output/build/bin/bootstrap.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/bin/tomcat-juli.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/annotations-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/servlet-api.ja r:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jsp-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/el-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/websocket-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ant.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-storeconfig.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-coyote.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/jasper-el.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-tribes.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/catalina-ha.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-api.jar:/srv/gump/public/workspace/tomcat-trunk/output/build/lib/tomcat-jni.jar:/srv/gump/public/workspace/tomcat-trunk/output/bu ild/lib/tomcat-spdy.jar:/srv/gump/public/works