JK 1.2.8 backward compatibility question
Hi developers, we are currently using JK connector with Tomcat 4.1.24 and i'm going to migrate applications from 4.1 to 5.5, so for a while 4.1 an 5.5 will coexist in the same machine. I'm planning to install new JK 1.2.8, but i'm wondering about its backward compatibility so i have a few questions: 1- can JK 1.2.8 be used with Tomcat 4.1.24? 2- are old workers configuration files compatible with 1.2.8? 3- can JK from Tomcat 4.1.24 be used with Tomcat 5.5? Thanks, Gabriele. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk: sticky_session deaults to 0 and not to 1 as documented.
Tomcat 4.1.21 connectors 4.1.21 Apache/2.0.44 (Unix) mod_jk/1.2.3-dev If sticky_session property is not declared it defaults to 0 and not 1 as documented. Migrating a working load balancing 4.1.12 configuration to mod_jk/1.2.3-dev gets calls distributed between the workers group members, breaking the load balancer, unless i declare sticky_session=1 in the load balancer worker. You can easily see in the code that if the property is not declared it defaults to JK_FALSE. int jk_get_is_sticky_session(jk_map_t *m, const char *wname) { int rc = JK_TRUE; char buf[1024]; if (m wname) { int value; sprintf(buf, %s.%s.%s, PREFIX_OF_WORKER, wname, STICKY_SESSION); value = map_get_int(m, buf, 0); if (!value) rc = JK_FALSE; } return rc; } Putting line value = map_get_int(m, buf, 0); to value = map_get_int(m, buf, 1); makes everything working as documented. Need to open a bug? Regards, Gabriele. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JK2 URI not correctly mapped for multiple virtual hosts in httpd.conf
Hi Mladen, it's a pain having to express concepts in a language that is not mine. Perhaps that's the reason why you don't understand me. (and i hope nothing i say can sound offensive to anyone, it's not my intention. Believe me i'm trying to cooperate, not to put shame on anybody) Please try to read further than the first line. Tomcat is not supposed to resolve anything. There is Apache in front of it that has to perform that task. The problem is that when configuring jk2 with httpd.conf the way it's shown in the doc i sent, NOT A SINGLE PACKET IS EVER ROUTED TO THE TOMCAT INSTANCES THAT ARE MAPPED FIRST IN HTTPD.CONF, ONLY THE LAST ONE RECEIVES PACKETS. Pls, do not believe me, try to setup a similar conf and run an ip trace. I have right now, more or less ten tomcat instances, all of them happily working with default server.xml and host name=localhost, and different virtual host names within apache httpd.conf, with mod_jk. The only things i changed were port numbers. If what you say is true, then why ivdev01 tomcat instance works? And why simply exchanging place of the virtual host definitions, within httpd.conf, ivdev01 STOPS working and iv00 STARTS working? And why if i map uri's into workers2.properties all the instances works? And all of this without changing a bit of tomcat server.xml? Pls, have a look into jkstatus.noworkers2.htm output. When using the order shown into httpd.conf.noworkers2 file, there is the mapping for ivdev01/*.jsp ivdev01/servlet BUT NO MAPPING FOR iv00/*.jsp iv00/servlets because iv00 virtual host cames FIRST in READ ORDER than ivdev01 host. If i reverse the order of virtual host definitons, ie ivdev01 FIRST then iv00, the reverse happens. I will have mapping for iv00/*.jsp iv00/servlets BUT NO MAPPING FOR ivdev01/*.jsp ivdev01/servlet because now ivdev01 host cames FIRST in READ ORDER than iv00 host. This problem only happens when i try to map the SAME URI PATHS do DIFFERENT virtual hosts within the SAME httpd.conf. If i map DIFFERENT URI PATHS to DIFFERENT virtual hosts all works. Regards, Gabriele. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JK2 URI not correctly mapped for multiple virtual hosts in httpd.conf
Sorry, i just realized that html files are cut out from mail, so i include here the complete set of files as a zip file. (See attached file: jk2uri-problem.zip) Regards, Gabriele. jk2uri-problem.zip Description: Zip archive -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JK2 URI not correctly mapped for multiple virtual hosts in httpd.conf
Hi Mladen, I'll try to answer yor questions. 1- server.xml is the default one with host name=localhost 2- the environmement i'm trying to replicate already works with mod_jk (you may ask, so why don't you stick there? Well at least in the development env i like to be on the bleeding edge of technology). I have a group of developers, each of which has its own tomcat instance, a couple of beta test environments and some production environments. That's the reason to all those groups and load balancers, development and testing and configuration experiments. I tried to clean up the config i sent but something slipped in, in any case this does not change the problem. My sillogism is: if a config is valid and it's working with mod_jk, then it has to work, somehow, also with mod_jk2. 3- No there isn't. When the uri's are mapped into httpd.conf and not into workers2.properties, like the conf files i sent, there is NO way to call iv00/*.jsp, beacuse this uri is not mapped anywhere. If, in httpd.conf, i map as shown virtualhost iv00 then ivdev01, ivdev01/*.jsp works, iv00/*.jsp DOES NOT WORK (404 Not Found). If i reverse, in httpd.conf, the order of virtual hosts, ie ivdev01 THEN iv00, iv00/*.jsp works and ivdev01/*.jsp DOES NOT WORK (404 Not Found). In the end when mapping same uri path to different virtual hosts ONLY THE LAST ONE IN READ ORDER WILL GET CORRECT MAPPING and will be delivered to the correct tomcat instance. If you say me that jk2 is not meant for this kind of configurations, i'll forget everything (with regret because i've got the impression that it's a bit faster and stabler than jk), and stick with jk. But IMHO this is not a correct behaviour and for what in my possibilities i wish to cooperate to solve this. Best regards, Gabriele. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JK2 URI not correctly mapped for multiple virtual hosts in httpd.conf
Suppose you have a configuration like this: VirtualHost 1.1.1.1 ServerName srva ServerAliasa.srva ServerAliasb.srva . [ some apache specific conf omitted] . FilesMatch /*.jsp JkUriSet group wrka /FilesMatch Location /servlet JkUriSet group wrka /Location /VirtualHost VirtualHost 1.1.1.1 ServerName srvb ServerAliasa.srvb ServerAliasb.srvb . [ some apache specific conf omitted] . FilesMatch /*.jsp JkUriSet group wrkb /FilesMatch Location /servlet JkUriSet group wrkb /Location /VirtualHost Mod jk2 will save the uri's only by the names written in FilesMatch and Location without the virtual server name and alias, so after reading the configuration the only save uri set is the last one that was read, as seen from jkstatus runtime uri info: id name host uri group 0/*.jspsrvb /*.jspwrkb 0/servlet srvb /servlet wrkb No mention of srva and all the requests for /*jsp and /servlet, wether sent to srva or srvb will be redirected to wrkb. There is no way ( at least no one i could figure out) to map the requests with the correct worker unless you omit completely any jk2 config from http.conf and map all the uri into workers2.properties. But this is not feasible when you have many virtual hosts with many aliases and many FilesMatch and Location, because of the explosive count of the various combinations [(Number of VirtualHosts) * (number of names for each VirtualHost) * (number of filesystems and webspace containers)] and the fact that the discrimination of the requests is delegated to mod_jk2 instead of the more efficient apache. Is this still work in progress or is a bug? Thanks, Gabriele -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JK2 tomcatId and load balancing
If anybody is interested. I was trying to implement a load balacer with mod_jk2 and i had to dig in the code to discover that the worker propery tomcatId, within the code is called route and is compared to session_route, coming attached to jsessionid, that in turn is the jvmRoute, and that the two must match to implement a working load balacer. For the developers. May be a more consistent naming could help while in the doc is still in the development phase. What do you think about calling it tomcat_jvmRoute? Thanks, Gabriele. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat 4.1.12: access log corrupted
Well, i rechecked all twice, i't a new fresh install. The only old thing is the app context, that is not embedded into server.xml but as a standalone file. I still had a doubt about the jk module that was compiled for 4.1.10, but i downloaded 4.1.12 connectors and recompiled them. I tested both jk and jk2 with ajp3 connector with same results. Also the application was recompiled against 4.1.12. If nobody has any other hint, i'll open a bug. BTW, sorry i posted the initial message both to user and dev lists breaking the rules. I just changed my mind on where to send it, but hit the send button too fast. Regards, Gabriele -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat 4.1.12: access log corrupted
Hi, i'm migrating my webapp from 4.1.10 to 4.1.12, but i guess the access log has gone a bit screwed up. In the context descriptor of the app i have a valve like this: Valve className=org.apache.catalina.valves.AccessLogValve prefix= infoviabilita_access_log. suffix=.txt pattern=common / that worked like a charm with 4.1.10. Now with 4.1.12 have a look to a sample of what i see into it. (Sorry for the weird looking but it's full of control characters that when imbedded into the mail do strange things) I think i should open a bug. Do i? 6a href= - - [26/Sep/2002:13:12:15 1000] GET /main.jsp HTTP/1.1 200 - 172.20.52.27 - - [26/Sep/2002:13:12:34 1000] POST /home/checklogin.jsp HTTP/1.1 302 - waveFlash - - [26/Sep/2002:13:12:41 1000] GET /InfoTraffic/situazione_viabilita.jsp HTTP/1.1 200 - - - [26/Sep/2002:13:12:41 1000] GET /servlet/url.Image?56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz HTTP/1.1 200 5060 - - [26/Sep/2002:13:12:46 1000] GET ??C ?56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz??? HTTP/1.1 200 4537 /table ta - - [26/Sep/2002:13:12:48 1000] POST /InfoTraffic/situazione_viabilita.jsp HTTP/1.1 200 - UTF-8? ma - - [26/Sep/2002:13:12:50 1000] GET /common/mappeflash.jsp?mapCod=8BV_SessionID=1BV_EngineID=2mapType=traffico HTTP/1.1 200 - height=22 - - [26/Sep/2002:13:12:56 1000] GET /InfoPlus/ricercaservizi.jsp HTTP/1.1 200 - - - [26/Sep/2002:13:13:01 1000] GET ??C ?56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz HTTP/1.1 200 5060 /table - - [26/Sep/2002:13:13:04 1000] POST /InfoTraffic/situazione_viabilita.jsp HTTP/1.1 200 - UTF-8? ma - - [26/Sep/2002:13:13:04 1000] GET /common/mappeflash.jsp?mapCod=2BV_SessionID=1BV_EngineID=2mapType=traffico HTTP/1.1 200 - { docume - - [26/Sep/2002:13:13:09 1000] GET /InfoTraffic/andamento_traffico.jsp HTTP/1.1 200 - 172.20.52.27 - - [26/Sep/2002:13:13:32 1000] GET /InfoTraffic/popupRicercaLocalita.jsp?srv=7da=milanoa=lodi HTTP/1.1 302 - window.opene - - [26/Sep/2002:13:13:34 1000] GET /InfoTraffic/popupGraphicDisplayer.jsp?da=milanoa=lodicasello_mappa=yes HTTP/1.1 200 - INK href='/c - - [26/Sep/2002:13:13:39 1000] POST /servlet/GraphicGenerator HTTP/1.1 200 2217 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: tomcat 4.1.10: war deploy in default context not working.
For anyone interested, this is a bug. Refer to http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12521 HTML Manager cannot deploy war file with path=/ Regards, Gabriele. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
tomcat 4.1.10: war deploy in default context not working.
Hi all, Environment: tomcat 4.1.10 ant 1.5 solaris 2.8 JDK 1.4.0_01 I have an application that to work must be deployed in the default context /. It is working fine both when i define it with app.xml into webapps and when i load it dynamically using the manager install command. The following managers commands: install remove start stop reload using path=/ to refer to default context act correctly on the application. The problem is that i cannot deploy a war file of the same application when using default context. My deploy task is deploy url=${manager.url} username=${manager.username} password=${manager.password} path=/ war=file://${dist.home}/${deploy.app.name}.war/ and i receive the message [mdeploy] OK - Installed application at context path / If a use manager list command i see: [list] OK - Listed applications for virtual host localhost [list] /:running:0:/prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/manager/.war [list] /manager:running:0:/usr/local/tomcat-4.1/server/webapps/manager [list] /admin:running:0:/usr/local/tomcat-4.1/server/webapps/admi In the server.xml file i find now the generated entry: Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass =org.apache.catalina.util.CharsetMapper cookies=true crossContext =false debug=0 displayName=Infoviabilita docBase =/prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/manager/.war mapperClass=org.apache.catalina.core.StandardContextMapper path=/ privileged=false reloadable=false swallowOutput=false useNaming =true wrapperClass=org.apache.catalina.core.StandardWrapper /Context In the log i see: 2002-09-09 15:16:27 StandardWrapper[/manager:Manager]: Loading container servlet Manager 2002-09-09 15:16:27 Manager: init: Associated with Deployer 'localhost' 2002-09-09 15:16:27 Manager: init: Global resources are available 2002-09-09 15:16:27 Manager: deploy: Deploying web application at '/' 2002-09-09 15:16:27 Manager: Uploading WAR file to /prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/manager/.war 2002-09-09 15:16:30 Manager: Extracting XML file to /prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/manager/.xml 2002-09-09 15:16:30 StandardHost[localhost]: Installing web application at context path / from URL jar:file:/prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/manager/.war!/ 2002-09-09 15:16:30 WebappLoader[/]: Deploying class repositories to work directory /prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/_ 2002-09-09 15:16:32 WebappLoader[/]: Deploy class files /WEB-INF/classes to /prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/_/WEB-INF/classes 2002-09-09 15:16:32 StandardManager[/]: Seeding random number generator class java.security.SecureRandom 2002-09-09 15:16:32 StandardManager[/]: Seeding of random number generator has been completed 2002-09-09 15:16:32 StandardWrapper[/:default]: Loading container servlet default 2002-09-09 15:16:32 StandardWrapper[/:invoker]: Loading container servlet invoker Up to now everything looks good but... If i refer the application as usual via browser i get: HTTP Status 500 - No Context configured to process this request If i try to undeploy the app using the manager undeploy command i get: [undeploy] FAIL - No context exists for path / The odd thing is that now i use manager install i see: [install] OK - Installed application at context path / and if i list i see (?!): [list] OK - Listed applications for virtual host localhost [list] /:running:0:/prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/manager/.war [list] /manager:running:0:/usr/local/tomcat-4.1/server/webapps/manager [list] /:running:0:/prd/iv00/devel/infoviabilita-1.1/build [list] /admin:running:0:/usr/local/tomcat-4.1/server/webapps/admin You see the miracle? I have TWO application installed at default context, one working (that installed with install comand) and one not working (that installed with the deploy command). The only way to get rid of that /:running:0:/prd/iv00/portale/tomcat-4.1/work/Standalone/localhost/manager/.war context-not-context is to stop tomcat and manually delete the entry from web.xml. Obviously if instead of using path=/ i use any other valid context to deploy, everything works ok. Well, it works in the sense that tomcat acts correctly with the application, the app itself won't run because it's not written to run in a context different from / and its web.xml is not yet complete to have it run from a war file, but at least i see the app is there. Is this a bug or am i doing something really odd? My best regards, Gabriele. [EMAIL PROTECTED] 055-420 2832 388-9473323 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: tomcat 4.1.10: war deploy in default context not working.
Pls, anybody listening? This problem is a real show stopper for us. Can someone tell me if it's a real bug or something wrong that i'm doing? Thanks, Gabriele. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Compiling mod_jk, mod_jk2 on Solaris
For anyone who may be interested, i have managed to compile mod_jk and mod_jk2 of jakarta-tomcat-connectors-4.1.9 for apache 2.0.39 under Solaris 2.8, using both configure and ant methods. The tools used were: ant 1.5 gcc 2.95.2 libtool 1.4.2 Autoconf 2.53 automake 1.6 JDK 1.4.0_01 If you download libtool package from one of the sunfreeware sites, i don't know in what environment it was built, but it produces wrong flags for ld and the link phase will fail. Libtool to produce reliable results is highly sensitive to the environment so in any case i suggest to start with source and build it on your machine. Here's what i did. I'm assuming jakarta-tomcat-connectors-4.1.9-src/jk as base directory, so any reference will be relative to this. ** mod_jk, configure method ** This compiles right out of the box so within native dir i run buildconf.sh then ./configure \ --with-apxs=/usr/local/apache2/bin/apxs \ --with-java-home=${JAVA_HOME} \ --with-java-platform=2 \ --enable-jni then make and that's it. ** mod_jk2, configure method ** Here things start to complicate. native2/include/jk_global.h includes sys/ioctl.h that to expand correctly in solaris needs the BSD_COMP define to be set. So as the easy option you can buildconf.sh ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-tomcat41=/usr/local/jakarta-tomcat-4.1.9 \ --with-java-home=${JAVA_HOME} \ --with-java-platform=2 \ --with-jni make CPPFLAGS=-DBSD_COMP Otherwise if you are really brave you can modify support/jk_apxs.m4 changing the following two lines APXS$1_CFLAGS=`${APXS$1} -q CFLAGS` `${APXS$1} -q EXTRA_CFLAGS` APXS$1_CPPFLAGS=`${APXS$1} -q EXTRA_CPPFLAGS` into APXS$1_CFLAGS=`${APXS$1} -q CFLAGS` `${APXS$1} -q EXTRA_CFLAGS` ${CFLAGS} APXS$1_CPPFLAGS=`${APXS$1} -q EXTRA_CPPFLAGS` ${CPPFLAGS} This allow to pass additional CFLAGS and CPPFLAGS during the configure step that will be merged with those produced by configure and apxs. After this, again buildconf.sh ./configure \ --with-apxs2=/usr/local/apache2/bin/apxs \ --with-tomcat41=/usr/local/jakarta-tomcat-4.1.9 \ --with-java-home=${JAVA_HOME} \ --with-java-platform=2 \ --with-jni \ CPPFLAGS=-DBSD_COMP make I know that for this the first line of jk_apxs.m4 is not really needed to be modified, but i have included it as a nice to have suggestion for the developers. *** mod_jk, ant method *** WARNING: be aware that running ./configure into native or native2 dirs rewrites build.properties, so if you customize it remember to save it if you ever think to use ./configure. (i learned it the hard way) Here you need to customize build.properties as indicated in the README then add the following lines: build.native.cc=gcc the compiler defaults to cc so if you don't have installed Sun official compiler or have an alias or link from cc to gcc you need the previous line. solaris=true j2sdk1.4.0_01/include/jni.h includes the platform dependent jni_md.h that for solaris is in j2sdk1.4.0_01/include/solaris, so to allow the include to succeed you should modify native/build.xml adding to the apache20 and jni targets where the comment says !-- Platform specific includes -- the following line include name=${java.home}/../include/solaris if=solaris/ build.native.extra_cflags=-pthreads -DNO_DBM_REWRITEMAP -DSOLARIS2=8 -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DBSD_COMP (this is broken in the mail but it must be a single line) The values in this line are those used in my compilation but you should get yours as the merge of the output of these commands apache2-dir/bin/apxs -q CFLAGS apache2-dir/bin/apxs -q EXTRA_CFLAGS apache2-dir/bin/apxs -q EXTRA_CPPFLAGS plus the -DBSD_COMP define as previuosly explained. (in the output of those commands you will possibly find -g and -O flags if they were set when apache was compiled. You should not use them since they are controlled by so.debug and so.optimize properties) This is needed because apacheConfig, that will extract those options from apxs, is not yet working and if you want to compile with the same options as the configure method you need to extract them manually from apxs. After this from jk dir just run ant native *** mod_jk2, ant method *** Running ant native actually builds both mod_jk and mod_jk2. For jk2 there would be no need to add solaris=true line into build.properties nor to modify native2/build.xml because into it already are steps necessary to guess os and set the necessary includes, but since the native target is always executed before you need to add this line. Otherwise you can split the native target as follows target name=all-native depends=native,native2 target name=all-clean-native depends=clean-native,clean-native2 target name=native depends=jkant,detect,report ant dir=native