Re: Load-balancing with MS IIS and tomcat 5
i have no idea what you are talking about i just want to get unsubscribed out of this website
Re: mod_jk install problem
i dont' want to install i want to delete this website that keeps poppping up here i never requested for this someone must have gotten my password and did this please help
Re: Load-balancing with MS IIS and tomcat 5
i have no idea what you are talking about i just want to get unsubscribed out of this website
RE: Load-balancing with MS IIS and tomcat 5
To unsubscribe, e-mail: [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 08:50 AM To: [EMAIL PROTECTED] Subject: Re: Load-balancing with MS IIS and tomcat 5 i have no idea what you are talking about i just want to get unsubscribed out of this website - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: workers2.properties path ???
Elijah Epifanov wrote: Silly question: Where do I need to store my workers2.properties file if my apache isn't contained in one directory? /var/conf/apache2 - replacement for ${APACHE2}/conf /usr/local/apache2 - Apache2 root Well, if you're going to re-organize your Apache, then I sugest you follow DEC's logic, which I implement on my Tru64 UNIX, with slight modifications. DEC's setld utility can help with creation of symbolic links from OPT areas to system-standard areas, like /usr/bin, /usr/sbin, /usr/shlib,... Separate each of your RPMs into three areas: 1. BOOT In my case, this is /opt/Apache-2.0.49/ - ./sbin/(init.d/apache, rc3.d/S93apache, rc0.d/K01apache, rc2.d/K01apache). The SETLD SCP will automagically create links to these files in /sbin/(init.d,...) 2. USR For me this is /usr/opt/Apache-2.0.49/* This dir tree holds all files considered read-only from user's view and during normal operations. This is the bulk of the instalation, all executables, libraries, header files and, yes, config files. Why config? Well, it doesn't change *during* Apache's operation, does it? 3. VAR Here, we place VARiable files, files that can change during normal operation. For me it is in /var/opt/Apache-2.0.49. This dir tree holds logs, proxy cache (in case of PostgreSQL it would hold the database), etc. For your case, you'd most likely place startup files directly in their expected places, put logs under /var/log/httpd/ and for the rest of the files, well, it's up to you. I consider /usr/local to be for quick'n'dirty, just slap it together type of instalation. Anything else I intend to use for a longer period of time, I package. Having 14 AlphaServers to attend to tought me the value of a cleanly packaged software. Your case might differ. Linux has /opt area which can be a separate file system. I've seen a couple of /usr/opt instalations. I guess there are no strict rules and it would be most prudent to follow the style imposed by your distro. error_log: [Sun Jun 20 09:02:35 2004] [notice] Apache/2.0.49 (Unix) mod_ssl/2.0.49 OpenSSL/0.9.6g mod_jk2/2.0.4 configured -- resuming normal operations [Sun Jun 20 09:02:35 2004] [error] uriEnv.init() map to invalid worker /tomcat ajp13:localhost:8009 ^^end^^ I guess it is not finding this worker, which would mean it is not finding the workers2.properties file you mention below. As a note, you could keep all URI mappings in workers2 file... It is just your own personal feeling of what is more stable WORKERS definitions or URI/VHost definitions. workers2.properties: [channel.socket:localhost:8009] tomcatId=localhost:8009 [ajp13:localhost:8009] channel=channel.socket:localhost:8009 [uri:/jsp-examples] info=JSP Examples ^^end^^ Everything worked ok before I decided to make a clean installation with more organized tree. Well, one thing that I do and which might help you... I keep mod_jk2 in a separate install package dir. At first, I used to copy workers2.properties file to Apache's config (SCP script would query apxs upon package install). The module loading and global setup was done via config fragment file, as is done by Mandrake - ${APACHE_HOME}/conf/add-on/ holds all such fragments. So, I added to the JK2.conf this (notice the config.file): IfDefine HAVE_JK2 IfModule !mod_jk2.c LoadModule jk2_module /usr/opt/Apache_JK2-2.0.4/module/mod_jk2.so /IfModule /IfDefine IfModule mod_jk2.c # # Restrict access to JK status handler # Location /jkstatus/ Order Deny,Allow Deny from all Allow from 127.0.0.1 Brigitte.ev.co.yu /Location # # Restrict access to JBoss JMX console # Location /jmx-console/ Order Deny,Allow Deny from all Allow from 127.0.0.1 /Location # # Set our (SETLD) location of workers file # JkSet config.file /usr/opt/Apache_JK2-2.0.4/config/workers2.properties # # This should go in host settings, be it virtual or global # It can also go into workers2.properties file in the [uri] # sections (a more proper place, IMHO) # #Location /path # JkUriSetworker ajp13:unixsock #/Location /IfModule Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: workers2.properties path ???
Thanks, I already solved this problem. mod_jk2 has a little bug: it looks for *.properties in `apxs -q prefix`/conf instead of `apxs -q sysconfdir`. - Original Message - From: Nikola Milutinovic [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, June 21, 2004 12:00 PM Subject: Re: workers2.properties path ??? Elijah Epifanov wrote: Silly question: Where do I need to store my workers2.properties file if my apache isn't contained in one directory? /var/conf/apache2 - replacement for ${APACHE2}/conf /usr/local/apache2 - Apache2 root Well, if you're going to re-organize your Apache, then I sugest you follow DEC's logic, which I implement on my Tru64 UNIX, with slight modifications. DEC's setld utility can help with creation of symbolic links from OPT areas to system-standard areas, like /usr/bin, /usr/sbin, /usr/shlib,... Separate each of your RPMs into three areas: 1. BOOT In my case, this is /opt/Apache-2.0.49/ - ./sbin/(init.d/apache, rc3.d/S93apache, rc0.d/K01apache, rc2.d/K01apache). The SETLD SCP will automagically create links to these files in /sbin/(init.d,...) 2. USR For me this is /usr/opt/Apache-2.0.49/* This dir tree holds all files considered read-only from user's view and during normal operations. This is the bulk of the instalation, all executables, libraries, header files and, yes, config files. Why config? Well, it doesn't change *during* Apache's operation, does it? 3. VAR Here, we place VARiable files, files that can change during normal operation. For me it is in /var/opt/Apache-2.0.49. This dir tree holds logs, proxy cache (in case of PostgreSQL it would hold the database), etc. For your case, you'd most likely place startup files directly in their expected places, put logs under /var/log/httpd/ and for the rest of the files, well, it's up to you. I consider /usr/local to be for quick'n'dirty, just slap it together type of instalation. Anything else I intend to use for a longer period of time, I package. Having 14 AlphaServers to attend to tought me the value of a cleanly packaged software. Your case might differ. Linux has /opt area which can be a separate file system. I've seen a couple of /usr/opt instalations. I guess there are no strict rules and it would be most prudent to follow the style imposed by your distro. error_log: [Sun Jun 20 09:02:35 2004] [notice] Apache/2.0.49 (Unix) mod_ssl/2.0.49 OpenSSL/0.9.6g mod_jk2/2.0.4 configured -- resuming normal operations [Sun Jun 20 09:02:35 2004] [error] uriEnv.init() map to invalid worker /tomcat ajp13:localhost:8009 ^^end^^ I guess it is not finding this worker, which would mean it is not finding the workers2.properties file you mention below. As a note, you could keep all URI mappings in workers2 file... It is just your own personal feeling of what is more stable WORKERS definitions or URI/VHost definitions. workers2.properties: [channel.socket:localhost:8009] tomcatId=localhost:8009 [ajp13:localhost:8009] channel=channel.socket:localhost:8009 [uri:/jsp-examples] info=JSP Examples ^^end^^ Everything worked ok before I decided to make a clean installation with more organized tree. Well, one thing that I do and which might help you... I keep mod_jk2 in a separate install package dir. At first, I used to copy workers2.properties file to Apache's config (SCP script would query apxs upon package install). The module loading and global setup was done via config fragment file, as is done by Mandrake - ${APACHE_HOME}/conf/add-on/ holds all such fragments. So, I added to the JK2.conf this (notice the config.file): IfDefine HAVE_JK2 IfModule !mod_jk2.c LoadModule jk2_module /usr/opt/Apache_JK2-2.0.4/module/mod_jk2.so /IfModule /IfDefine IfModule mod_jk2.c # # Restrict access to JK status handler # Location /jkstatus/ Order Deny,Allow Deny from all Allow from 127.0.0.1 Brigitte.ev.co.yu /Location # # Restrict access to JBoss JMX console # Location /jmx-console/ Order Deny,Allow Deny from all Allow from 127.0.0.1 /Location # # Set our (SETLD) location of workers file # JkSet config.file /usr/opt/Apache_JK2-2.0.4/config/workers2.properties # # This should go in host settings, be it virtual or global # It can also go into workers2.properties file in the [uri] # sections (a more proper place, IMHO) # #Location /path # JkUriSetworker ajp13:unixsock #/Location /IfModule Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Web Log Problem in isapi_redirector2.dll
Hi, I am currently connecting a Tomcat 5.0 together with an IIS 4.0 over a Windows NT 4.0 Platform. Everything works fine except for the log file generated per forwarded request: The original GET request is for: http://localhost/jsp-examples/jsp2/misc/dynamicattrs.jsp But the Log file entry in the IIS side becomes: 06:36:19 127.0.0.1 - GET /jakarta/isapi_redirector2.dll - 500 Mozilla/4. 0+(compatible;+MSIE+6.0;+Windows+NT+4.0;+H010818;+.NET+CLR+1.0.3705) - - This result highly affects the effectiveness of the Web Report. All jsp pages will be record as ispai_redirector2.dll, which make the statistics not very useful. Is there any way to configure the redirector such that the GET request is to the jsp pages? I am not sure if this is the problem of IIS or the redirector. If it is the former case, does it mean even when using Apache Httpd, the log will become the same? Thank you. All the best, Richter Yik - This mail sent through IMP: http://horde.org/imp/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: workers2.properties path ???
Elijah Epifanov wrote: Thanks, I already solved this problem. mod_jk2 has a little bug: it looks for *.properties in `apxs -q prefix`/conf instead of `apxs -q sysconfdir`. OK, but you can still use JkSet config.file location to point mod_jk2 to any location for workers2.properties. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.1 SSO pb
Hello ! I've got some trouble with SSO : the SSO Valve is enabled, 2 Contexts are defined . I must login on each application at the first time before I can do a straightforward switch between both application. Any Idea ? Thanks, Arnaud - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HTTPRequest object returns null for getRemoteHost()
Hi Everyone I am using Tomcat 4.1.29 and the getRemoteHost() call from HttpServletRequest is returning null. Do i need to need to configure anything for this api to work ? Thanks Surendra
Re: HTTPRequest object returns null for getRemoteHost()
Hi, by default enableLookups is enabled (==true) You can add the parameter enableLookups=true to a Connector, then getRemoteHost() gives you the desired information Carsten Surendra Kumar wrote: Hi Everyone I am using Tomcat 4.1.29 and the getRemoteHost() call from HttpServletRequest is returning null. Do i need to need to configure anything for this api to work ? Thanks Surendra -- Mit freundlichen Grüßen Dipl.Inform. Carsten Lex Geschäftsführer DeepWeb GmbH DeepWeb GmbH Universität, Gebäude 30 66123 Saarbrücken Tel.: 0681 - 302 6308 Mobil: 0163 - 33 37 002 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 4.1 SSO pb - forget !
Sorry, there was an error in my server.xml Arnaud - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with Tomcat 4.1.30, IIS, isapi_redirect.dll and POSTs
I have been using version 4.1.18 along with the newest isapi_redirect.dll at (Bthe time it was installed for the past year or. Recently to resolve an (Bunrelated problem we upgraded to Tomcat 4.1.30 and isapi_redirect.dll 1.2.5 (Band have been testing things out on our test servers. (B (BThis was working for me for a day or two. Just before I went to deploy this (Bonto our live servers, I decided to do one last test. For some reason, (Ball of (Bthe pages which are requested using a POST, hang for a couple minutes (Bbefore returning an error. (B (BReviewing the log from Tomcat, I found the following message: (B (BJun 21, 2004 6:42:33 PM org.apache.jk.common.HandlerRequest invoke (BSEVERE: Error decoding request (Bjava.io.IOException (Bat org.apache.jk.common.JkInputStream.receive(JkInputStream.java:294) (Bat (Borg.apache.jk.common.HandlerRequest.decodeRequest(HandlerRequest.java:537) (Bat org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:373) (Bat org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673) (Bat (Borg.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615) (Bat org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786) (Bat (Borg.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) (Bat java.lang.Thread.run(Thread.java:536) (B12 34 01 c1 02 04 00 08 48 54 54 50 2f 31 2e 31 | .4.?HTTP/1.1 (B00 00 18 2f 6b 61 6e 73 68 69 2f 6a 5f 73 65 63 | .../kanshi/j_sec (B75 72 69 74 79 5f 63 68 65 63 6b 00 00 0c 31 39 | urity_check...19 (B32 2e 31 36 38 2e 31 2e 33 31 00 00 0c 31 39 32 | 2.168.1.31...192 (B2e 31 36 38 2e 31 2e 33 31 00 00 07 6f 72 6c 61 | .168.1.31...orla (B6e 64 6f 00 00 50 00 00 0b a0 01 00 57 69 6d 61 | ndo..P...?..Wima (B67 65 2f 67 69 66 2c 20 69 6d 61 67 65 2f 78 2d | ge/gif, image/x- (B78 62 69 74 6d 61 70 2c 20 69 6d 61 67 65 2f 6a | xbitmap, image/j (B70 65 67 2c 20 69 6d 61 67 65 2f 70 6a 70 65 67 | peg, image/pjpeg (B2c 20 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d | , application/x- (B73 68 6f 63 6b 77 61 76 65 2d 66 6c 61 73 68 2c | shockwave-flash, (B20 2a 2f 2a 00 a0 04 00 02 6a 61 00 a0 06 00 0a | */*.?...ja.?... (B4b 65 65 70 2d 41 6c 69 76 65 00 a0 0b 00 07 6f | Keep-Alive.?...o (B72 6c 61 6e 64 6f 00 a0 0d 00 1f 68 74 74 70 3a | rlando.?...http: (B2f 2f 6f 72 6c 61 6e 64 6f 2f 6b 61 6e 73 68 69 | //orlando/kanshi (B2f 6c 6f 67 69 6e 2e 6a 73 70 00 a0 0e 00 32 4d | /login.jsp.?..2M (B6f 7a 69 6c 6c 61 2f 34 2e 30 20 28 63 6f 6d 70 | ozilla/4.0 (comp (B61 74 69 62 6c 65 3b 20 4d 53 49 45 20 36 2e 30 | atible; MSIE 6.0 (B3b 20 57 69 6e 64 6f 77 73 20 4e 54 20 35 2e 31 | ; Windows NT 5.1 (B29 00 a0 09 00 2b 4a 53 45 53 53 49 4f 4e 49 44 | ).?..+JSESSIONID (B3d 37 34 39 44 46 39 34 32 42 35 45 38 32 39 33 | =749DF942B5E8293 (B45 39 32 31 32 34 34 36 32 35 36 37 38 41 34 46 | E921244625678A4F (B42 00 a0 08 00 02 33 37 00 a0 07 00 21 61 70 70 | B.?...37.?..!app (B6c 69 63 61 74 69 6f 6e 2f 78 2d 77 77 77 2d 66 | lication/x-www-f (B6f 72 6d 2d 75 72 6c 65 6e 63 6f 64 65 64 00 a0 | orm-urlencoded.? (B03 00 0d 67 7a 69 70 2c 20 64 65 66 6c 61 74 65 | ...gzip, deflate (B00 00 0d 63 61 63 68 65 2d 63 6f 6e 74 72 6f 6c | ...cache-control (B00 00 08 6e 6f 2d 63 61 63 68 65 00 03 00 00 00 | ...no-cache. (B04 00 00 00 ff | ? (BJun 21, 2004 6:42:33 PM org.apache.jk.common.ChannelSocket processConnection (BWARNING: processCallbacks status 2 (B (BDoing additional tests, I have found that it appears to be timeout (Bwaiting for (Bmore data to be sent? (guess) I say this because if I do the POST and then (Bwait patiently then the error takes about 50 seconds to show up in the log. (BThe request will cause 2 such dumps before returning an error to the (Bbrowser. However if I push the submit button on my form then the (Bprevious request will immediately cause the above error to be dumped. (BThe second request will continue to hang until it too times out and dumps (Bthe above message. (B (BI enabled debug output in the connector and get the following. It seems to (Bfail once and then retry. I am including the significant portion of the (Bsecond (Battempt: (B (B[Mon Jun 21 19:14:44 2004] [jk_ajp_common.c (295)]: Into (Bajp_marshal_into_msgb (B[Mon Jun 21 19:14:44 2004] [jk_ajp_common.c (463)]: (Bajp_marshal_into_msgb - Done (B[Mon Jun 21 19:14:44 2004] [jk_connect.c (158)]: Into jk_open_socket (B[Mon Jun 21 19:14:44 2004] [jk_connect.c (165)]: jk_open_socket, try to (Bconnect socket = 424 (B[Mon Jun 21 19:14:44 2004] [jk_connect.c (174)]: jk_open_socket, after (Bconnect ret = 0 (B[Mon Jun 21 19:14:44 2004] [jk_connect.c (183)]: jk_open_socket, set (BTCP_NODELAY to on (B[Mon Jun 21 19:14:44 2004] [jk_connect.c (192)]: jk_open_socket, set (BSO_KEEPALIVE to on (B[Mon Jun 21 19:14:44 2004] [jk_connect.c (200)]: jk_open_socket, return, (Bsd = 424 (B[Mon Jun 21 19:14:44 2004] [jk_ajp_common.c (661)]: In
RE: mod_jk install problem
I have struggled/managed before to compile on solaris8. but not on Redhat9. What is you mod_jk version? I remember i have changed something like.. apx path .configure file as i found it hardcoded there. I have specified the apx-path to apache installation directory (usr/local/apache2/apxs). Have you installed your apache as well? If so, what is the version? Let me know, hope we can sort it out! BK -Original Message- From: Graeme [mailto:[EMAIL PROTECTED] Sent: Sunday, June 20, 2004 7:45 PM To: Tomcat Users List Subject: mod_jk install problem Afternoon all, I'm trying to install mod_jk and I can't create the mod_jk.so file. I think the problem is something to do with: need to check for Perl first, apxs depends on it...checking for perl... /usr/bin/perl Use of uninitialized value in concatenation (.) or string at /usr/sbin/apxs line 262. I'm using Redhat 9. Anyone got any ideas? [EMAIL PROTECTED] native]# ./configure --with-apxs=/usr/sbin/apxs checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... none checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking whether -lc should be explicitly linked in... no creating libtool checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ANSI C... (cached) none needed checking dependency style of gcc... (cached) none checking for ld used by GCC... (cached) /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... (cached) yes checking for test... /usr/bin/test checking for rm... /bin/rm checking for grep... /bin/grep checking for echo... /bin/echo checking for sed... /bin/sed checking for cp... /bin/cp checking for mkdir... /bin/mkdir checking for libtool... /usr/bin/libtool need to check for Perl first, apxs depends on it... checking for perl... /usr/bin/perl could not find /usr/sbin/apxs configure: error: You must specify a valid --with-apxs path [EMAIL PROTECTED] native]# vi /usr/sbin/apxs [EMAIL PROTECTED] native]# ./configure --with-apxs=/usr/sbin/apxs checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we
RE: Session Timeout Error
I do not remember where i can set session time our for a web-app? But i think you must also set keepalive time, if i am not wrong :~)) -Original Message- From: Matt Krone [mailto:[EMAIL PROTECTED] Sent: Friday, June 18, 2004 5:49 PM To: [EMAIL PROTECTED] Subject: Session Timeout Error The web application I developed has a session-timeout setting of 10 minutes. When I authenticate with the application using the web browser Mozila 1.6 the session times out in 10 minutes. However, when I use the web browser IE 6.0 the session does not time out in 10 minutes. Any thoughts would be helpful? -Matt = /* Matt */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ For information about the Standard Bank group visit our web site www.standardbank.co.za __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the group. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of the group. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. ___
Inital values for custom MBeans
Hi Folks, I'm using Tomcat 5.0. the documenation of JMX MBeans descriptors deployable in Tomcat I found contain only the __description__ of attributes and operations. Is there a way to feed a MBean with inital values (default values) at deployment time similar as in jboss SAR files? Any hint is highly appricated :) Thx a lot -- tobias rademacher [sofwareentwickler] innoWake gmbh innovative.software.development(); graf-arco-strasse 18 | 89079 ulm-donautal fon: +49 (0)7 31 - 5 50 27 - 0 fax: +49 (0)7 31 - 5 50 27 - 20 [EMAIL PROTECTED] www.innowake.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to recover from a database server restart when using connection pools?
Use a validationQuery when creating your connection pools. This can be defined where you define your resource. parameter namevalidationQuery/name valueselect 1/value /parameter On Fri, 18 Jun 2004, Tim Freeman wrote: Date: Fri, 18 Jun 2004 14:57:01 -0700 From: Tim Freeman [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: How to recover from a database server restart when using connection pools? I am using database connection pooling and I would like my Tomcat server to be able to cope gracefully with the database server being stopped and restarting. This creates a confusing situation because the connections in the pool all become invalid in that case. Is there a standard way to deal with this? Googling around didn't turn up anything, but it's surely a common situation. I must have searched for the wrong keywords. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Web Log Problem in isapi_redirector2.dll
Yes, that is correct. I don't believe there is a way. It's how it works. IIS is logging what you are doing on that machine. You are accessing the isapi dll. You aren't accessing the jsp -- that's being done across the ajp13 connection. Ideall, you should be setting up some nice logging facility on the app servers and doing trend analysis from there. On Mon, 21 Jun 2004 [EMAIL PROTECTED] wrote: Date: Mon, 21 Jun 2004 16:47:05 +0800 From: [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Web Log Problem in isapi_redirector2.dll Hi, I am currently connecting a Tomcat 5.0 together with an IIS 4.0 over a Windows NT 4.0 Platform. Everything works fine except for the log file generated per forwarded request: The original GET request is for: http://localhost/jsp-examples/jsp2/misc/dynamicattrs.jsp But the Log file entry in the IIS side becomes: 06:36:19 127.0.0.1 - GET /jakarta/isapi_redirector2.dll - 500 Mozilla/4. 0+(compatible;+MSIE+6.0;+Windows+NT+4.0;+H010818;+.NET+CLR+1.0.3705) - - This result highly affects the effectiveness of the Web Report. All jsp pages will be record as ispai_redirector2.dll, which make the statistics not very useful. Is there any way to configure the redirector such that the GET request is to the jsp pages? I am not sure if this is the problem of IIS or the redirector. If it is the former case, does it mean even when using Apache Httpd, the log will become the same? Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with Tomcat + Apache + mod_jk
Hello List, I have a problem with Tomcat 4.1.27, Apache 1.3.26, mod_jk 1.2.5, JDK1.4.2. Somethimes the Apache sends a wrong HTTP-Answer and I'll see the following HTTP-Header in the browser: #3Apache Tomcat/4.1.27 HTTP/1.1 302 Moved Temporarily Date: Fri, 18 Jun 2004 11:23:55 GMT Server: Apache/1.3.26 (Unix) mod_jk/1.2.5 mod_ssl/2.8.10 OpenSSL/0.9.6e Location: http://x/index.jsp Keep-Alive: timeout=50, max=297 Connection: Keep-alive Transfer-Encoding: chunked Content-Type: text/plain 0 What's wrong? I could post the configurations of apache an tomcat if it helps. Greets Jens - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
e-Mails with executable attachments are not accepted here
From : [EMAIL PROTECTED] To : [EMAIL PROTECTED] Subject : Mail Delivery (failure [EMAIL PROTECTED]) (X-FILE ??? ) : message.scr TYPE : audio/x-wav SUSPECT FILES : 1 An e-Mail with the above particulars was received here and was rejected. e-Mails with executable attachments are the number one source of viruses and our policy is to not accept any executable attachments. If you did not send this e-Mail we apologise for this infringement, it was most probably sent by a virus infected machine which happened to use your e-Mail address in the from field and you should ignore this message. If you did send this e-Mail with the executable attachment, please contact the recipient to find out how you can send the attachment to the recipient. Alternatively, you can contact the undersigned for clarifications on our policy. Best Regards UNON Postmaster [EMAIL PROTECTED] UNON Internet mail gateway scanner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
list active sessions.
Is there a way to list all sessions which are currently active for the webapp which would be calling for such a list? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: list active sessions.
I spent a couple of days last week implementing just such a thing, so I feel qualified to answer :) There is no easy way to do it. There USED to be a SessionContext object available in the servlet spec that would allow you to do a lot of cool things with sessions, but it was removed as of spec 2.1 I think because Sun believed it to be a security risk. Unfortunately there was nothing added to take it's place. The way you have to do this, or at least one way (the only way I found) is to track it yourself. First, I already had an AppConfig object that contains a static HashMap. This has a bunch of config values for my app loaded from a config file at startup. I then added an activeSessions HashMap to that class. Create a similar class for yourself, along the lines of the following: import java.util.HashMap; public class AppConfig { private static HashMap activeUsers = null; public static HashMap activeUsers() { return activeUsers; } public static void setActiveUsers(HashMap inActiveUsers) { activeUsers = inActiveUsers; } } Then, create a SessionListener something like the following: package com.mycompany.myapp; import java.util.HashMap; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class SessionListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent se) { HashMap activeUsers = (HashMap)AppConfig.getActiveUsers(); synchronized (activeUsers) { activeUsers.put(se.getSession().getId(), new HashMap()); } } public void sessionDestroyed(HttpSessionEvent se) { HashMap activeUsers = (HashMap)AppConfig.getActiveUsers(); synchronized (appConfig) { activeUsers.remove(se.getSession().getId()); } } } Then just add the following to web.xml after your servlet section: listener listener-classcom.mycompany.myapp.SessionListener/listener-class /listener Basically, every time a session is created, you'll get an entry in the activeUsers HashMap keyed by sessionID, and the record will be removed when the session is destroyed. Further, what I do is that when my logon Action is called, when the user is validated I add some information for that user into the HashMap (first name, last name, logon time, etc). This allows me to have a pretty nice little tracking display in my app. The one problem you run into with this is that if the user just closes the browser window rather than using your nice logout function, the session lingers until the timeout period elapses. I didn't like that! My app is frames-based, and I already had one hidden frame, so I added the following to the body tag of that frame's source document: onUnload=openLogoffPopup(); ... and then the openLogoffPopup() function: function openLogoffPopup() { windowHandle = window.open(, , width=200,height=1,top=1,left=1); str = + html + head + title + /title + /head; str += + body onLoad=\window.location='%=request.getContextPath() + /app/logoff.app%';\; str += + table width=\100%\ height=\100%\ border=\0\; str += + tr + td align=\center\ valign=\middle\; str += + span style=\color:#00;font-family:arial;font-size:11pt;font-weight:bold;\; str += Logging out of application... + /span; str += + /td + /tr; str += + /table; str += + /body + /html; windowHandle.document.write(str); windowHandle.document.close(); } That calls the logoff Action whcih does not much more than session.invalidate(). This works well in IE, I do not know if it is cross-browser though (not a concern for my company). It should work fine to add this to all your JSP's, assuming your app isn't frame-based, I think it'll work just the same. But, maybe you can live with the session lingering if the window is closed anyway. It's probably not a big concern if the timeout period is short enough, but you need to recognize that you may see more than one session per user for a few minutes if they log on again. Hope that helps! Frank From: Alex [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: list active sessions. Date: Mon, 21 Jun 2004 08:52:42 -0400 (EDT) Is there a way to list all sessions which are currently active for the webapp which would be calling for such a list? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: list active sessions.
How would your application cope if it were required to scale up to 250 concurrent users ? It's an interesting approach. Currently I record limited information to a db. All I really want is to be able to list all the active session id's...nothing more. If it's being done already, why do it again... On Mon, 21 Jun 2004, Frank Zammetti wrote: Date: Mon, 21 Jun 2004 09:45:05 -0400 From: Frank Zammetti [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: list active sessions. I spent a couple of days last week implementing just such a thing, so I feel qualified to answer :) There is no easy way to do it. There USED to be a SessionContext object available in the servlet spec that would allow you to do a lot of cool things with sessions, but it was removed as of spec 2.1 I think because Sun believed it to be a security risk. Unfortunately there was nothing added to take it's place. The way you have to do this, or at least one way (the only way I found) is to track it yourself. First, I already had an AppConfig object that contains a static HashMap. This has a bunch of config values for my app loaded from a config file at startup. I then added an activeSessions HashMap to that class. Create a similar class for yourself, along the lines of the following: import java.util.HashMap; public class AppConfig { private static HashMap activeUsers = null; public static HashMap activeUsers() { return activeUsers; } public static void setActiveUsers(HashMap inActiveUsers) { activeUsers = inActiveUsers; } } Then, create a SessionListener something like the following: package com.mycompany.myapp; import java.util.HashMap; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class SessionListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent se) { HashMap activeUsers = (HashMap)AppConfig.getActiveUsers(); synchronized (activeUsers) { activeUsers.put(se.getSession().getId(), new HashMap()); } } public void sessionDestroyed(HttpSessionEvent se) { HashMap activeUsers = (HashMap)AppConfig.getActiveUsers(); synchronized (appConfig) { activeUsers.remove(se.getSession().getId()); } } } Then just add the following to web.xml after your servlet section: listener listener-classcom.mycompany.myapp.SessionListener/listener-class /listener Basically, every time a session is created, you'll get an entry in the activeUsers HashMap keyed by sessionID, and the record will be removed when the session is destroyed. Further, what I do is that when my logon Action is called, when the user is validated I add some information for that user into the HashMap (first name, last name, logon time, etc). This allows me to have a pretty nice little tracking display in my app. The one problem you run into with this is that if the user just closes the browser window rather than using your nice logout function, the session lingers until the timeout period elapses. I didn't like that! My app is frames-based, and I already had one hidden frame, so I added the following to the body tag of that frame's source document: onUnload=openLogoffPopup(); ... and then the openLogoffPopup() function: function openLogoffPopup() { windowHandle = window.open(, , width=200,height=1,top=1,left=1); str = + html + head + title + /title + /head; str += + body onLoad=\window.location='%=request.getContextPath() + /app/logoff.app%';\; str += + table width=\100%\ height=\100%\ border=\0\; str += + tr + td align=\center\ valign=\middle\; str += + span style=\color:#00;font-family:arial;font-size:11pt;font-weight:bold;\; str += Logging out of application... + /span; str += + /td + /tr; str += + /table; str += + /body + /html; windowHandle.document.write(str); windowHandle.document.close(); } That calls the logoff Action whcih does not much more than session.invalidate(). This works well in IE, I do not know if it is cross-browser though (not a concern for my company). It should work fine to add this to all your JSP's, assuming your app isn't frame-based, I think it'll work just the same. But, maybe you can live with the session lingering if the window is closed anyway. It's probably not a big concern if the timeout period is short enough, but you need to recognize that you may see more than one session per user for a few minutes if they log on again. Hope that helps! Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: AW: How can I add Host without restarting Tomcat?
Hmmm Is it possible to prgramatically init and start a new StandardHost? I have code that deploys the context for a new Host and writes the Host block into the server.xml - now I want to be able to programatically init and start the new host - making it available WITHOUT having to do a server restart! Is this possible? Thanks! Carl -Original Message- From: Peter Rossbach [mailto:[EMAIL PROTECTED] Sent: 18 June 2004 12:49 PM To: Tomcat Users List Subject: Re: AW: How can I add Host without restarting Tomcat? Hey, you can used the admin application. Tipp: Add a user with admin role at your conf/tomcat-users.xml! Before you create the new host, create the webapps directory! After create your new host, copy the Catalina/localhost/manager.xml to Catalina/newhost/manager.xml and you have at usefull new host without server restart. Tested with Tomcat 5.0.25. regards Peter Nikola Milutinovic schrieb: Gunnar Pörschke wrote: Non way, because it is written in server.xml file. You'll need to stop the server, I guess Tomcat has a manager application. It can deploy new contexts (applications) on-the-fly, but I'm not sure about hosts. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- J2EE Systemarchitekt und Tomcat Experte http://objektpark.de/ http://www.webapp.de/ Am Josephsschacht 72, 44879 Bochum, Deutschland Telefon: (49) 234 9413228 Mobil:(49) 175 1660884 E-Mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: list active sessions.
Well, never having tried it, I don't know for sure :) But, since we're only talking about a pretty small static object in memory, I assume that would be better-performing than writing out to a database (although obviously you have no persistence, but I don't think that's a problem when talking about sessions). And although there is a critical section involved, since it's only during logon and not every request, I don't imagine it's a significant problem. If your just recording the session ID and not the extra info I do later on, I suspect it would scale just fine. The one problem I can see is if your talking about a distributed environment. Maybe in that case writing out to a database is a better idea. Certainly it's trivial to do that from the listener. You avoid the critical section then, so maybe the trade-off between that and the extra hit of the database access makes it a wash. If you kept it in-memory, it might even be OK because the AppConfig class should be serializable, so theoretically it should be able to get replicated, but I certainly wouldn't go that route, I'd write it to a database and not deal with any potential synchronization issues at all. That means you probably want to write a Struts plug-in, or something else to run at startup, to clear out the database, but that's also not a big deal. So, while I don't know for sure that it will scale to 250 users, I can't see any real problem with it doing so, certainly if it's a single server I'd see it's probably fine as-is, a cluster might require going to a database instead. Frank From: Alex [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: RE: list active sessions. Date: Mon, 21 Jun 2004 09:31:33 -0400 (EDT) How would your application cope if it were required to scale up to 250 concurrent users ? It's an interesting approach. Currently I record limited information to a db. All I really want is to be able to list all the active session id's...nothing more. If it's being done already, why do it again... On Mon, 21 Jun 2004, Frank Zammetti wrote: Date: Mon, 21 Jun 2004 09:45:05 -0400 From: Frank Zammetti [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: RE: list active sessions. I spent a couple of days last week implementing just such a thing, so I feel qualified to answer :) There is no easy way to do it. There USED to be a SessionContext object available in the servlet spec that would allow you to do a lot of cool things with sessions, but it was removed as of spec 2.1 I think because Sun believed it to be a security risk. Unfortunately there was nothing added to take it's place. The way you have to do this, or at least one way (the only way I found) is to track it yourself. First, I already had an AppConfig object that contains a static HashMap. This has a bunch of config values for my app loaded from a config file at startup. I then added an activeSessions HashMap to that class. Create a similar class for yourself, along the lines of the following: import java.util.HashMap; public class AppConfig { private static HashMap activeUsers = null; public static HashMap activeUsers() { return activeUsers; } public static void setActiveUsers(HashMap inActiveUsers) { activeUsers = inActiveUsers; } } Then, create a SessionListener something like the following: package com.mycompany.myapp; import java.util.HashMap; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class SessionListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent se) { HashMap activeUsers = (HashMap)AppConfig.getActiveUsers(); synchronized (activeUsers) { activeUsers.put(se.getSession().getId(), new HashMap()); } } public void sessionDestroyed(HttpSessionEvent se) { HashMap activeUsers = (HashMap)AppConfig.getActiveUsers(); synchronized (appConfig) { activeUsers.remove(se.getSession().getId()); } } } Then just add the following to web.xml after your servlet section: listener listener-classcom.mycompany.myapp.SessionListener/listener-class /listener Basically, every time a session is created, you'll get an entry in the activeUsers HashMap keyed by sessionID, and the record will be removed when the session is destroyed. Further, what I do is that when my logon Action is called, when the user is validated I add some information for that user into the HashMap (first name, last name, logon time, etc). This allows me to have a pretty nice little tracking display in my app. The one problem you run into with this is that if the user just closes the browser window rather than using your nice logout function, the session lingers until the timeout period elapses. I didn't like that!
Re: HTTPRequest object returns null for getRemoteHost()
Hi Carsten I did that and it still returns null. Even if i haven't enabled, it should return me the ip not null value. I am using org.apache.ajp.tomcat4.Ajp13Connector connector. Any clues ? Thanks Surendra - Original Message - From: Carsten Lex [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, June 21, 2004 2:55 PM Subject: Re: HTTPRequest object returns null for getRemoteHost() Hi, by default enableLookups is enabled (==true) You can add the parameter enableLookups=true to a Connector, then getRemoteHost() gives you the desired information Carsten Surendra Kumar wrote: Hi Everyone I am using Tomcat 4.1.29 and the getRemoteHost() call from HttpServletRequest is returning null. Do i need to need to configure anything for this api to work ? Thanks Surendra -- Mit freundlichen Grüßen Dipl.Inform. Carsten Lex Geschäftsführer DeepWeb GmbH DeepWeb GmbH Universität, Gebäude 30 66123 Saarbrücken Tel.: 0681 - 302 6308 Mobil: 0163 - 33 37 002 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: sleepy tomcat
Thanks for all for the help. I found out that the problem is the way how I connect to the database. With JRun I used InitialContext ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup(xxx); con = ds.getConnection(); It didn't work with Tomcat for some reason, so I used Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(xxx); con = ds.getConnection(); And this works very slow or went to sleep or I don't know what. Now I tried the good old way through the DriverManager and it works perfect. What should I change in Tomcat configuration to use the first way? On Sat, 19 Jun 2004 Yana Begun wrote : Hi, I have stand alone version of our web application running with Tomcat. Everything is fine, but after displaying 5-6 pages it starts to work VERY slowly. Like 30 minutes for one page. CPU is not busy at this moment. It seems like nothing happen or tomcat falling asleep. I thought that the problem is the cheap database that we use for this version, but when I tried to connect to the MSSQL, result was the same. Any recommendations, what I can check or how I can test this stuff? Thanks, Yana http://clients.rediff.com/signature/track_sig.asp
Tomcat 5.0.16 behind SSL Accelerator
I searched for this in the archives at mikal.org, and only found the question and no answer. I have Tomcat 5.0.16 behind a hardware SSL accelerator box. The links in my webapps of course refer back to HTTP://myserver.com/myapp, but I of course want them to be rewritten as HTTPS://mysslaccelertor:port/myapp. Is there a simple configuration change in the server.xml that I can make in order to fix this? Thanks, Adrian Klingel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Overenthusiastic use of 'exit' in .bat files in 5.0.25?
I just dropped a clean install of 5.0.25 onto Windows Server 2003, and I did not install ask for a service from the installer. I don't have 'start and stop tomcat' links in my Start menu at all. I then tried to run 'TOMCAT_ROOT\bin\catalina run' to test out my configuration. It didn't locate the JRE. Unfortunately for me, this caused my entire command prompt window to *disappear*, instead of just spewing the error message and returning to command level. This may be because the test for OS=Windows_NT doesn't' Adding a JAVA_HOME setting to setenv.bat cured the problem. However, the disappearing window is rather unkind. A bug? The use of 'exit' in setclasspath.bat, which is 'called' is what causes this problem, I think. Setclasspath should set something to indicate success or failure which can be checked by catalina.bat. Meanwhile, according to the GUI for configuring tomcat, it has picked up the default installation of the JRE in c:\program files. Should that be visible to any of the command-line mechanisms for launching tomcat, or is that purely for services? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Overenthusiastic use of 'exit' in .bat files in 5.0.25?
I left a really bad typo in this message. Here's the fixed version: I just dropped a clean install of 5.0.25 onto Windows Server 2003, and I did not install ask for a service from the installer. I don't have 'start and stop tomcat' links in my Start menu at all. I then tried to run 'TOMCAT_ROOT\bin\catalina run' to test out my configuration. It didn't locate the JRE. Unfortunately for me, this caused my entire command prompt window to *disappear*, instead of just spewing the error message and returning to command level. Adding a JAVA_HOME setting to setenv.bat cured the problem. However, the disappearing window is rather unkind. A bug? The use of 'exit' in setclasspath.bat, which is 'called' is what causes this problem, I think. Setclasspath should set something to indicate success or failure which can be checked by catalina.bat. Meanwhile, according to the GUI for configuring tomcat, it has picked up the default installation of the JRE in c:\program files. Should that be visible to any of the command-line mechanisms for launching tomcat, or is that purely for services? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk2 property - [shm]
I have beeng working with workers2.properties, But i cound not understand one thing in that file. [shm] file=C:/Program Files/Apache Group/Apache2/shm.file size=1048576 What is this shared memory file? I have never seen anything written to it. How would it be used? well! i could guess on this, but i wanted to be more sure. Thank for the help my friends, BK __ For information about the Standard Bank group visit our web site www.standardbank.co.za __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the group. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of the group. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. ___
RE: JK2: lb_factor
Hello Bhaskar (and everyone else who might be interested), I've got good news: finally, loadbalancing with JK2 works great. :-) (And, best of it all: no recompiling of Apache was necessary! *g*) The reason why loadbalancing did not work as it should: I used a test-tool (in fact, Microsofts Web Application Stress Tool) to generate a certain amount of load (by simulating a certain number of clients requests). The tool has a pool of users, each with an own session - however, I had more sequences of requests than users, which means that some users (with existing sessions) were re-used for the next requests. By default, stickySessions in jk2 are enabled, so if the requests belonged to a formerly used session, they were - of course - not balanced as I expected... 2 possibilities, each working perfectly well (depending on what you want to do): - increase number of users in the test tool (that's what worked for me - maybe your problem is similar?) - disable sticky sessions in your workers2.properties: [lb:lb] stickySession=JK_FALSE Than every request - no matter if it belongs to an existing or a new session - is balanced to another server, depending on the lb_factor. And yes, the lb_factor works fine, too, although a little bit strange ;-) : lb_factor is the proportion of all requests divided by number of request for that instance. e.g.: You expect 10,000 requests totally, want them to be distributed to the tomcat instances as follows: Tomcat: TC01TC02TC03 Requests: 250025005000 quotient: 4 4 2 (e.g. 1/2500) lb_factor: 2 2 1 (could also be 4, 4 and 2, but should be as small as possible) I tried something similar with mod_jk 1.2, which works as it is supposed to do, too. So - what have you set your stickySessions to, how do you generate your requests, and where do you see which server handles them? Maybe we can finally find out where your problem is, now we know that it *does* work... ;-) Greets, Nicole -Ursprüngliche Nachricht- Von: Michael Echerer [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 18. Juni 2004 22:25 An: Tomcat Users List Betreff: Re: JK2: lb_factor Kommuru, Bhaskar wrote: Thanks for you comments Michael, So mod_jk2.0.4 does not still seem to be a production quality software. It doesnot work the way it is supposed to work as the documentation. I have spent already a lot of time on this. Actually the 10 Tomcat scenario I mentioned was with mod_jk1.x.y and Apache 2.0.46 (also prefork). I did it merely to verify a new mod_jk2 setup vs. an existing one. Finally I found out that the old setup with mod_jk1 didn't work either. ;-) Why did I start digging... I just want to confirm one thing here that it works and no matter what your settings are :--( By the way... The issue with remote and local workers, can be solved. You have to set the level attribute for each channel in your workers2.properties: take for local workers: level=0 for remote workers: level=1 Usually you will set this for all your channels vice versa on e.g. two Apache machines (each with e.g. 2 local Tomcats and 2 remote Tomcats). In front of the 2 Apaches you could have a hardware lb. The effect is that (each) Apache will only serve its local workers according to its workers2.properties until (here: both!) all local Tomcats are offline. So in this respect to mod_jk2 docu is quite okay. At least this part of the config works for me. I did't that any lb_factor for the channels, only level to achieve this local/remote distribution. If you don't like this you have to set the level equally for all your Tomcat channels. Guess the local/remote levels are mainly to save some bandwith. Michael P.S. Until now I still think, that the best approach would be to try the MPM worker, instead prefork and check whether this has really a positve effect. Any volunteers for compiling Apache 2.x --with-mpm=worker and trying this? If you know any links which tells more details on this, Please let me know. Regards, Bhaskar -Original Message- From: Michael Echerer [mailto:[EMAIL PROTECTED] Sent: Thursday, June 17, 2004 9:08 PM To: Tomcat Users List Subject: Re: JK2: lb_factor I measured similar effects using The Grinder. Under maximum load with long running requests it can be even that worse that one Apache 2.x (default compile: prefork) with 2 Tomcats 5.x/mod_jk2 only distributes to the first Tomcat at all. This is true as long as Apache runs out of MaxClients because of the concurrent requests. Then, for some reason, Apache starts to distribute also some load to the second Apache. So it might help if you lower MaxClients (this seems the only thing that has an direct effect, not lb_factor, not ajp13 threads or anything else) to force this earlier, but be aware that this might produce
Tomcat 5 Session Replication and ServletContext
I'm looking for a clarification on the functionality of the Session Replication within Tomcat 5. Is the only data replicated across servers that which is placed in the HttpSession? In other words, is any data placed within the ServletContext (application layer) object replicated? Thanks for any help. Lukas
RE: Tomcat 5 Session Replication and ServletContext
Yes the only data replicated is the session information. Anything in the application ServletContext will not be copied between servers. Ta Matt -Original Message- From: Lukas Bradley [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 16:09 To: [EMAIL PROTECTED] Subject: Tomcat 5 Session Replication and ServletContext I'm looking for a clarification on the functionality of the Session Replication within Tomcat 5. Is the only data replicated across servers that which is placed in the HttpSession? In other words, is any data placed within the ServletContext (application layer) object replicated? Thanks for any help. Lukas Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5 Session Replication and ServletContext
is it possible to set it up so that each user's session always go to the same app server in a multi app server scenario? or is this not possible and/or a bad idea? --- Dale, Matt [EMAIL PROTECTED] wrote: Yes the only data replicated is the session information. Anything in the application ServletContext will not be copied between servers. Ta Matt -Original Message- From: Lukas Bradley [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 16:09 To: [EMAIL PROTECTED] Subject: Tomcat 5 Session Replication and ServletContext I'm looking for a clarification on the functionality of the Session Replication within Tomcat 5. Is the only data replicated across servers that which is placed in the HttpSession? In other words, is any data placed within the ServletContext (application layer) object replicated? Thanks for any help. Lukas Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5 Session Replication and ServletContext
Yes, this would be controlled by your load balancer. JK2 can do it with sticky sessions. Pen can do it on an IP basis, others have other methods but its easily done. You would then possibly lose failover but it depends on why you are running a cluster. Ta Matt -Original Message- From: Woodchuck [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 17:17 To: Tomcat Users List Subject: RE: Tomcat 5 Session Replication and ServletContext is it possible to set it up so that each user's session always go to the same app server in a multi app server scenario? or is this not possible and/or a bad idea? --- Dale, Matt [EMAIL PROTECTED] wrote: Yes the only data replicated is the session information. Anything in the application ServletContext will not be copied between servers. Ta Matt -Original Message- From: Lukas Bradley [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 16:09 To: [EMAIL PROTECTED] Subject: Tomcat 5 Session Replication and ServletContext I'm looking for a clarification on the functionality of the Session Replication within Tomcat 5. Is the only data replicated across servers that which is placed in the HttpSession? In other words, is any data placed within the ServletContext (application layer) object replicated? Thanks for any help. Lukas Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5 Debug Questions
I have a couple of questions about the debugging options on Tomcat 5: 1. What are the different levels of debugging used within the server.xml file, and is there a description of what each level will bring? 2. I'm looking for a document or instructions to do remote debugging on Tomcat 5. I found some info for Tomcat 4.1 but nothing for the recent releases. Would someone point me to a doc or email about this? Thanks, Brent Worley ** The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please re-send this communication to the sender and delete the original message or any copy of it from your computer system. Thank You. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk2 property - [shm]
Shared Memory File is a cool feature:) (I haven't looked at mod_jk sources for details of its implementation, but the idea should be the same). Generally speaking, it's an ordinary file (with name, attributes, inode, ...), but it isn't used with conventional read/writes. Instead of them, two (or more) processes gain access to this file to map it's contents to a single shared memory segment. Treat this as naming convention for shared memory segments. - Original Message - From: Kommuru, Bhaskar [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, June 21, 2004 6:42 PM Subject: mod_jk2 property - [shm] I have beeng working with workers2.properties, But i cound not understand one thing in that file. [shm] file=C:/Program Files/Apache Group/Apache2/shm.file size=1048576 What is this shared memory file? I have never seen anything written to it. How would it be used? well! i could guess on this, but i wanted to be more sure. Thank for the help my friends, BK __ For information about the Standard Bank group visit our web site www.standardbank.co.za __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the group. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of the group. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. ___ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk install problem
Thank you to everyone who replied to my post. BK, I've got apache installed an running. The version I'm using is: Apache/2.0.40 Server I installed mod_jk from http://www.apache.org/dist/jakarta/tomcat-connectors/jk/ , the file I downloaded is: jakarta-tomcat-connectors-jk-1.2-src-current.tar.gz After doing ./configure --with-apxs=/usr/sbin/apxs I tried issuing the make command I got this: ../common/jk_ajp12_worker.lo ../common/jk_connect.lo ../common/jk_msg_buff.lo ../common/jk_util.lo ../common/jk_ajp13.lo ../common/jk_pool.lo ../common/jk_worker.lo ../common/jk_ajp13_worker.lo ../common/jk_lb_worker.lo ../common/jk_sockbuf.lo ../common/jk_map.lo ../common/jk_uri_worker_map.lo ../common/jk_ajp14.lo ../common/jk_ajp14_worker.lo ../common/jk_md5.lo ../common/jk_ajp_common.lo ../common/jk_context.lo i386-redhat-linux-gcc: ../common/jk_ajp12_worker.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_connect.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_msg_buff.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_util.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_ajp13.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_pool.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_worker.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_ajp13_worker.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_lb_worker.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_sockbuf.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_map.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_uri_worker_map.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_ajp14.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_ajp14_worker.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_md5.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_ajp_common.lo: No such file or directory i386-redhat-linux-gcc: ../common/jk_context.lo: No such file or directory make[1]: *** [mod_jk.la] Error 1 make[1]: Leaving directory `/usr/src/jakarta-tomcat-connectors-jk-1.2.5-src/jk/native/apache-2.0' make: *** [all-recursive] Error 1 [EMAIL PROTECTED] native]# As you will see in my initial post, these missing files appear to be in the apache-2.0 directory. Do you think I should copy them to the directory it expects to find them and try issuing make again, or do something else? Cheers in advance, Graeme :) - Original Message - From: Kommuru, Bhaskar [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, June 21, 2004 12:04 PM Subject: RE: mod_jk install problem I have struggled/managed before to compile on solaris8. but not on Redhat9. What is you mod_jk version? I remember i have changed something like.. apx path .configure file as i found it hardcoded there. I have specified the apx-path to apache installation directory (usr/local/apache2/apxs). Have you installed your apache as well? If so, what is the version? Let me know, hope we can sort it out! BK -Original Message- From: Graeme [mailto:[EMAIL PROTECTED] Sent: Sunday, June 20, 2004 7:45 PM To: Tomcat Users List Subject: mod_jk install problem Afternoon all, I'm trying to install mod_jk and I can't create the mod_jk.so file. I think the problem is something to do with: need to check for Perl first, apxs depends on it...checking for perl... /usr/bin/perl Use of uninitialized value in concatenation (.) or string at /usr/sbin/apxs line 262. I'm using Redhat 9. Anyone got any ideas? [EMAIL PROTECTED] native]# ./configure --with-apxs=/usr/sbin/apxs checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for style of include used by make... GNU checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking dependency style of gcc... none checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep
Re: Multiple Tomcat Instances with Linux
Dan, Thanks for the post, good ideas I'm going to try them. One thing I'm still not clear on. My application is configured to deploy shared modules (jar files) under CATALINA_HOME/shared/lib. If I create multiple instances, how do I configure the apps to share the correct version of CATALINA_HOME/shared/lib? Do you create a separate document root that contains a shared/lib for each Service entry in the server.xml configuration? Jon --- Dan Barron [EMAIL PROTECTED] wrote: Jon, I run multiple tomcat services on a Linux box with Apache for various development and distributions. The way I went about it is to setup multiple Service configurations within the server.xml file. Each service has it own port for connectivity and its own worker for mod_jk. I create a virtual host entry in mod_jk.conf file which mounts the assigned worker which in turn points to the specific tomcat service. Here's the three files I touch to make it work and an example entry. My environment is Tomcat 4.1.29, mod_jk, and Apache 1.3.27. Hope this helps. Dan *FILE:mod_jk.conf #~~~ # domain.com Virtual Host Definition #~~~ VirtualHost 10.10.1.10 ServerName www.domain.com DocumentRoot /usr/www/domain.com ErrorLog logs/domain.com/error_log CustomLog logs/domain.com/access_log common ScriptAlias /cgi-bin/ /usr/www/domain.com/cgi-bin/ Directory /usr/www/domain.com/cgi-bin AllowOverride None Options None Order allow,deny Allow from all /Directory JkMount /servlet/* domain_worker JkMount /alpha/*.jsp domain_worker JkMount /*.jsp domain_worker /VirtualHost **FILE: workers.properties worker.list=ajp13, domain_worker worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=20 worker.ajp13.cachesize=20 worker.domain_worker.port=8010 worker.domain_worker.host=localhost worker.domain_worker.type=ajp13 worker.domain_worker.lbfactor=20 worker.domain_worker.cachesize=20 *FILE:server.xml Server... ... Service name=domain !-- Define a non-SSL HTTP/1.1 Connector on port 8081 -- Connector className=org.apache.catalina.connector.http.HttpConnector port=8081 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=6/ !-- Define an AJP 1.3 Connector on port 8010 -- Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8010 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ !-- Define the top level container in our container hierarchy -- Engine name=domain defaultHost=www.domain.com debug=0 !-- Global logger unless overridden at lower levels -- Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_domain_log. suffix=.txt timestamp=true/ !-- Because this Realm is here, an instance will be shared globally -- Realm className=org.apache.catalina.realm.MemoryRealm / !-- Define the default virtual host -- Host name=www.domain.com debug=0 appBase=webapps/domain.com unpackWARs=true autoDeploy=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=domain_access_log. suffix=.txt pattern=common/ Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=domain_log. suffix=.txt timestamp=true/ !-- domain Root Context -- Context path= docBase= debug=0/ /Host /Engine /Service /Server At 05:26 PM 6/18/2004, Jon Feauto wrote: I see this question posted quite often, but rarely answers abound. Is it because this is too complex a topic to explain in a user group? I would think it is fairly common, anyone have ideas? Jon --- Jon Feauto [EMAIL PROTECTED] wrote: Hello, I'm certain I am behind the curve on this one, but I've been looking around for several days now and haven't found the answers I need. I'm looking to setup multiple environments for Tomcat 4x on a single linux server. One for each developer and several others for different versions of test. From the mail list archives I've come to understand that CATALINA_BASE can be used to configure multiple instances. However, most examples I've seen use this in coordination with multiple server.xml files. I'm hoping there is a trick to this that I'm missing. I don't mind the extra configuration as long as that is the recommended
bean problem
Hello everyone, I have managed to install tomcat4.1.30, apache2.0.49 and the jk1.2.5 connector. I included inside my server.xml file a new context path so that I can run my jsp application through my user directories. Here is what I included: Context path=/myuser docBase=/home/myuser/wwwdocs debug=0 reloadable=true crossContent=true/Context So now, I am able to run under /home/myuser/wwwdocs/test.jsp as follows: http://my.domain.com:8080/myuser/test.jsp or http://my.domain.com/myuser/test/jsp The both work ok. I also have a jsp called list.jsp that uses a bean to connect to an oracle database. When I run http://my.domain.com:8080/myuser/admin/list.jsp everything works perfect and I get an html table with list of my records from my database. But if I run http://my.domain.com/myuser/admin/list.jsp, then the jsp works, but I do get my html table but I do not get any records back at all. The bean is inside /home/myuser/wwwdocs/WEB-INF/classes/tools/dbbean.java, while the list.jsp is only inside /home/myuser/wwwdocs/admin Does anyone know what is going on in here? !-- Claudia Casas Technology does not drive change -- it enables change. --
ConnectionPool timeout
Hello ! I've installed tomcat4 and I'm using the MSSQL-JDBC-Driver with tomcats connectionpooling. Now I have a question about timeouts. In my JSP-site I get a connection from the pool, which works great. But if the Database-Server is not reachable, the JSP does not give any feedback - it will wait for a connection for a very, very long time. After about 10-15 minutes, I get the following message: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket. Here's a test-jsp, which shows, where the script hangs: -- %@ page language=java import=java.util.*,java.sql.*,javax.sql.*,javax.naming.* % % Connection db_con = null; Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/test_db); if ( ds != null ) { try { // This is the place, where the script hangs, when the // database-server is not avaible db_con = ds.getConnection(); } catch ( SQLException se ) { System.out.println(Exception while connecting to db! ( + se.getMessage() + )); } finally { try { db_con.close(); } catch ( SQLException se ) {}; } } % -- Who can tell me, how to configure the timeout ? I think, that 10-15 minutes is much to long :-( (You will find the ressource-conf for my pool at the end of this mail) Thank you very much for your help ! Greetings Frank -- Ressource-Conf in my server.xml -- Resource name=jdbc/test_db type=javax.sql.DataSource/ ResourceParams name=jdbc/test_db parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://192.168.0.199:1433;databasename=test_db/value /parameter parameter nameusername/name valuetester/value /parameter parameter namepassword/name valuetest/value /parameter parameter namevalidationQuery/name valueselect count(*) from users/value /parameter parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value40/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams -- web.xml -- web-app descriptionTest-DB/description resource-ref descriptionDB Connection/description res-ref-namejdbc/test_db/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref /web-app -- -- Name: Frank von Daak eMail: [EMAIL PROTECTED] Homepage: http://www.kpage.de If Bill Gates had a nickel for every time Windows crashed... - oh wait, he does. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat licensing questions
Is there anyone on the list that can answer some questions I have about the redistribution of certain files in Tomcat 4.1.30? Specifically: servlet.jar appears to be a Sun-originated module but is apparently redistributed as part of Tomcat 4.1.30 under the Apache Software License 1.1. Is this correct? I have in the past seen other Sun-originated modules in Apache distributions and I'm wondering what the licensing terms of the contribution and subsequent redistribution are. Thanks Adrian Adrian Cho Manager, Intellectual Property IBM Ottawa Lab 2670 Queensview Drive Ottawa, Canada K2B 8K1 Phone: (613) 726-5536 Fax: (613) 820 1202 Website: http://www.can.ibm.com/ottawalab/ E-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ConnectionPool timeout
Hi again. What the hell ist this ? Spam as autorespond on the tomcat-user list Oh f... unbelevable!!! Am Montag, 21. Juni 2004 20:43 schrieb Autoresponder: Most likely the answer to your question is at: http://pc-magic.com/faq.htm Should you not find the answer to your question you will be told how to contact us directly. Thank you. (This is an automated response) -- Name: Frank von Daak eMail: [EMAIL PROTECTED] Homepage: http://www.kpage.de If Bill Gates had a nickel for every time Windows crashed... - oh wait, he does. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ConnectionPool timeout
I'm seeing evidence of several odd auto-responses. It looks like someone thinks that it is a fun prank to add random addresses of unsuspecting people to this list. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: AW: How can I add Host without restarting Tomcat?
Look at tomcat's administration tool - it can dynamically add hosts. Looks at its codes. Go from there. -Original Message- From: Carl Olivier [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 7:00 AM To: 'Tomcat Users List' Subject: RE: AW: How can I add Host without restarting Tomcat? Hmmm Is it possible to prgramatically init and start a new StandardHost? I have code that deploys the context for a new Host and writes the Host block into the server.xml - now I want to be able to programatically init and start the new host - making it available WITHOUT having to do a server restart! Is this possible? Thanks! Carl -Original Message- From: Peter Rossbach [mailto:[EMAIL PROTECTED] Sent: 18 June 2004 12:49 PM To: Tomcat Users List Subject: Re: AW: How can I add Host without restarting Tomcat? Hey, you can used the admin application. Tipp: Add a user with admin role at your conf/tomcat-users.xml! Before you create the new host, create the webapps directory! After create your new host, copy the Catalina/localhost/manager.xml to Catalina/newhost/manager.xml and you have at usefull new host without server restart. Tested with Tomcat 5.0.25. regards Peter Nikola Milutinovic schrieb: Gunnar Prschke wrote: Non way, because it is written in server.xml file. You'll need to stop the server, I guess Tomcat has a manager application. It can deploy new contexts (applications) on-the-fly, but I'm not sure about hosts. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- J2EE Systemarchitekt und Tomcat Experte http://objektpark.de/ http://www.webapp.de/ Am Josephsschacht 72, 44879 Bochum, Deutschland Telefon: (49) 234 9413228 Mobil:(49) 175 1660884 E-Mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07.06.2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07.06.2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
connectionpool initial number of connections
Hi, I have successfully migrated my application from using a third party connection pooling to tomcat connection pooling using data sources. The documentation helped me a lot. However I want to initialize a certain number of connections at the start up just as the maxActive connections. Is there anyway of doing this? Thanks shyam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
There's a couple of different ways to handle this. 1. do not do it in real time. this is the easiest solution, but it means a human has to be the one who figures who gets what class. 2. use JMS to update each user's session and make it so that once the class has no more entries, no one else can add it to their cart. Say user 1 submits before user 2. if user 1 registers before 2, a message is sent to the java bean in memory to update the cart 3. process the orders on a first come first serve basis, but do not gaurantee the person is signed up for it. In the response email state, you will get a confirmation of successful regisration. This is usually the easiest way to assuming you send confirmation in reasonable amount of time. This implies the transaction are processed async with some kind of queue 4. check availability before starting the transaction. this means some kind of locking at the row level. I'm sure there are other ways of doing it. Personally, I prefer handling the transaction on a first come first serve basis and send out confirmation in reasonable time. peter On Mon, 21 Jun 2004 12:37:04 -0700, Mufaddal Khumri [EMAIL PROTECTED] wrote: Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
Have you thought about doing something like a soft reservation? As the person adds courses to their shopping cart, the available space is decremented. If the transaction isn't finalized either because of an error or timeout, just release the seat for someone else. When they do finalize the transaction, make the reservation a hard, permanent one. Just a thought. --David Mufaddal Khumri wrote: Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design question ..
Most commercial databases implement a solution to this problem since it is fairly common. For MySQL, you must use the InnoDB engine (at least for now). You use the concept of transaction. To do this, you must turn the AutoCommit mode to off (some client have this mode off by default, some do not. Check your documentation. If you are going through JDBC Connections are always in AutoCommit(true)!). You must also set the Transaction Mode to Transaction_Serializable which locks table so that no one else then you can read the data in your tables. The code looks something like this: try { //Validate information //Add the record in the table //Bill the customer //commit transaction } catch (SQLException) { //rollback the transaction cause something went wrong } finally { //close the connection } Where you bill the customer is dicussable (it is related to the transaction but does not require DB access). It's all up to you really. A couple of things to notice: - TRANSACTION_SERIALIZABLE is the most demanding mode for your database server. - If you forget even one commit() or rollback() you might lose data to locking. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Design question ..
Probably the easiest way to handle this is simply to have a constraint on your database that says a record cannot be added if some field is 0 (or a unique constraint, depending on how your table is keyed). Then, just catch the exception in your code and check to see if it's a violation of your rule, then return a message to the user saying the class has filled up. Simply put, don't worry about them putting the class in the shopping cart. Make sure you have a note on the site that says they are NOT actually registered until the shopping cart is processed. Then, let the database handle the concurrency issues (which they are very good at!) and you don't have to complicate your code any. I generally like staying away from database-level rules like this, just in case you tie yourself to a particular vendor, but something like this is pretty safe, and is tailor-made for such a mechanism. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Design question .. Date: Mon, 21 Jun 2004 12:37:04 -0700 Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Movies - Trailers, showtimes, DVD's, and the latest news from Hollywood! http://movies.msn.click-url.com/go/onm00200509ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple Tomcat Instances with Linux
Jon, I have used the CATALINA_HOME/common/lib to share jar files among different Service instances. Not sure if that answers your question though. Dan At 10:54 AM 6/21/2004, you wrote: Dan, Thanks for the post, good ideas I'm going to try them. One thing I'm still not clear on. My application is configured to deploy shared modules (jar files) under CATALINA_HOME/shared/lib. If I create multiple instances, how do I configure the apps to share the correct version of CATALINA_HOME/shared/lib? Do you create a separate document root that contains a shared/lib for each Service entry in the server.xml configuration? Jon --- Dan Barron [EMAIL PROTECTED] wrote: Jon, I run multiple tomcat services on a Linux box with Apache for various development and distributions. The way I went about it is to setup multiple Service configurations within the server.xml file. Each service has it own port for connectivity and its own worker for mod_jk. I create a virtual host entry in mod_jk.conf file which mounts the assigned worker which in turn points to the specific tomcat service. Here's the three files I touch to make it work and an example entry. My environment is Tomcat 4.1.29, mod_jk, and Apache 1.3.27. Hope this helps. Dan *FILE:mod_jk.conf #~~~ # domain.com Virtual Host Definition #~~~ VirtualHost 10.10.1.10 ServerName www.domain.com DocumentRoot /usr/www/domain.com ErrorLog logs/domain.com/error_log CustomLog logs/domain.com/access_log common ScriptAlias /cgi-bin/ /usr/www/domain.com/cgi-bin/ Directory /usr/www/domain.com/cgi-bin AllowOverride None Options None Order allow,deny Allow from all /Directory JkMount /servlet/* domain_worker JkMount /alpha/*.jsp domain_worker JkMount /*.jsp domain_worker /VirtualHost **FILE: workers.properties worker.list=ajp13, domain_worker worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=20 worker.ajp13.cachesize=20 worker.domain_worker.port=8010 worker.domain_worker.host=localhost worker.domain_worker.type=ajp13 worker.domain_worker.lbfactor=20 worker.domain_worker.cachesize=20 *FILE:server.xml Server... ... Service name=domain !-- Define a non-SSL HTTP/1.1 Connector on port 8081 -- Connector className=org.apache.catalina.connector.http.HttpConnector port=8081 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=6/ !-- Define an AJP 1.3 Connector on port 8010 -- Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8010 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ !-- Define the top level container in our container hierarchy -- Engine name=domain defaultHost=www.domain.com debug=0 !-- Global logger unless overridden at lower levels -- Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_domain_log. suffix=.txt timestamp=true/ !-- Because this Realm is here, an instance will be shared globally -- Realm className=org.apache.catalina.realm.MemoryRealm / !-- Define the default virtual host -- Host name=www.domain.com debug=0 appBase=webapps/domain.com unpackWARs=true autoDeploy=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=domain_access_log. suffix=.txt pattern=common/ Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=domain_log. suffix=.txt timestamp=true/ !-- domain Root Context -- Context path= docBase= debug=0/ /Host /Engine /Service /Server At 05:26 PM 6/18/2004, Jon Feauto wrote: I see this question posted quite often, but rarely answers abound. Is it because this is too complex a topic to explain in a user group? I would think it is fairly common, anyone have ideas? Jon --- Jon Feauto [EMAIL PROTECTED] wrote: Hello, I'm certain I am behind the curve on this one, but I've been looking around for several days now and haven't found the answers I need. I'm looking to setup multiple environments for Tomcat 4x on a single linux server. One for each developer and several others for different versions of test. From the mail list archives I've come to understand that CATALINA_BASE can be used to configure multiple instances. However, most examples I've seen use this in coordination with multiple server.xml files. I'm
/admin/users/ is open for source browsing
Hi, I have occasionally discovered that the 'admin' app reveals its jsp folders' contents without any password. And allows reading jspf sources afterwards... Is it intended? ;) And maybe a more general question - is it sound to have the default servlet 'listings' defaulting to 'true'? Perhaps it might be more safe to explicitly allow browsing where necessary? Regards, Serge - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Enabling EL on Tomcat 5.0
I am following the book Java Server Pages, 3rd Edition and all samples run in a snap. But when I try to use EL no my pages it doesn't work. I mean if a write: ${1+2+3} I got the ${1+2+3} instead of 6 How should I configure tomcat to evaluate expression? Thanks, Valter
JNDI Question
Forgive me for being a newbie, but here is a question regarding JNDI. I have my server.xml configured and my web.xml configured for a resource named xyz. xyz is a custom object factory contained within class files (currently under WEB-INF/classes/xyz/). The error I'm getting is this: Caused by: javax.naming.NamingException: Could not create resource factory instance, null at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory. java:99) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:301) at org.apache.naming.NamingContext.lookup(NamingContext.java:791) at org.apache.naming.NamingContext.lookup(NamingContext.java:138) at org.apache.naming.NamingContext.lookup(NamingContext.java:779) at org.apache.naming.NamingContext.lookup(NamingContext.java:138) at org.apache.naming.NamingContext.lookup(NamingContext.java:779) at org.apache.naming.NamingContext.lookup(NamingContext.java:151) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:136) at javax.naming.InitialContext.lookup(InitialContext.java:347) at search.Search.clinit(Search.java:22) ... 48 more I'm I'm reading this correctly, when the VM is trying to create the object needed for xyz (correct?). My question is do I need to jar up the files for xyz and add them to the common/lib directory? Thanks, Brent Worley ** The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please re-send this communication to the sender and delete the original message or any copy of it from your computer system. Thank You. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Enabling EL on Tomcat 5.0
I had a similar problem recently Assuming that you have the appropriate jar files in the appropriate locations you will need the following in your application's web.xml web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd version=2.4 ... and something like the following in your JSP %@ taglib prefix=fn uri=http://java.sun.com/jsp/jstl/functions; % this tells Tomcat to be compatible with the appropriate version of the Servlet spec and to refer to the appropriate jstl version. Valter G. Nogueira Jr. wrote: I am following the book Java Server Pages, 3rd Edition and all samples run in a snap. But when I try to use EL no my pages it doesn't work. I mean if a write: ${1+2+3} I got the ${1+2+3} instead of 6 How should I configure tomcat to evaluate expression? Thanks, Valter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache2 and mod_jk.so
I've currently have a CMS called Magnolia installed. Magnolia 1.1 comes with Tomcat 4.0 and installs Tomcat during the Magnolia installation. Magnolia consists of two instances: Author (for Admin) and Public. I'm using Mac OS X (Panther), and have Magnolia installed and the Author and Public running and can access both by; Author = http://localhost:8081 Public = http://localhost:8082. The Public is instance I want to serve via Apache2 from my home server. I'm trying to understand if I have to utilize the mod_jk.so and virtual hosting elements of Apache2 and Tomcat and which mod_jk.so do I need? Source? Binary? I downloaded jakarta-tomcat-connectors-jk-1.2.5-src but, I don't understand where or how to build? I have a domainname.com that I want to point to the Public instance, I just don't know where to start? Samuel. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
I do not want port 8080. Anyone know how to?
Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change.
Re: Apache2 and mod_jk.so
why not use mod_proxy or mod_redirect instead, and a named virtual host in apache, no compilation needed, the apache modules already come with it Filip - Original Message - From: Samuel V. Green III [EMAIL PROTECTED] To: _Tomcat Users List [EMAIL PROTECTED] Sent: Monday, June 21, 2004 4:06 PM Subject: Apache2 and mod_jk.so I've currently have a CMS called Magnolia installed. Magnolia 1.1 comes with Tomcat 4.0 and installs Tomcat during the Magnolia installation. Magnolia consists of two instances: Author (for Admin) and Public. I'm using Mac OS X (Panther), and have Magnolia installed and the Author and Public running and can access both by; Author = http://localhost:8081 Public = http://localhost:8082. The Public is instance I want to serve via Apache2 from my home server. I'm trying to understand if I have to utilize the mod_jk.so and virtual hosting elements of Apache2 and Tomcat and which mod_jk.so do I need? Source? Binary? I downloaded jakarta-tomcat-connectors-jk-1.2.5-src but, I don't understand where or how to build? I have a domainname.com that I want to point to the Public instance, I just don't know where to start? Samuel. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I do not want port 8080. Anyone know how to?
in conf/server.xml change 8080 to 80 - Original Message - From: Casas, Claudia [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, June 21, 2004 4:18 PM Subject: I do not want port 8080. Anyone know how to? Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I do not want port 8080. Anyone know how to?
Hi, You merely need to comment out the HTTP connector in your conf/server.xml Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:19 To: Tomcat Users List Subject: I do not want port 8080. Anyone know how to? Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change. Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JNDI Question
Have a look at http://issues.apache.org/bugzilla/show_bug.cgi?id=29584. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
Hi, Yes , first come first is something that I prefer too. But I will need a singleton java object with a synchronized method to do the transaction. The transaction would involve 1. Check data 2. Register 3. commit data to database. After the method completes i can send them a confirmation. The downside to this approach is that if lots of users are registering for courses online , they might experience a delay. On Jun 21, 2004, at 12:47 PM, Peter Lin wrote: There's a couple of different ways to handle this. 1. do not do it in real time. this is the easiest solution, but it means a human has to be the one who figures who gets what class. 2. use JMS to update each user's session and make it so that once the class has no more entries, no one else can add it to their cart. Say user 1 submits before user 2. if user 1 registers before 2, a message is sent to the java bean in memory to update the cart 3. process the orders on a first come first serve basis, but do not gaurantee the person is signed up for it. In the response email state, you will get a confirmation of successful regisration. This is usually the easiest way to assuming you send confirmation in reasonable amount of time. This implies the transaction are processed async with some kind of queue 4. check availability before starting the transaction. this means some kind of locking at the row level. I'm sure there are other ways of doing it. Personally, I prefer handling the transaction on a first come first serve basis and send out confirmation in reasonable time. peter On Mon, 21 Jun 2004 12:37:04 -0700, Mufaddal Khumri [EMAIL PROTECTED] wrote: Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Mufaddal Khumri Software Developer Waves In Motion Phone: 602 956 7080 x 26 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Settings On Tomcat
Endre Stølsvik wrote: Why not? I don't think this is correct. See, if the class isn't referenced anymore, by not having any referenced objects of that class (by any reference), nor having the class object referenced, on the stack of any of the JVM's created Threads, then the static fields of that class isn't referenced either, and thus both will be gc'ed, and then the classloader will be gc'ed.. More on this here: http://java.sun.com/docs/books/jls/second_edition/html/execution.doc.html#74294 IMHO there is no problem in classloaders being thrown away. BTW NetBeans module system successfully unloads (discards) disabled modules. Don't know why tomcat should not do the same ... (But you might have to deal with http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4646668 and maybe other subtle problems). David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
I understand this method of doing it and I understand the pseudo code too. I believe this code will be in a synchronized method that should be placed in a singleton object. The code validates information. One example validation could be getting current registrations for the course and seeing if there is place left for this new user to enroll in that course. If this method is not synchronized then two different users could be in this same function validating their data and then they would try to register for the course too. If the number of users using the system to register for courses is high this singleton object encapsulating this synchronized method, would e a bottle neck. Is there any other solution or is this standard implementation? On Jun 21, 2004, at 12:54 PM, Jérôme Duval wrote: Most commercial databases implement a solution to this problem since it is fairly common. For MySQL, you must use the InnoDB engine (at least for now). You use the concept of transaction. To do this, you must turn the AutoCommit mode to off (some client have this mode off by default, some do not. Check your documentation. If you are going through JDBC Connections are always in AutoCommit(true)!). You must also set the Transaction Mode to Transaction_Serializable which locks table so that no one else then you can read the data in your tables. The code looks something like this: try { //Validate information //Add the record in the table //Bill the customer //commit transaction } catch (SQLException) { //rollback the transaction cause something went wrong } finally { //close the connection } Where you bill the customer is dicussable (it is related to the transaction but does not require DB access). It's all up to you really. A couple of things to notice: - TRANSACTION_SERIALIZABLE is the most demanding mode for your database server. - If you forget even one commit() or rollback() you might lose data to locking. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Mufaddal Khumri Software Developer Waves In Motion Phone: 602 956 7080 x 26 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reply to Filip
Thanks Filip, If I'm running my host on a network and serving Apache2 from 10.0.1.2.. I've been successful in the past at setting up the virtual host stuff to serve document roots from my Apache root doc, i.e.. /library/webserver/documents What I don't understand is how to serve the Public instance of localhost:8082 via virtual host? I have the Public instance installed at /library/magnolia/public Samuel. On Jun 21, 2004, at 2:22 PM, Filip Hanik - Dev wrote: why not use mod_proxy or mod_redirect instead, and a named virtual host in apache, no compilation needed, the apache modules already come with it Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
Since everyone else seems to have an opinion on this, I figure that I might as well share mine. :) A couple things to keep in mind: (*) Depending on your geographic location, you may have a legal responsibility to make sure that an item listed as available is, indeed, available. In other words, you can't tell a user that an item is available, let them put into their cart, then tell them it's not available when they try to pay for it. This is municipality-specific, but something to keep in mind for those doing cross-border sales. (*) The requirement you have described is a business-process requirement. It is not technical and therefore, IMHO, should not be satisfied with row locking, transaction manipulation, etc. Satisfy it on the controller level and avoid polluting your model with stuff like this. My personal inclination (which could change depending on the situation) would be to give users an X minute (logical) lock once something has been put in their cart. If they don't buy it (or indicate they want to keep it) after that time is up, it goes back on the shelf. In other words, treat everything in your inventory like a real object ... if a consumer wants to buy it, give them a pickup-ticket that they can take to the cashier. Ensure that the number of pickup-tickets equals the number of real items in inventory. The primary benefit here is that you'll fail fast instead of promising something that you can't deliver. (This isn't my idea, BTW ... take a look at TicketMaster when a hot concert goes on sale to see this in action) justin At 12:37 PM 6/21/2004, you wrote: Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reply to Filip
this is a great read, a virtual hosts lets you set up docbase and all kinds of commands just for that host. http://httpd.apache.org/docs-2.0/vhosts/ named virtual hosts, lets you access the same IP, different doc bases using different host names. Filip - Original Message - From: Samuel V. Green III [EMAIL PROTECTED] To: _Tomcat Users List [EMAIL PROTECTED] Sent: Monday, June 21, 2004 4:38 PM Subject: Reply to Filip Thanks Filip, If I'm running my host on a network and serving Apache2 from 10.0.1.2.. I've been successful in the past at setting up the virtual host stuff to serve document roots from my Apache root doc, i.e.. /library/webserver/documents What I don't understand is how to serve the Public instance of localhost:8082 via virtual host? I have the Public instance installed at /library/magnolia/public Samuel. On Jun 21, 2004, at 2:22 PM, Filip Hanik - Dev wrote: why not use mod_proxy or mod_redirect instead, and a named virtual host in apache, no compilation needed, the apache modules already come with it Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
Hi Frank I understand this approach. The problem is that the course table has a field called maxregistration if this field is set to -1 it means that there is no limit. If there is a value in this field, it will be = 1. I have another table called Enrollments. This table has courseId, userId information. It keeps track of what user is enrolled in what course. I have a waitinglist table which has userId, courseId, timestamp. It keeps track of what users are waiting to be enrolled in a course that has met its capacity. The instructor can give override to users in waitinglist for a table. An override transfers a user from the WaitingList table to the Enrollment table. This means that at any given time the enrollment table could have more than course.maxregistration users enrolled for a course. Could you give me an example of a constraint that I could put on my tables so that it does not allow registrations more than course.maxregistration? On Jun 21, 2004, at 12:56 PM, Frank Zammetti wrote: Probably the easiest way to handle this is simply to have a constraint on your database that says a record cannot be added if some field is 0 (or a unique constraint, depending on how your table is keyed). Then, just catch the exception in your code and check to see if it's a violation of your rule, then return a message to the user saying the class has filled up. Simply put, don't worry about them putting the class in the shopping cart. Make sure you have a note on the site that says they are NOT actually registered until the shopping cart is processed. Then, let the database handle the concurrency issues (which they are very good at!) and you don't have to complicate your code any. I generally like staying away from database-level rules like this, just in case you tie yourself to a particular vendor, but something like this is pretty safe, and is tailor-made for such a mechanism. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Design question .. Date: Mon, 21 Jun 2004 12:37:04 -0700 Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Movies - Trailers, showtimes, DVD's, and the latest news from Hollywood! http://movies.msn.click-url.com/go/onm00200509ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Mufaddal Khumri Software Developer Waves In Motion Phone: 602 956 7080 x 26 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I do not want port 8080. Anyone know how to?
Thanks for your prompt answer. Unfortunately this solution did not work for me. When I remove the http connector, then I can see my web pages through apache. But I cannot see any jsp's at all. Also, If I change port 8080 to port 80 in my server.xml file; then I have the same problem. I can see my web pages, but not my jsp's. -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 3:29 PM To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Hi, You merely need to comment out the HTTP connector in your conf/server.xml Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:19 To: Tomcat Users List Subject: I do not want port 8080. Anyone know how to? Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I do not want port 8080. Anyone know how to?
ok, try mod_proxy, it might be easier. but your problem is that you prolly didn't configure mod_jk properly, read the docs (should be tons of them out there) and try again Filip - Original Message - From: Casas, Claudia [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, June 21, 2004 4:47 PM Subject: RE: I do not want port 8080. Anyone know how to? Thanks for your prompt answer. Unfortunately this solution did not work for me. When I remove the http connector, then I can see my web pages through apache. But I cannot see any jsp's at all. Also, If I change port 8080 to port 80 in my server.xml file; then I have the same problem. I can see my web pages, but not my jsp's. -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 3:29 PM To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Hi, You merely need to comment out the HTTP connector in your conf/server.xml Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:19 To: Tomcat Users List Subject: I do not want port 8080. Anyone know how to? Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I do not want port 8080. Anyone know how to?
Then it sounds like both solutions worked partly. For Filip's solution to work you would have to shut down apache completely and apache becomes the standard web server and both servlets and jsp's should work, but you lose apache. It sounds like when you tried my solution that you have a missing part in your mappings. Have a look in the workers.properties (or workers2.properties if it is jk2) and you will need a mapping along the lines of /yourapp/*.jsp so that your jsp's are mapped or even just /yourapp/* should map the whole webapp. If you dont understand post your workers.properties and i'll see if I can help. Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:47 To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Thanks for your prompt answer. Unfortunately this solution did not work for me. When I remove the http connector, then I can see my web pages through apache. But I cannot see any jsp's at all. Also, If I change port 8080 to port 80 in my server.xml file; then I have the same problem. I can see my web pages, but not my jsp's. -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 3:29 PM To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Hi, You merely need to comment out the HTTP connector in your conf/server.xml Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:19 To: Tomcat Users List Subject: I do not want port 8080. Anyone know how to? Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
request process flow and user profiling
Hi, I need to mainten a profile database with login, password, telephone numbers and so on. I think I need to know how tomcat is handeling the request flow. My goal is to achive the following (if there are better ways to it, please let me know). Profile profile = request.getSessio().getProfile(); if( ! profile.loggedIn){ the user is not logged in... else telephoneNumber=profile.getNumber(); } I suppose there is a kind of pipeline of servlets that one after another is processing the request object untill it finally is handeled by the end servlet (e.g test.jsp) If it doesn't allready exists, I would like to extend the session object with to members: short: public class mySession extends Session{ Boolean loggedIn; Profileprofile; } and put a class into the pipeline which, dependend on wether or not the user is logged in, sets loggedIn=true and profile=som object containg profile information; Does this allready exist as a functionallity in tomcat? I know other servlet-containers (Dynamo from ATG) has this kind of profile handeling. Where can I find documentation on how tomcat is processing the request flow? Thanks in advance trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. **
RE: I do not want port 8080. Anyone know how to?
sorry, corrected mistake below -Original Message- From: Dale, Matt Sent: 21 June 2004 22:54 To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Then it sounds like both solutions worked partly. For Filip's solution to work you would have to shut down apache completely and tomcat becomes the standard web server and both servlets and jsp's should work, but you lose apache. It sounds like when you tried my solution that you have a missing part in your mappings. Have a look in the workers.properties (or workers2.properties if it is jk2) and you will need a mapping along the lines of /yourapp/*.jsp so that your jsp's are mapped or even just /yourapp/* should map the whole webapp. If you dont understand post your workers.properties and i'll see if I can help. Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:47 To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Thanks for your prompt answer. Unfortunately this solution did not work for me. When I remove the http connector, then I can see my web pages through apache. But I cannot see any jsp's at all. Also, If I change port 8080 to port 80 in my server.xml file; then I have the same problem. I can see my web pages, but not my jsp's. -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 3:29 PM To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Hi, You merely need to comment out the HTTP connector in your conf/server.xml Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:19 To: Tomcat Users List Subject: I do not want port 8080. Anyone know how to? Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple Tomcat Instances with Linux
Dan, That is essentially the situation I am trying to avoid. There are several applications within an instance of Tomcat that share resources from shared/lib, but those shared/lib resources should not be shared between instances. My goal is to have the separate instances represent independent environments. Jon --- Dan Barron [EMAIL PROTECTED] wrote: Jon, I have used the CATALINA_HOME/common/lib to share jar files among different Service instances. Not sure if that answers your question though. Dan At 10:54 AM 6/21/2004, you wrote: Dan, Thanks for the post, good ideas I'm going to try them. One thing I'm still not clear on. My application is configured to deploy shared modules (jar files) under CATALINA_HOME/shared/lib. If I create multiple instances, how do I configure the apps to share the correct version of CATALINA_HOME/shared/lib? Do you create a separate document root that contains a shared/lib for each Service entry in the server.xml configuration? Jon --- Dan Barron [EMAIL PROTECTED] wrote: Jon, I run multiple tomcat services on a Linux box with Apache for various development and distributions. The way I went about it is to setup multiple Service configurations within the server.xml file. Each service has it own port for connectivity and its own worker for mod_jk. I create a virtual host entry in mod_jk.conf file which mounts the assigned worker which in turn points to the specific tomcat service. Here's the three files I touch to make it work and an example entry. My environment is Tomcat 4.1.29, mod_jk, and Apache 1.3.27. Hope this helps. Dan *FILE:mod_jk.conf #~~~ # domain.com Virtual Host Definition #~~~ VirtualHost 10.10.1.10 ServerName www.domain.com DocumentRoot /usr/www/domain.com ErrorLog logs/domain.com/error_log CustomLog logs/domain.com/access_log common ScriptAlias /cgi-bin/ /usr/www/domain.com/cgi-bin/ Directory /usr/www/domain.com/cgi-bin AllowOverride None Options None Order allow,deny Allow from all /Directory JkMount /servlet/* domain_worker JkMount /alpha/*.jsp domain_worker JkMount /*.jsp domain_worker /VirtualHost **FILE: workers.properties worker.list=ajp13, domain_worker worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 worker.ajp13.lbfactor=20 worker.ajp13.cachesize=20 worker.domain_worker.port=8010 worker.domain_worker.host=localhost worker.domain_worker.type=ajp13 worker.domain_worker.lbfactor=20 worker.domain_worker.cachesize=20 *FILE:server.xml Server... ... Service name=domain !-- Define a non-SSL HTTP/1.1 Connector on port 8081 -- Connector className=org.apache.catalina.connector.http.HttpConnector port=8081 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=6/ !-- Define an AJP 1.3 Connector on port 8010 -- Connector className=org.apache.ajp.tomcat4.Ajp13Connector port=8010 minProcessors=5 maxProcessors=75 acceptCount=10 debug=0/ !-- Define the top level container in our container hierarchy -- Engine name=domain defaultHost=www.domain.com debug=0 !-- Global logger unless overridden at lower levels -- Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_domain_log. suffix=.txt timestamp=true/ !-- Because this Realm is here, an instance will be shared globally -- Realm className=org.apache.catalina.realm.MemoryRealm / !-- Define the default virtual host -- Host name=www.domain.com debug=0 appBase=webapps/domain.com unpackWARs=true autoDeploy=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=domain_access_log. suffix=.txt pattern=common/ Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=domain_log. suffix=.txt timestamp=true/ !-- domain Root Context -- Context path= docBase= debug=0/ /Host /Engine /Service /Server At 05:26 PM 6/18/2004, Jon Feauto wrote: I see this question posted quite often, but rarely answers abound. Is it because this is too complex a
Re: request process flow and user profiling
you have tons of options, Servlet filters (standard servlet API) lets you process requests. Using a MVC framework, such as struts, you can build your own controllers, hence do a bunch of stuff there Use Tomcat's pipeline by building valves Filip - Original Message - From: Trond Hersløv [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 21, 2004 4:46 PM Subject: request process flow and user profiling Hi, I need to mainten a profile database with login, password, telephone numbers and so on. I think I need to know how tomcat is handeling the request flow. My goal is to achive the following (if there are better ways to it, please let me know). Profile profile = request.getSessio().getProfile(); if( ! profile.loggedIn){ the user is not logged in... else telephoneNumber=profile.getNumber(); } I suppose there is a kind of pipeline of servlets that one after another is processing the request object untill it finally is handeled by the end servlet (e.g test.jsp) If it doesn't allready exists, I would like to extend the session object with to members: short: public class mySession extends Session{ Boolean loggedIn; Profileprofile; } and put a class into the pipeline which, dependend on wether or not the user is logged in, sets loggedIn=true and profile=som object containg profile information; Does this allready exist as a functionallity in tomcat? I know other servlet-containers (Dynamo from ATG) has this kind of profile handeling. Where can I find documentation on how tomcat is processing the request flow? Thanks in advance trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: request process flow and user profiling
Thanks, but I still don't know where to look for documentation. Can you give me a link to pages describing Tomcat's pipeline and how to use valves? \trond -Opprinnelig melding- Fra: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sendt: Tuesday, June 22, 2004 00:05 Til: Tomcat Users List Emne: Re: request process flow and user profiling you have tons of options, Servlet filters (standard servlet API) lets you process requests. Using a MVC framework, such as struts, you can build your own controllers, hence do a bunch of stuff there Use Tomcat's pipeline by building valves Filip - Original Message - From: Trond Hersløv [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 21, 2004 4:46 PM Subject: request process flow and user profiling Hi, I need to mainten a profile database with login, password, telephone numbers and so on. I think I need to know how tomcat is handeling the request flow. My goal is to achive the following (if there are better ways to it, please let me know). Profile profile = request.getSessio().getProfile(); if( ! profile.loggedIn){ the user is not logged in... else telephoneNumber=profile.getNumber(); } I suppose there is a kind of pipeline of servlets that one after another is processing the request object untill it finally is handeled by the end servlet (e.g test.jsp) If it doesn't allready exists, I would like to extend the session object with to members: short: public class mySession extends Session{ Boolean loggedIn; Profileprofile; } and put a class into the pipeline which, dependend on wether or not the user is logged in, sets loggedIn=true and profile=som object containg profile information; Does this allready exist as a functionallity in tomcat? I know other servlet-containers (Dynamo from ATG) has this kind of profile handeling. Where can I find documentation on how tomcat is processing the request flow? Thanks in advance trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I do not want port 8080. Anyone know how to?
All I have in my workers.properties is the following: worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 I still want apache alive. I guess my problem is just the 8080 extension. If run my jsps through tomcat with port (8080) or without it from the tomcat root, let's say the directory examples, (http://localhost:8080/examples/myjsps) and http://localhost/examples/myjsps) they worked beautifully. My problem started when I included the new context path to run my jsps from a user directory. Context path=/mycct docBase=/home/myacct/wwwdocs debug=0 reloadable=true crossContext=true /Context I am sorry, I am a little confused. I guess what I do not understand is how will my server know if I am running jps or just plain html if I do not include port 8080. If I am totally wrong, please just let me know. -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 3:54 PM To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Then it sounds like both solutions worked partly. For Filip's solution to work you would have to shut down apache completely and apache becomes the standard web server and both servlets and jsp's should work, but you lose apache. It sounds like when you tried my solution that you have a missing part in your mappings. Have a look in the workers.properties (or workers2.properties if it is jk2) and you will need a mapping along the lines of /yourapp/*.jsp so that your jsp's are mapped or even just /yourapp/* should map the whole webapp. If you dont understand post your workers.properties and i'll see if I can help. Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:47 To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Thanks for your prompt answer. Unfortunately this solution did not work for me. When I remove the http connector, then I can see my web pages through apache. But I cannot see any jsp's at all. Also, If I change port 8080 to port 80 in my server.xml file; then I have the same problem. I can see my web pages, but not my jsp's. -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 3:29 PM To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Hi, You merely need to comment out the HTTP connector in your conf/server.xml Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:19 To: Tomcat Users List Subject: I do not want port 8080. Anyone know how to? Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
If your thinking in terms of singletons and synchronized blocks, it seems like you are thinking along the lines of doing this all in-memory. You CAN do that, but it's generally not a good idea. First, I don't know if your dealing with a clustered environment, but if you are you'll find that you have synchronization issues to deal with. Second, the obvious: if power goes out, everything is lost. If your dealing with a database, there's at least the possibility of recovering things. Third, any time you introduce a synchronized block in a J2EE-based application you have to ask yourself if your design isn't flawed because you are supposed to let the container handle all threading issues and your code should always be thread-safe. I myself have broken this rule on occassion, and I believe it to be valid to do sometimes, but you need to be sure it's truly the right anwer. Assuming you decide it is, realize that any synchronized block of code means your introducing a bottleneck to the application. You may decide it's insignificant, but you are essentially serializing all requests that go through that critical section, so you need to really make sure it's the right thing to do. In a recent app, I had a critical section during logon. This is very different than something that's a transaction within the app that might happen a number of times for a given user since the logon shouldn't be happening very often and you probably won't get too many users doing it concurrently, so it's not a big issue as compared to something that might be happening a lot for many different users. This really strikes me as something that should be done in a database, whether your letting the database handle the concurrance issues or you do so in your code yourself, but either way, that's really the way I'd be looking. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Design question .. Date: Mon, 21 Jun 2004 14:34:51 -0700 Hi, Yes , first come first is something that I prefer too. But I will need a singleton java object with a synchronized method to do the transaction. The transaction would involve 1. Check data 2. Register 3. commit data to database. After the method completes i can send them a confirmation. The downside to this approach is that if lots of users are registering for courses online , they might experience a delay. On Jun 21, 2004, at 12:47 PM, Peter Lin wrote: There's a couple of different ways to handle this. 1. do not do it in real time. this is the easiest solution, but it means a human has to be the one who figures who gets what class. 2. use JMS to update each user's session and make it so that once the class has no more entries, no one else can add it to their cart. Say user 1 submits before user 2. if user 1 registers before 2, a message is sent to the java bean in memory to update the cart 3. process the orders on a first come first serve basis, but do not gaurantee the person is signed up for it. In the response email state, you will get a confirmation of successful regisration. This is usually the easiest way to assuming you send confirmation in reasonable amount of time. This implies the transaction are processed async with some kind of queue 4. check availability before starting the transaction. this means some kind of locking at the row level. I'm sure there are other ways of doing it. Personally, I prefer handling the transaction on a first come first serve basis and send out confirmation in reasonable time. peter On Mon, 21 Jun 2004 12:37:04 -0700, Mufaddal Khumri [EMAIL PROTECTED] wrote: Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1
Re: Design question ..
The more typical way of doing this is to use JDBC transactional code. In essence, the concurrancy issues are handled under the covers by the classes, JDBC driver and database. You just start a transaction, do your updates, and commit the transaction. Catch any failures that occur and deal with them. Assuming you have proper constraints on the database, those are the exceptions you'll be looking for. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Design question .. Date: Mon, 21 Jun 2004 14:41:12 -0700 I understand this method of doing it and I understand the pseudo code too. I believe this code will be in a synchronized method that should be placed in a singleton object. The code validates information. One example validation could be getting current registrations for the course and seeing if there is place left for this new user to enroll in that course. If this method is not synchronized then two different users could be in this same function validating their data and then they would try to register for the course too. If the number of users using the system to register for courses is high this singleton object encapsulating this synchronized method, would e a bottle neck. Is there any other solution or is this standard implementation? On Jun 21, 2004, at 12:54 PM, Jérôme Duval wrote: Most commercial databases implement a solution to this problem since it is fairly common. For MySQL, you must use the InnoDB engine (at least for now). You use the concept of transaction. To do this, you must turn the AutoCommit mode to off (some client have this mode off by default, some do not. Check your documentation. If you are going through JDBC Connections are always in AutoCommit(true)!). You must also set the Transaction Mode to Transaction_Serializable which locks table so that no one else then you can read the data in your tables. The code looks something like this: try { //Validate information //Add the record in the table //Bill the customer //commit transaction } catch (SQLException) { //rollback the transaction cause something went wrong } finally { //close the connection } Where you bill the customer is dicussable (it is related to the transaction but does not require DB access). It's all up to you really. A couple of things to notice: - TRANSACTION_SERIALIZABLE is the most demanding mode for your database server. - If you forget even one commit() or rollback() you might lose data to locking. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Mufaddal Khumri Software Developer Waves In Motion Phone: 602 956 7080 x 26 Email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get fast, reliable Internet access with MSN 9 Dial-up now 3 months FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
The first point is a very good one, I wouldn't have thought of it! The second point is certainly arguable. I see where your coming from, but if it's a business rule, it by definition belongs in the model layer. Remember, view is easy, the controller interfaces the two, and business logic of an application is the model layer. That aside, I really do like your idea about kind of putting a hold on the class. I think that's a very good suggestion and a good model to follow. but in the end Justin, you would do well, I think, to do this in the database, i.e., have a locked field as write to it. The complication there is you'll need some method to unlock abandoned items periodically. Frank From: Justin Ruthenbeck [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Design question .. Date: Mon, 21 Jun 2004 14:45:05 -0700 Since everyone else seems to have an opinion on this, I figure that I might as well share mine. :) A couple things to keep in mind: (*) Depending on your geographic location, you may have a legal responsibility to make sure that an item listed as available is, indeed, available. In other words, you can't tell a user that an item is available, let them put into their cart, then tell them it's not available when they try to pay for it. This is municipality-specific, but something to keep in mind for those doing cross-border sales. (*) The requirement you have described is a business-process requirement. It is not technical and therefore, IMHO, should not be satisfied with row locking, transaction manipulation, etc. Satisfy it on the controller level and avoid polluting your model with stuff like this. My personal inclination (which could change depending on the situation) would be to give users an X minute (logical) lock once something has been put in their cart. If they don't buy it (or indicate they want to keep it) after that time is up, it goes back on the shelf. In other words, treat everything in your inventory like a real object ... if a consumer wants to buy it, give them a pickup-ticket that they can take to the cashier. Ensure that the number of pickup-tickets equals the number of real items in inventory. The primary benefit here is that you'll fail fast instead of promising something that you can't deliver. (This isn't my idea, BTW ... take a look at TicketMaster when a hot concert goes on sale to see this in action) justin At 12:37 PM 6/21/2004, you wrote: Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To
Re: Design question ..
I'd need to know what RDBMS you were using to give you an example, and then I'd have to go look up in some references to see how to write the rule. But from a generic standpoint... I would add a number_registered field to your course table. Each time someone tried to enroll in a class, you do a check like if (course.maxregistation == -1 || (course.number_registered course.maxregistration)) { allow the update } else { disallow update } That's not literally the code, but that's the logic of it. It might be a constraint, it might be a trigger, I'm not sure which will do it for you (although triggers generally result in updates to other tables, so I'm thinking constraint). That way, if the rule disallows the update, you'll get an exception in your code with an error code or message you can check for specifically and inform the user. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Design question .. Date: Mon, 21 Jun 2004 14:47:52 -0700 Hi Frank I understand this approach. The problem is that the course table has a field called maxregistration if this field is set to -1 it means that there is no limit. If there is a value in this field, it will be = 1. I have another table called Enrollments. This table has courseId, userId information. It keeps track of what user is enrolled in what course. I have a waitinglist table which has userId, courseId, timestamp. It keeps track of what users are waiting to be enrolled in a course that has met its capacity. The instructor can give override to users in waitinglist for a table. An override transfers a user from the WaitingList table to the Enrollment table. This means that at any given time the enrollment table could have more than course.maxregistration users enrolled for a course. Could you give me an example of a constraint that I could put on my tables so that it does not allow registrations more than course.maxregistration? On Jun 21, 2004, at 12:56 PM, Frank Zammetti wrote: Probably the easiest way to handle this is simply to have a constraint on your database that says a record cannot be added if some field is 0 (or a unique constraint, depending on how your table is keyed). Then, just catch the exception in your code and check to see if it's a violation of your rule, then return a message to the user saying the class has filled up. Simply put, don't worry about them putting the class in the shopping cart. Make sure you have a note on the site that says they are NOT actually registered until the shopping cart is processed. Then, let the database handle the concurrency issues (which they are very good at!) and you don't have to complicate your code any. I generally like staying away from database-level rules like this, just in case you tie yourself to a particular vendor, but something like this is pretty safe, and is tailor-made for such a mechanism. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Design question .. Date: Mon, 21 Jun 2004 12:37:04 -0700 Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses
Re: Design question ..
Unless it's too late in your implementation, I would decouple the reserve from the purchase. This way, the reserve transaction is shorter and more scalable and is not dependent on how fast you can enter CC and address data. This is nicer for the user too because they are getting close to real time data as opposed to 2 people, possibly simultaneously, trying to buy the same enrollment seat. My suggestion is: - a second table to hold reserved, un-purchased classes (same schema as enrollment table). When the purchase takes place move the reservation to the existing enrollment table you have now. - Check the max class limit by doing a union select on the reservation and enrollment tables. - if a reservation is not exercised within a certain timeout, remove it and reserve it for the first first wait-listed user (with necessary email notifications, etc). Checking the reservation table for expired reservations is obviously an async. process best left to a background thread, or scheduled task. From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Design question .. Date: Mon, 21 Jun 2004 12:37:04 -0700 Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 9 Dial-up Internet Access fights spam and pop-ups now 3 months FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I do not want port 8080. Anyone know how to?
I think I found the solution to my problem, I included the following line inside my apache httpd.conf: JkMount /*.jsp ajp13 The name of my worker is ajp13, ugly name, but it was the default so I did not dare to change it. According to the Apache How to in the Jakarta site, this will tell apache to handle all files ending in jsp through my tomcat worker. I just tested my jsps as http://my.domain.com/myacct/my.jsp, and they work beautifully. -Original Message- From: Casas, Claudia Sent: Monday, June 21, 2004 4:44 PM To: 'Tomcat Users List' Subject: RE: I do not want port 8080. Anyone know how to? All I have in my workers.properties is the following: worker.list=ajp13 worker.ajp13.port=8009 worker.ajp13.host=localhost worker.ajp13.type=ajp13 I still want apache alive. I guess my problem is just the 8080 extension. If run my jsps through tomcat with port (8080) or without it from the tomcat root, let's say the directory examples, (http://localhost:8080/examples/myjsps) and http://localhost/examples/myjsps) they worked beautifully. My problem started when I included the new context path to run my jsps from a user directory. Context path=/mycct docBase=/home/myacct/wwwdocs debug=0 reloadable=true crossContext=true /Context I am sorry, I am a little confused. I guess what I do not understand is how will my server know if I am running jps or just plain html if I do not include port 8080. If I am totally wrong, please just let me know. -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 3:54 PM To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Then it sounds like both solutions worked partly. For Filip's solution to work you would have to shut down apache completely and apache becomes the standard web server and both servlets and jsp's should work, but you lose apache. It sounds like when you tried my solution that you have a missing part in your mappings. Have a look in the workers.properties (or workers2.properties if it is jk2) and you will need a mapping along the lines of /yourapp/*.jsp so that your jsp's are mapped or even just /yourapp/* should map the whole webapp. If you dont understand post your workers.properties and i'll see if I can help. Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:47 To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Thanks for your prompt answer. Unfortunately this solution did not work for me. When I remove the http connector, then I can see my web pages through apache. But I cannot see any jsp's at all. Also, If I change port 8080 to port 80 in my server.xml file; then I have the same problem. I can see my web pages, but not my jsp's. -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Monday, June 21, 2004 3:29 PM To: Tomcat Users List Subject: RE: I do not want port 8080. Anyone know how to? Hi, You merely need to comment out the HTTP connector in your conf/server.xml Ta Matt -Original Message- From: Casas, Claudia [mailto:[EMAIL PROTECTED] Sent: 21 June 2004 22:19 To: Tomcat Users List Subject: I do not want port 8080. Anyone know how to? Hello everyone, I have my jsps running thorugh my user directories. For example, http://mydomain.com:8080/myuser/myfile.jsp I would like see if it is possible to take out the port 8080, so that it would seem like apache is processing the page. http://my.domain.com/myuser/myfile.jsp Is this possible? Does anybody know how? My jk connector is working because http://localhost:8080/examples and http://localhost/examples work both fine. I thought that some of my jsp files were already working like this, but I just realized only the html was being processed when no port 8080 was included. !-- Claudia Casas Application Development Coordinator Digital Media Center, Ext. 5940 -- Technology does not drive change -- it enables change. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question ..
you don't necessarily need to lock or synchronize in a first come first serve mode. simple put the order into a queue and generate a temporary order id. Once the order goes through, the real order ID is emailed to the user. peter On Mon, 21 Jun 2004 14:47:52 -0700, Mufaddal Khumri [EMAIL PROTECTED] wrote: Hi Frank I understand this approach. The problem is that the course table has a field called maxregistration if this field is set to -1 it means that there is no limit. If there is a value in this field, it will be = 1. I have another table called Enrollments. This table has courseId, userId information. It keeps track of what user is enrolled in what course. I have a waitinglist table which has userId, courseId, timestamp. It keeps track of what users are waiting to be enrolled in a course that has met its capacity. The instructor can give override to users in waitinglist for a table. An override transfers a user from the WaitingList table to the Enrollment table. This means that at any given time the enrollment table could have more than course.maxregistration users enrolled for a course. Could you give me an example of a constraint that I could put on my tables so that it does not allow registrations more than course.maxregistration? On Jun 21, 2004, at 12:56 PM, Frank Zammetti wrote: Probably the easiest way to handle this is simply to have a constraint on your database that says a record cannot be added if some field is 0 (or a unique constraint, depending on how your table is keyed). Then, just catch the exception in your code and check to see if it's a violation of your rule, then return a message to the user saying the class has filled up. Simply put, don't worry about them putting the class in the shopping cart. Make sure you have a note on the site that says they are NOT actually registered until the shopping cart is processed. Then, let the database handle the concurrency issues (which they are very good at!) and you don't have to complicate your code any. I generally like staying away from database-level rules like this, just in case you tie yourself to a particular vendor, but something like this is pretty safe, and is tailor-made for such a mechanism. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Design question .. Date: Mon, 21 Jun 2004 12:37:04 -0700 Hi, I am in the process of writing a webapp that allows users to make a payment and register for a course. Using Apache -- Tomcat --- MySQL. The question is a design question i guess, unless there is something in Tomcat that I can leverage, which i might not know. I know that this is a design question , but since I am using Tomcat as my JSP/Servlet container and since the participants here are experts in this field , I thought that I might get some good pointers here. Lets take this scenario: User 1 and User 2 are trying to register for a course called Taekwando. The fee for registering is X amount. Also there is another course called Majagutamba and it costs Y amount. Both theses courses have exactly 1 seat remaining. Now lets say user 1 adds both these courses in his shopping cart, and user 2 does the same, since user 1 has not completed his transaction and paid the enrollment table wont have an entry for user1. (The Enrollment table keeps track of which user is enrolled in which course). Therefore both users have both those courses in their shopping carts. Now both of them proceed to checkout. They enter their credit card information and say submit. Both those users make payments and get enrolled for both those courses!!! Which is wrong , since both those courses could only enroll 1 more person, instead two new users were just added. To avoid the above problem one could implement a singleton synchronized Transaction object that would process shopping cart checkout in a queue. The problem with this approach are: 1. If anything goes wrong with any one transaction, it would hold up the entire queue. (Well we can have some sort of timeouts and take care of that.) 2. Since this is a syncrhonized singleton and if the traffic for registering for the courses is high, this would be a slow process for which the user will have to wait. Is there a better solution, algorithm, to do this ? Any help is appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Movies - Trailers, showtimes, DVD's, and the latest news from Hollywood! http://movies.msn.click-url.com/go/onm00200509ave/direct/01/ - To
Re: Design question ..
Yes, I could not said it better. I am not using clusters, but I certainly do want to stay away from the singleton and synchronization approach. It does have to be done at the database or with an extra table called Enrollment_Temp or something. Basically, when a user adds the course to his cart, an entry would be made in the Enrollment_Temp table and the current timestamp would be written to one column in this table. The current number of enrollments would thus be the sum of such entries in the Enrollment_temp and Enrollment table. If the user completes his transaction this entry from the enrollment_temp table can be moved to the enrollment table. This raises the question that there would be certain users who would not complete their transaction. Such users would cause entries in the Enrollment_temp table. We can have a timeout on the life of such entries in the enrollment_temp table. Have a thread clean the Enrollment_temp table if a condition like now timestamp stored + 30 minutes. If a user has a course in his or her shopping cart and does not complete his transaction, and if this was the last seat. For the next 30 minutes from the time he adds that course to his shopping cart, it wont be available to anybody. Q 1. Is this a good approach and is this judicious enough for users to use? Q 2. Can any improvements made to this approach? On Jun 21, 2004, at 4:07 PM, Frank Zammetti wrote: If your thinking in terms of singletons and synchronized blocks, it seems like you are thinking along the lines of doing this all in-memory. You CAN do that, but it's generally not a good idea. First, I don't know if your dealing with a clustered environment, but if you are you'll find that you have synchronization issues to deal with. Second, the obvious: if power goes out, everything is lost. If your dealing with a database, there's at least the possibility of recovering things. Third, any time you introduce a synchronized block in a J2EE-based application you have to ask yourself if your design isn't flawed because you are supposed to let the container handle all threading issues and your code should always be thread-safe. I myself have broken this rule on occassion, and I believe it to be valid to do sometimes, but you need to be sure it's truly the right anwer. Assuming you decide it is, realize that any synchronized block of code means your introducing a bottleneck to the application. You may decide it's insignificant, but you are essentially serializing all requests that go through that critical section, so you need to really make sure it's the right thing to do. In a recent app, I had a critical section during logon. This is very different than something that's a transaction within the app that might happen a number of times for a given user since the logon shouldn't be happening very often and you probably won't get too many users doing it concurrently, so it's not a big issue as compared to something that might be happening a lot for many different users. This really strikes me as something that should be done in a database, whether your letting the database handle the concurrance issues or you do so in your code yourself, but either way, that's really the way I'd be looking. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Design question .. Date: Mon, 21 Jun 2004 14:34:51 -0700 Hi, Yes , first come first is something that I prefer too. But I will need a singleton java object with a synchronized method to do the transaction. The transaction would involve 1. Check data 2. Register 3. commit data to database. After the method completes i can send them a confirmation. The downside to this approach is that if lots of users are registering for courses online , they might experience a delay. On Jun 21, 2004, at 12:47 PM, Peter Lin wrote: There's a couple of different ways to handle this. 1. do not do it in real time. this is the easiest solution, but it means a human has to be the one who figures who gets what class. 2. use JMS to update each user's session and make it so that once the class has no more entries, no one else can add it to their cart. Say user 1 submits before user 2. if user 1 registers before 2, a message is sent to the java bean in memory to update the cart 3. process the orders on a first come first serve basis, but do not gaurantee the person is signed up for it. In the response email state, you will get a confirmation of successful regisration. This is usually the easiest way to assuming you send confirmation in reasonable amount of time. This implies the transaction are processed async with some kind of queue 4. check availability before starting the transaction. this means some kind of locking at the row level. I'm sure there are other ways of doing it. Personally, I prefer handling
Re: Design question ..
Mufaddal, You might want to add a wait list. A wait list would allow someone to enroll in a course should a seat become available. The time allowed for a wait list response should be greater than that allowed for the shopping cart timeout. -Robert Mufaddal Khumri wrote: Yes, I could not said it better. I am not using clusters, but I certainly do want to stay away from the singleton and synchronization approach. It does have to be done at the database or with an extra table called Enrollment_Temp or something. Basically, when a user adds the course to his cart, an entry would be made in the Enrollment_Temp table and the current timestamp would be written to one column in this table. The current number of enrollments would thus be the sum of such entries in the Enrollment_temp and Enrollment table. If the user completes his transaction this entry from the enrollment_temp table can be moved to the enrollment table. This raises the question that there would be certain users who would not complete their transaction. Such users would cause entries in the Enrollment_temp table. We can have a timeout on the life of such entries in the enrollment_temp table. Have a thread clean the Enrollment_temp table if a condition like now timestamp stored + 30 minutes. If a user has a course in his or her shopping cart and does not complete his transaction, and if this was the last seat. For the next 30 minutes from the time he adds that course to his shopping cart, it wont be available to anybody. Q 1. Is this a good approach and is this judicious enough for users to use? Q 2. Can any improvements made to this approach? On Jun 21, 2004, at 4:07 PM, Frank Zammetti wrote: If your thinking in terms of singletons and synchronized blocks, it seems like you are thinking along the lines of doing this all in-memory. You CAN do that, but it's generally not a good idea. First, I don't know if your dealing with a clustered environment, but if you are you'll find that you have synchronization issues to deal with. Second, the obvious: if power goes out, everything is lost. If your dealing with a database, there's at least the possibility of recovering things. Third, any time you introduce a synchronized block in a J2EE-based application you have to ask yourself if your design isn't flawed because you are supposed to let the container handle all threading issues and your code should always be thread-safe. I myself have broken this rule on occassion, and I believe it to be valid to do sometimes, but you need to be sure it's truly the right anwer. Assuming you decide it is, realize that any synchronized block of code means your introducing a bottleneck to the application. You may decide it's insignificant, but you are essentially serializing all requests that go through that critical section, so you need to really make sure it's the right thing to do. In a recent app, I had a critical section during logon. This is very different than something that's a transaction within the app that might happen a number of times for a given user since the logon shouldn't be happening very often and you probably won't get too many users doing it concurrently, so it's not a big issue as compared to something that might be happening a lot for many different users. This really strikes me as something that should be done in a database, whether your letting the database handle the concurrance issues or you do so in your code yourself, but either way, that's really the way I'd be looking. Frank From: Mufaddal Khumri [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Design question .. Date: Mon, 21 Jun 2004 14:34:51 -0700 Hi, Yes , first come first is something that I prefer too. But I will need a singleton java object with a synchronized method to do the transaction. The transaction would involve 1. Check data 2. Register 3. commit data to database. After the method completes i can send them a confirmation. The downside to this approach is that if lots of users are registering for courses online , they might experience a delay. On Jun 21, 2004, at 12:47 PM, Peter Lin wrote: There's a couple of different ways to handle this. 1. do not do it in real time. this is the easiest solution, but it means a human has to be the one who figures who gets what class. 2. use JMS to update each user's session and make it so that once the class has no more entries, no one else can add it to their cart. Say user 1 submits before user 2. if user 1 registers before 2, a message is sent to the java bean in memory to update the cart 3. process the orders on a first come first serve basis, but do not gaurantee the person is signed up for it. In the response email state, you will get a confirmation of successful regisration. This is usually the easiest way to assuming you send confirmation in reasonable amount of time. This implies the transaction are
Re: Design question ..
At 04:12 PM 6/21/2004, Frank Zammetti wrote: The first point is a very good one, I wouldn't have thought of it! The second point is certainly arguable. I see where your coming from, but if it's a business rule, it by definition belongs in the model layer. Remember, view is easy, the controller interfaces the two, and business logic of an application is the model layer. If you define the controller as the portion that *merely* interfaces the view with the actual working objects (ie a Command servlet), then yes. What I was trying to get at is that a DAO should be responsible for exactly that -- accessing the data. It is, IMO, ill conceived to use the DAO to determine whether a row is locked and therefore whether an item is available. That aside, I really do like your idea about kind of putting a hold on the class. I think that's a very good suggestion and a good model to follow. but in the end Justin, you would do well, I think, to do this in the database, i.e., have a locked field as write to it. The complication there is you'll need some method to unlock abandoned items periodically. I suppose my objection to handling in the database is not so much with the locks, but more with the combination of browsing behavior and inventory in a single table. Storing information about a user's cart in the database has its advantages -- namely sharing amongst machines in a cluster and persistence across restarts -- but anytime you have multiple hands (from multiple logical processes) in the cookie jar, I get nervous about maintaining integrity. Ultimately, I like Eric Earle's dual-table suggestion as it accomplishes both accurate, fail-fast inventory reporting for buyers, and separation of the browsing and buying data... along with the persistence and locking benefits of doing it in the DB. Good luck on your impl, Mufaddal... justin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setup problem with Tomcat 5.0.25 running as a daemon under jsvc
Hi Doug, Thanks for your suggestion. For some reason, my Linux (7.2) doesn't like the chusr command. Is that the same function provided by the chown -R tomcat.tomcat /opt/jakarta-tomcat-5.0.25 command? If so, I already had that applied. Here is what you see in the directory structure: drwxrwxrwx3 tomcat tomcat 1024 Jun 17 23:27 ./ drwxrwxrwx 11 tomcat tomcat 1024 Jun 17 23:27 ../ drwxrwxrwx2 tomcat tomcat 1024 Jun 18 00:19 _/ [EMAIL PROTECTED] [/opt/jakarta-tomcat-5.0.25/work/Catalina/subdomain.domain.com]# There is nothing under the _ directory except for a tldCache.ser file. If I manually create the /opt/jakarta-tomcat-5.0.25/work/Catalina/subdomain.domain.com/_/org/apac he/jsp directory structure and change the ownership using chown -R tomcat.tomcat /opt/jakarta-tomcat-5.0.25/work/Catalina/subdomain.domain.com/_/org then the page starts working. So, I'm pretty sure Tomcat cannot define those directories and therefore the jsp compile fails. Any help will be very much appreciated. Thanks, Fernando. -Original Message- From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Sent: Sunday, June 20, 2004 3:54 PM To: Tomcat Users List Subject: Re: Setup problem with Tomcat 5.0.25 running as a daemon under jsvc Do a chgrp -R youruser tomcatBaseDir and a chusr -R youruser tomcatBaseDir To have the tomcat directory structure that is owned and belongs to the user specified in jsvc. Doug www.parsonstechnical.com - Original Message - From: Fernando Fernandez [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, June 20, 2004 1:28 PM Subject: Setup problem with Tomcat 5.0.25 running as a daemon under jsvc Hi all, I found a problem that might be more of a jsvc problem than a tomcat issue. But perhaps someone has had the same issue and knows the solution. When a user creates a new subdomain (e.g. http://subdomain.mydomain.com) and publishes a new Java Server Page, they get the following error: java.io.FileNotFoundException: /opt/jakarta-tomcat-5.0.25/work/Catalina/subdomain.mydomain.com/_/org/ap ache/jsp/test_jsp.java java.io.FileOutputStream.open(Native Method) java.io.FileOutputStream.init(FileOutputStream.java:179) java.io.FileOutputStream.init(FileOutputStream.java:70) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:188) org.apache.jasper.compiler.Compiler.compile(Compiler.java:461) org.apache.jasper.compiler.Compiler.compile(Compiler.java:442) org.apache.jasper.compiler.Compiler.compile(Compiler.java:430) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:274) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:810) It looks like the problem has something to do with Tomcat trying to create the new directory structure under Tomcat's 'work' directory, because I don't see part of the directory path mentioned in the message. And when I start Tomcat using /bin/startup.sh as root, the page runs fine and the directory structure is created. After that, any new page published works fine in the original setup. I tried 'chmod -R 777 work' to allow changes to that directory by anyone, but it still doesn't work. I tried specifying root as the user in the jsvc call, and it doesn't make a difference. Is this behaviour by design or is it a problem, probably in jsvc? If a solution is not possible using jsvc to run Tomcat as a daemon, is there another way to run it (I'm a newbie to Tomcat, and I first tried the recommendation in Apache's web site). Thanks for your help, Fernando. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat licensing questions
Adrian Cho [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there anyone on the list that can answer some questions I have about the redistribution of certain files in Tomcat 4.1.30? Specifically: servlet.jar appears to be a Sun-originated module but is apparently redistributed as part of Tomcat 4.1.30 under the Apache Software License 1.1. Is this correct? I have in the past seen other Sun-originated modules in Apache distributions and I'm wondering what the licensing terms of the contribution and subsequent redistribution are. The servlet.jar that ships with Tomcat 4.1.x is an Apache-originated module that implements JSR053. As such, the licensing terms are those of the Apache Software License 1.1. Thanks Adrian Adrian Cho Manager, Intellectual Property IBM Ottawa Lab 2670 Queensview Drive Ottawa, Canada K2B 8K1 Phone: (613) 726-5536 Fax: (613) 820 1202 Website: http://www.can.ibm.com/ottawalab/ E-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connector error
I got this message on httpd's error_log ajp13.service() ajpGetReply recoverable error 3 ajp13.service() ajpGetReply recoverable error ajp13.service() Error forwarding ajp13:/usr/share/tomcat5/work/jk2.socket 1 0 mod_jk2.handler() Error connecting to tomcat 3, status 200 My workers : # Shared memory handling. Needs to be set. [shm] info=Scoreboard. Required for reconfiguration and status with multiprocess serv$ file=/usr/share/tomcat5/logs/jk2.shm size=10485760 debug=0 disabled=0 # UNIX domain socket [channel.un:/usr/share/tomcat5/work/jk2.socket] tomcatId=localhost:8009 debug=0 # define the worker [ajp13:/usr/share/tomcat5/work/jk2.socket] channel=channel.un:/usr/share/tomcat5/work/jk2.socket # Announce a status worker [status:status] info=Status worker. Displays runtime information. [uri:/jkstatus/*] group=status:status # Uri mapping [uri:/jsp-examples/*] Where have I gone Wrong ? -Andre- CONFIDENTIALITY STATEMENT: This email and any attachment herein contains strictly confidential information. The same are intended only for the named Recipient(s) as above mentioned . In the event you are not named as a Recipient, we ask that you inform us of this immediately. Do not disseminate anything herein and please delete this message and any attachment in its entirety from any system you may have control over. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.1.24 stops responding due to attack
Hi, I am facing following problem : Problem : After working properly for a day or 2, I cannot access my website. Only way to restart is kill the process and again run startup.sh. I cannot stop normally using shutdown.sh Configuration : Red Hat Linux release 9 (Shrike), Tomcat 4.1.24, Postgres 7.3.4 Points Checked - 1. The tomcat is not down, I can see process by ps -ef 2. However, as a result of netstat -tcp I am getting some unknown users accessing my mysqld. Under normal working conditions I can recognise the IP address and accessed processes listed under netstat -tcp Actually I am not using mysql at all. No other application on server is using mysqld. 3. The default Apache 80 port can be accessed normally(Tomcat is running on 8080). 4. I have changed the port to 8081, but problem persists. Is it that someone is making lot of fake connections to slow down my tomcat, or am I infected by virus? Any hint or pointer will be appreciated. Regards, Kedar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean problem
Hii.. Can u tell me Wat is scope of beans in ur JSP Page. Can u send me ur source code. If u not specified scope of beans then u have to specify scope of beans Deepak On Mon, 21 Jun 2004 Casas,Claudia wrote : Hello everyone, I have managed to install tomcat4.1.30, apache2.0.49 and the jk1.2.5 connector. I included inside my server.xml file a new context path so that I can run my jsp application through my user directories. Here is what I included: Context path=/myuser docBase=/home/myuser/wwwdocs debug=0 reloadable=true crossContent=true/Context So now, I am able to run under /home/myuser/wwwdocs/test.jsp as follows: http://my.domain.com:8080/myuser/test.jsp or http://my.domain.com/myuser/test/jsp The both work ok. I also have a jsp called list.jsp that uses a bean to connect to an oracle database. When I run http://my.domain.com:8080/myuser/admin/list.jsp everything works perfect and I get an html table with list of my records from my database. But if I run http://my.domain.com/myuser/admin/list.jsp, then the jsp works, but I do get my html table but I do not get any records back at all. The bean is inside /home/myuser/wwwdocs/WEB-INF/classes/tools/dbbean.java, while the list.jsp is only inside /home/myuser/wwwdocs/admin Does anyone know what is going on in here? !-- Claudia Casas Technology does not drive change -- it enables change. -- /textarea /TD TD TABLE cellSpacing=0 cellPadding=0 border=0TRTD height=1/TD/TR/TABLE /TD /TR /TABLE !-- Compose buttons -- TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% TR bgcolor=#EE TD height=32 width=450 input type=button name=Send value=Send onclick=validate() class=wm_canbttns input type=button name=Save Draft value=Save Draft onclick=save_values_in_draft() class=wm_savebttns input type=button name=Add/Remove Attachment value=Add/Remove Attachment onclick=attachment(0) class=wm_arbttns /TD TD width=95 TABLE cellSpacing=0 cellPadding=0 border=0TRTD height=1 width=95/TD/TR/TABLE /TD TD align=left input type=button name=cancel value=Cancel onclick=backToInbox() class=wm_canbttns /TD /TR /FORM /TABLE !-- Compose buttons -- TABLE cellSpacing=0 cellPadding=0 border=0TRTD height=1/TD/TR/TABLE TABLE cellSpacing=0 cellPadding=0 border=0TRTD height=1/TD/TR/TABLE /TD /TR /TABLE !-- Main Table Ends -- !-- Footer starts -- TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% TR TD height=4 bgcolor=#67C1E9 width=100% TABLE cellSpacing=0 cellPadding=0 border=0TRTD height=4 width=100%/TD/TR/TABLE /TD /TR /TABLE TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width=100% TR TD align=center class=sb1 height=25 valign=bottom Copyright © 2004 Rediff.com India Limited. All Rights Reserved. /TD /TR /TABLEBR !-- Footer Ends -- /BODY /HTML
VIRUS ALERT (mailhub esterni)
ISS Mail Filter (C) 2003 WARNING: VIRUS FOUND IN MESSAGE Subject:Mail Delivery (failure [EMAIL PROTECTED]) From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] File: message/message.scr Virus: [EMAIL PROTECTED] ID: 36326 Date: 20040619 (rev. 019) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Prevent Apache Backup when a single tomcat stops responding
All Here is an interesting problem that we are facing. Our Production architecture is as follows: There are 4 Machines each hosting 1 Apache and 3 Tomcat 3.3.1a servlet engines. Hence there are a total of 4 Apache and 12 tomcat workers. Each apache can talk to all the 12 tomcat workers. Sometimes (during peak load) when tomcat worker (lets name it tc1) is doing garbage collection for an extended period of time, all requests for this tomcat worker tc1 get queued up. We are noticing some weird GC behaviour when the tomcat does Minor GC. I am pasting some garbage collection logs below 233191.652: [GC 233191.652: [DefNew: 127232K-3840K(127232K),204.1755072 secs] 293286K-176929K(385272K), 204.1757747 secs] 233396.272: [GC 233396.272: [DefNew: 127232K-3840K(127232K),101.8621946 secs] 300321K-183426K(385272K), 101.8624498 secs] A number of such simultaneous Garbage collections and the requests for this tomcat gets queued up. We are using AJP 12 threads and the maxThreads attribute is set to 100. Hence 100 requests for tc1 take those 100 threads. Any more requests start getting queued up in the apache servers causing it to backup and ultimately reach the value set in maxClients attribute in httpd.conf. thus bringing down the site. Is there a way by which once the 100 threads of the AJP12 connector are taken up, the tomcat sends a server busy signal to the end user and not queue up the apache and bring down the whole site (even though there are 11 other tomcat workers available). I read something about the backlog parameter in server.xml at http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.html. can someone explain what this parameter does. Any recommendations on how to prevent this one tomcat taking down the whole site would really help Thanks Akash
Tomcat and hot code deployment
Hey! As far as I understand, hot code deployment, is when you modify .class inside /WEB-INF/classes, and tomcat reloads it, correct? If so, is it true, that whenever it reloads it, the OLD instance of static objects, threads, and properties stay alive, that is, tomcat doesnt destroy them? Is that why many developers dont use hot code deployment on production servers? Because Ive been trying to debug my app, and I realized this pattern, and if I am correct, then my application is bug-free. Thanks --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07.06.2004