Reload
Title: Blank Hi, Where should Ispecify the classes which I want to reload automatically when they r changed, without restarting the server. There is an option in the context to reload the servlets but how to load the classes other than servlets which are in my classpath? Any Ideas?? Amar.
Re: Obtaining URL to web-app base in ServletContextListener.
Is this what you're looking for? void contextInitialized(ServletContextEvent sce) { sce.getServletContext().getResource(/); } --- Nord, James [EMAIL PROTECTED] wrote: Hi all, I need to be able to find out the url to the base of an installed web-app within a ServletContextListener (running under tomcat 4.1). I have not been able to find out how to obtain this information, the closest I have managed to get is jndi:/localhost/iPackager/ with a call to sc.getResource(/) but I have no idea how to convert this to a http url... can anyone shed any light or give me some pointers to how this may be accomplished? Thanks /James === Information contained in this email message is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to 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 immediately notify us by email to [EMAIL PROTECTED] and destroy the original message. __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CGI servlet in tomcat
In the web.xml, I've uncommented the servlets ssi and cgi. I've also -uncommented the servlets-mapping for these 2 servlets. I've renamed the servlets-cgi.renametojar and servlets-ssi.renametojar files. Where do I place the folder cgi-bin? Are there any other changes to be made to use the CGI servlet? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Vedr.: IIS + Tomcat 5.0 + NT authentication AUTH_USER
Simply put request.tomcatAuthentication=false somewhere in your jk2.properties file. /Thomas Jason Wilson [EMAIL PROTECTED] 08-01-04 18:54 Besvar venligst til Tomcat Users List Til:[EMAIL PROTECTED] cc: Vedr.: IIS + Tomcat 5.0 + NT authentication AUTH_USER Hi, I'm using Tomcat 5.0.16 connector-jk-2.0.2-win32-iis IIS 5.0 Currently my application is running under IIS + ColdFusion(Jrun), but will be migrating to a IIS/Tomcat server. Since this is an intranet application on an NT network, where it is a requirement to have the users not have to implicitly logon, I am using NT authentication with IIS. In other words, for the virtual directory, I have set the Anonomous access off, and Integrated Windows Authenticated on. In the IIS + ColdFusion setup, my servlet does a request.getHeader(AUTH_USER); and this returns the domain/userid of the person logged into the client machine. Then I can verify the user is allowed to use the application. All is well. However, in the IIS + Tomcat setup, getHeader(AUTH_USER) is returning null. I have tried other header keys and get null also. Also, I am sure IIS is authenticating the user, since I cannot get to the application using a browser that doesn't support the windows authentication. So, it appears, for some reason, the connector is not setting the AUTH_USER header when it transfers to the Tomcat container. Does anyone know how I can fix this so it does, or if there is anything I might be doing wrong. Thanks in advance, Jason __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=Arial___ Vi gør opmærksom på, at denne e-mail kan indeholde fortrolig information. Hvis du ved en fejltagelse modtager e-mailen, beder vi dig venligst informere afsender om fejlen ved at bruge svar-funktionen. Samtidig beder vi dig slette e-mailen i dit system uden at videresende eller kopiere den. Selv om e-mailen og ethvert vedhæftet bilag efter vores overbevisning er fri for virus og andre fejl, som kan påvirke computeren eller it-systemet, hvori den modtages og læses, åbnes den på modtagerens eget ansvar. Vi påtager os ikke noget ansvar for tab og skade, som er opstået i forbindelse med at modtage og bruge e-mailen. ___ Please note that this message may contain confidential information. If you have received this message by mistake, please inform the sender of the mistake by sending a reply, then delete the message from your system without making, distributing or retaining any copies of it. Although we believe that the message and any attachments are free from viruses and other errors that might affect the computer or IT system where it is received and read, the recipient opens the message at his or her own risk. We assume no responsibility for any loss or damage arising from the receipt or use of this message. /FONT
RE: mod_jk2 JNI question for the brave :)
From: Nikola Milutinovic Sent: 9. sijeanj 2004 7:31 To: Tomcat Users List Subject: Re: mod_jk2 JNI question for the brave :) Mladen Turk wrote: From: Yiannis Mavroukakis Sent: 8. sijeanj 2004 16:34 Would it not be possible to bind JNI under a single worker and then isolate that worker from the rest of the pool (possibly provide the ability for workers to carry some sort of identification bit with regards to who can access them)? That was the thing that I considered, but again if you have multiple workers, what would be the benefit of having that much Tomcat instances running. What is the real benefit of running TC from within Apache via JNI? It should be a faster, cause there is no socket channel involved, and all the communication goes through internall buffers, that share the same process. What would I gain with JNI? MT. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk2 JNI question for the brave :)
Mladen Turk wrote: That was the thing that I considered, but again if you have multiple workers, what would be the benefit of having that much Tomcat instances running. What is the real benefit of running TC from within Apache via JNI? It should be a faster, cause there is no socket channel involved, and all the communication goes through internall buffers, that share the same process. Aha. So, what's the story on binding TC to one worker? As you pointed out, Apache has it's own MPM models and very few of them have just one worker. Would it be a good way to go for Apache module TC daemon, like CGI Daemon? To have one dedicated Apache process run Tomcat within it and share access with other workers? Or is it how things are, already? Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat disableProxyCaching
Konrad [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Can I somehow instract Tomcat *in config files* to set disableProxyCaching to false ? Context docBase=myapp path=/myapp ... Valve className=org.apache.catalina.authenticator.FormAuthenticator disableProxyCaching=false / /Context Of course, if you are not using Form authentication, then substitute the correct class (e.g. BasicAuthenticator, DigestAuthenticator, SSLAuthenticator). One more thing ... in which file shold I add these lines ? ;-) -- Regards Konrad :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: mod_jk2 JNI question for the brave :)
From: Nikola Milutinovic Sent: 9. sijeanj 2004 10:18 To: Tomcat Users List Subject: Re: mod_jk2 JNI question for the brave :) What is the real benefit of running TC from within Apache via JNI? It should be a faster, cause there is no socket channel involved, and all the communication goes through internall buffers, that share the same process. Aha. So, what's the story on binding TC to one worker? As you pointed out, Apache has it's own MPM models and very few of them have just one worker. Look at the thread. Unfortunately the JNI isn't of much use on Linux, or to be more specific, on any multi child mpm. If you manage to maintain the single worker process (like winnt-mpm does), then you can use the JNI. The reason for that is quite simple; You cannot have two TC instances running having the same conf. MT. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat don't receive the right URL from mod_jk2 (or mod_jk) with IIS 6.0 on Win 2003 Server?
Hi Daniel, filename of the jk2 redirector is isapi_redirector2.dll, so isapi_redirector.dll will never be found, I've renamed the dll, so it is really found. example directorys of Tomcat5 I'm using Tomcat 4 (I can reach http://localhost:8080/examples/ with no error). we build an installer which automates all steps at: http://www.shiftomat.com/opensource/ Whatever I've tried your installer, nice one but it still not working with an error that looks like the one I have with my previous installation. (Before try the installation I've removed my jakarta virtual directory to let the installer do its job) I mean I reach the page 'The page cannot be displayed... You can find logs and config below. I'm totally lost. Especially I don't understand why --- HttpFilterProc check if [/jakarta/isapi_redirector2.dll] is pointing to the web-inf directory although before the mapping was matching HttpFilterProc [/examples/] is a servlet url - should redirect to lb:lb Don't hesitate to request for additionnal info. Best regards. Johann DUPUIS Here is the logs and configuration with Tomcat 4.1.29 (fresh install) and IIS 6 on Win 2003 Server: ( info ) [jk_logger_file.c (224)] Level DEBUG 0 ( info ) [jk_logger_file.c (184)] Initializing log file C:/usr/TMS/AppServer/ApplicationServer/IIS/logs/isapi.log (debug ) [jk_uriMap.c (377)] uriMap.init() Fixing Host * (debug ) [jk_uriMap.c (464)] uriMap: fix uri /appserver/* context (null) host * (debug ) [jk_uriMap.c (464)] uriMap: fix uri /examples/* context (null) host * (debug ) [jk_uriMap.c (464)] uriMap: fix uri /jakarta/* context (null) host * (debug ) [jk_uriMap.c (464)] uriMap: fix uri (null) context (null) host * (debug ) [jk_uriMap.c (464)] uriMap: fix uri / context / host * ( info ) [jk_workerEnv.c (403)] workerEnv.init() ok C:\usr\TMS\AppServer\ApplicationServer\IIS\conf\workers2.properties ( info ) [jk_isapi_plugin.c (612)] Set serverRoot Z:\usr\jakarta-tomcat-4.1.18\jakarta-tomcat-4.1.18 (debug ) [jk_isapi_plugin.c (616)] Using registry. (debug ) [jk_isapi_plugin.c (618)] Using extension uri /jakarta/isapi_redirect.dll. (debug ) [jk_isapi_plugin.c (619)] Using server root Z:\usr\jakarta-tomcat-4.1.18\jakarta-tomcat-4.1.18. (debug ) [jk_isapi_plugin.c (620)] Using worker file C:\usr\TMS\AppServer\ApplicationServer\IIS\conf\workers2.properties. (debug ) [jk_isapi_plugin.c (288)] HttpFilterProc started (debug ) [jk_isapi_plugin.c (346)] In HttpFilterProc Virtual Host redirection of localhost : 80 (debug ) [jk_isapi_plugin.c (412)] HttpFilterProc [/] is not a servlet url (debug ) [jk_isapi_plugin.c (421)] HttpFilterProc check if [/] is pointing to the web-inf directory (debug ) [jk_isapi_plugin.c (288)] HttpFilterProc started (debug ) [jk_isapi_plugin.c (346)] In HttpFilterProc Virtual Host redirection of localhost : 80 (debug ) [jk_isapi_plugin.c (412)] HttpFilterProc [/] is not a servlet url (debug ) [jk_isapi_plugin.c (421)] HttpFilterProc check if [/] is pointing to the web-inf directory (debug ) [jk_isapi_plugin.c (288)] HttpFilterProc started (debug ) [jk_isapi_plugin.c (346)] In HttpFilterProc Virtual Host redirection of localhost : 80 (debug ) [jk_isapi_plugin.c (412)] HttpFilterProc [/tms/] is not a servlet url (debug ) [jk_isapi_plugin.c (421)] HttpFilterProc check if [/tms/] is pointing to the web-inf directory (debug ) [jk_isapi_plugin.c (288)] HttpFilterProc started (debug ) [jk_isapi_plugin.c (346)] In HttpFilterProc Virtual Host redirection of localhost : 80 (debug ) [jk_isapi_plugin.c (412)] HttpFilterProc [/tms/] is not a servlet url (debug ) [jk_isapi_plugin.c (421)] HttpFilterProc check if [/tms/] is pointing to the web-inf directory (debug ) [jk_isapi_plugin.c (288)] HttpFilterProc started (debug ) [jk_isapi_plugin.c (346)] In HttpFilterProc Virtual Host redirection of localhost : 80 (debug ) [jk_isapi_plugin.c (412)] HttpFilterProc [/tms/images/blutextb.gif] is not a servlet url (debug ) [jk_isapi_plugin.c (421)] HttpFilterProc check if [/tms/images/blutextb.gif] is pointing to the web-inf directory (debug ) [jk_isapi_plugin.c (288)] HttpFilterProc started (debug ) [jk_isapi_plugin.c (346)] In HttpFilterProc Virtual Host redirection of localhost : 80 (debug ) [jk_isapi_plugin.c (412)] HttpFilterProc [/tms/images/blutextb.gif] is not a servlet url (debug ) [jk_isapi_plugin.c (421)] HttpFilterProc check if [/tms/images/blutextb.gif] is pointing to the web-inf directory (debug ) [jk_isapi_plugin.c (288)] HttpFilterProc started (debug ) [jk_isapi_plugin.c (346)] In HttpFilterProc Virtual Host redirection of localhost : 80 (debug ) [jk_isapi_plugin.c (412)] HttpFilterProc [/tms/images/companylogo.gif] is not a servlet url (debug ) [jk_isapi_plugin.c (421)] HttpFilterProc check if [/tms/images/companylogo.gif] is pointing to the web-inf directory (debug ) [jk_isapi_plugin.c (288)] HttpFilterProc
Problems after creating new hosts / contexts
Hi all, my environmemt: OS: Redhat Linux Platform: Intel x86 TC version: 4.1 tomcat4.conf: --- cut - CATALINA_HOME=/var/tomcat4 JASPER_HOME=/var/tomcat4 CATALINA_TMPDIR=/var/tomcat4/temp cut - First: There are a few of hosts and contexts running withouts problems .. but when I'm setting up contexts in new hosts, I've problems whith this new ones: 1. I create a hosts AppBase directory like $HOME/html/servlet/ for the domain diving.co.at and a DocBase directory for the context $HOME/html/servlet/myapp and context path: /myapp I put a test.jsp[1] file in DocBase. 2. I configure the new host and context in the TC Admininstration Tool with the settings from 1. TC is deploying[2] but http://www.diving.co.at:8080/myapp/test.jsp always returns the error: HTTP Status 500 .. javax.servlet.ServletException: org/apache/jasper/runtime/HttpJspBase ... but an older host http://pronet.at:8080/tomcat/test.jsp with the same test-file and the same TC engine works fine!? When I'm looking in the TC-wrok-dir .. there are also the files: test_jsp.class test_jsp.java TC is compiling test.jsp .. but returns the error shown above .. why? What's going wrong there? THX 4 Help Robert [1]: % for (int i=0; i 10; i++) { % zeile %= i % br % } % [2]: log ### 2004-01-08 17:05:47 WebappLoader[/myapp]: Deploying class repositories to work directory /var/tomcat4/work/Standalone/diving.co.at/myapp 2004-01-08 17:05:47 ContextConfig[/myapp]: Missing application web.xml, using defaults only 2004-01-08 17:05:47 StandardManager[/myapp]: Seeding random number generator class java.security.SecureRandom 2004-01-08 17:05:47 StandardManager[/myapp]: Seeding of random number generator has been completed 2004-01-08 17:05:47 StandardWrapper[/myapp:default]: Loading container servlet default 2004-01-08 17:05:47 default: init 2004-01-08 17:05:47 StandardWrapper[/myapp:invoker]: Loading container servlet invoker 2004-01-08 17:05:47 invoker: init 2004-01-08 17:05:47 jsp: init 2004-01-08 17:05:47 WebappLoader[/myapp]: Deploying class repositories to work directory /var/tomcat4/work/Standalone/diving.co.at/myapp 2004-01-08 17:05:47 StandardManager[/myapp]: Seeding random number generator class java.security.SecureRandom 2004-01-08 17:05:47 StandardManager[/myapp]: Seeding of random number generator has been completed ## - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JNI and TOMCAT problem
Hi, is it really TC crashing or is it the JVM ? Have a look into your logfiles. Using native libraries it's likely that your native code is crashing the JVM. grisi - Original Message - From: J.Pablo M [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:57 PM Subject: JNI and TOMCAT problem Hi. I'm runnin a JSP based Web aplicacion wich uses a Java Class that loads a native library (JNI). This Class is placed in a jar file at /common/lib/ The .so file is placed inside the jdk at /JAVA_HOME/jre/lib/i386/ I sucesfully build and test a standalone application for the use of the JNI. When I invoke the method located in the jar file that uses the .so from the JSP with Tomcat , the Tomcat CRASH. I dont know if must keep the .so file placed at the jdk directory mencioned above, otherwise... WHERE shoud I place the .so file ?? J. Pablo _ - 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: mod_jk2 JNI question for the brave :)
Yep I see what you mean know (fog of stupidity lifts). Ok so to iterate, the problem is that since linux has multiple workers, these workers will want to attach themselves to their own tomcat instance. How about this then..instead of launching several tomcat instances (which you cant), why not create a virtual tomcat construct? This would be a proxy to a single instance of Tomcat so you'd have something like this: worker worker worker | | | | | | virtualTC virtualTC virtualTC \| / \ | / \ | / Single TC instance Feel free to stop me when I start annoying you too much ;) Yiannis. PS. I'll start gathering info for the documentation. -Original Message- From: Mladen Turk [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 17:54 To: 'Tomcat Users List' Subject: RE: mod_jk2 JNI question for the brave :) From: Yiannis Mavroukakis I thought I had a rough understanding but it turns out that I dont %-) Do you mean that JNI will work only under one worker containing a single child process? Are you using the Tomcat as in or out of the process? In process tomcat (invoked from webserver) can be used only with the single worker mpm's. If you have multiple worker processes each of them would need to load it's own Tomcat instance, but try to start the two TC instances from startup.sh. The second will die immediately. Think that under linux there is no mpm that will allow you to have a single child process. Even the threaded, launches a few childs and shares the connection threads among them. MT. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk Note:__ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk
Re: mod_jk2 JNI question for the brave :)
Mladen Turk wrote: Look at the thread. Unfortunately the JNI isn't of much use on Linux, or to be more specific, on any multi child mpm. If you manage to maintain the single worker process (like winnt-mpm does), then you can use the JNI. The reason for that is quite simple; You cannot have two TC instances running having the same conf. I understand that. So, how about my second idea - Apache module (mod_jk2) that would turn one worker into TC-dedicated worker, while other workers would be just pure Apache? This would be something like mod_cgid. Such a setup would make JNI more acceptable in UNIX environment. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: mod_jk2 JNI question for the brave :)
-Original Message- From: Yiannis Mavroukakis Yep I see what you mean know (fog of stupidity lifts). Ok so to iterate, the problem is that since linux has multiple workers, these workers will want to attach themselves to their own tomcat instance. How about this then..instead of launching several tomcat instances (which you cant), why not create a virtual tomcat construct? This would be a proxy to a single instance of Tomcat so you'd have something like this: worker worker worker | | | | | | virtualTC virtualTC virtualTC \| / \ | / \ | / Single TC instance That would be a general idea. The single point of problem is this virtualTC, or some other concept, that will allow such a scheme. Eventually it will be implemented, but can't put my money on the exact date :-). MT. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: mod_jk2 JNI question for the brave :)
Yiannis Mavroukakis wrote: Yep I see what you mean know (fog of stupidity lifts). Ok so to iterate, the problem is that since linux has multiple workers, these workers will want to attach themselves to their own tomcat instance. How about this then..instead of launching several tomcat instances (which you cant), why not create a virtual tomcat construct? This would be a proxy to a single instance of Tomcat so you'd have something like this: worker worker worker | | | | | | virtualTC virtualTC virtualTC \| / \ | / \ | / Single TC instance Or better yet: worker worker worker--TC | | | | | | JK2:proxy JK2:proxy JK2:instance \| / \ |/ \ | / Master Apache process Something like a mod_cgid, one Apache worker gets dedicated to serving TC, the others are talking to it via Apache's internal mechanisms. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 is not generating IOException when connection closes
That's it! :-) socketBuffer=-1 really fixed the issue. thanks a lot, Vitor Remy Maucherat wrote: Vitor Buitoni wrote: Remy, I also tried using a PrintWriter, and i got the same results. checkError() only returns true when about 8k of data are sent after the connection has been closed. Yes, it's normal, since the normal stream will not throw an exception, the writer can't know about an error either. You said that there was indeed something wrong... I'm using Tomcat 5.0.16 , do you know if this version has already been fixed? No. I just fixed it, so 5.0.16 doesn't have the fix. Well, after some tests, i think that i found the source of my problem. The method response.setBufferSize(), only allows me to set a buffer higher than 8192 bytes. If i try to set a lower value it just ignores it and keep the default of 8192. I confirmed this with: response.setBufferSize(n); System.out.println(BufferSize=+response.getBufferSize); // if n8192 it aways prints 8192, otherwise print the value of n The buffer allocated is at least as large as what you are requesting. I still would like to know if there's any way (ugly or not, it doesn't matter how) to disable this buffering... So i can detect when the client closes the connection. For now, use socketBuffer=-1 on the connector. That will likely fix the issue. Remember to remove it when you upgrade to the next release, as the connector is not as network efficient without that. -- *Vitor Buitoni* /Programador - APC/ *DÍGITRO TECNOLOGIA* *E-mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] *Fone:* (0xx48) 281-7314 / (0xx48) 281-7000 *Fax:* (0xx48) 281-7000 *Site:* www.portaldigitro.com.br http://www.portaldigitro.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Modifying tomcat startup options on Tomcat 5 with Windows .exe
Hi, I have the windows version of Tomcat 5 installed and am using the windows service. I need to add the -security option to the startup. I notice that catalina.bat is still there but a) does the tomcat.exe use catalina.bat's config? b) how do I make the tomcat.exe service use -security? Cheers, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT
http://localhost/manager/reload?path=xxxx
When I use the manager to reload contexts, not all virtual hosts are reloaded. Example: I have 2-3 hosts defined in server.xml, each having the same contexts defined i.e. Host name=www.host.com debug=0 appBase=webapps unpackWARs=true autoDeploy=true Context path= docBase=web1 debug=0/ /host Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true Context path= docBase=web1 debug=0/ /host -but if I upload new jar files to the WEB-INF/lib catalog, and then call: http://localhost/manager/reload?path=/web1 It is only when I call the locahost host (http://localhost/web1/) that the new jar files are used. If I use the www.host.com (http://www.host.com/web1/), it is still the old jar files that are used(??) Why is that - does anyone know? I am using tomcat 5.0.9. Regards, Torben Jensen CDRator A/S, Denmark
javamail and tomcat
Hi, Im having some problems using javamail in tomcat - especially the taglibs mailer tag. The problem in this case is that it ignores any data sent to it telling it which SMTP server to use and by appearances sends the mail directly itself instead. Has anyone seen this behaviour before and does anyone know a way to combat it? thanks Pete Storey Kiss Technologies http://www.kisstechnologies.co.uk/ 4, Percy Street London W1T 1DF Phone numbers: Phone 020 7692 9922 Fax 020 7692 9923
Persistent storage error but only on one computer
Hi, I have two Tomcat 4.1.29 on AIX 4.3.3 WITH JDK 1.3.1 and exactly same Servlet and, I have persitent storage only on one computer ? Could you explain me Thanks Philippe 2004-01-09 12:16:19 StandardManager[/infodev] Exception loading sessions from persistent storage java.io.WriteAbortedException: Writing aborted by exception; java.io.NotSerializableException: java.util.PropertyResourceBundle at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code)) at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java(Compil ed Code)) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java(Compi led Code)) at java.io.ObjectInputStream.inputObject(ObjectInputStream.java(Compiled Code)) at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code)) at java.io.ObjectInputStream.readObject(ObjectInputStream.java(Compiled Code)) at org.apache.catalina.session.StandardSession.readObject(StandardSession.j ava:1369) at org.apache.catalina.session.StandardSession.readObjectData(StandardSessi on.java:864) at org.apache.catalina.session.StandardSession.readObject(StandardSession.j ava:1369) at org.apache.catalina.session.StandardSession.readObjectData(StandardSessi on.java:864) at org.apache.catalina.session.StandardManager.load(StandardManager.java:44 0) at org.apache.catalina.session.StandardManager.start(StandardManager.java:6 55) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:257 4) at org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(Webapp Loader.java:1369) at java.lang.Thread.run(Thread.java:512) Philippe COUAS Responsable Développement INFODEV S.A.
RE: Problems with Tomcat and JNI
Pablo - What do you mean by Tomcat Crash, is there an exception message at all? If you aren't using a web-application where you could see the error message on the displayed page, you can check the Tomcat logs to see what Tomcat is complaining about prior to the crash. I have two different web-applications that use JNI to access a C device driver and a VB DLL for some server software on one of our cabinets. In general, we would get something along the lines of an unsatisfied link error on the line where you first make a call to the native function (not where you do the System.loadLibrary(XXX), that usually succeeds). The problem for me (and a fellow developer attempting something similar) was that when we created the JNI header file javah -jni ... (-jni is now a default, so its unnecessary to specify it) we didn't include the entire path to the package/class of the java file using the jni. Generally with jni (at least in my exp.), you end up with a header file created by jni that has a very long name - as it includes the entire path to the class file that uses the jni functions (such as mil_navy_XXX_XXX_XXX.h) in my case. If you have created this header file incorrectly, you will still be able to run the application statically - but as soon as you run it through tomcat and it attempts to go through the JNI to access the native function, it will fail because it cannot link to the appropriate location for the function. Eden -Original Message- From: J.Pablo M [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 1:00 PM To: [EMAIL PROTECTED] Subject: Problems with Tomcat and JNI Hi. I'm runnin a Web aplicacion wich uses a Java Class that loads a native library (JNI). This Class is placed in a jar file at /common/lib/ The .so file is placed inside the jdk at /JAVA_HOME/jre/lib/i386/ I sucesfully build and test an standalone application to the use of the JNI. But when I test the Class method in the Web aplication with Tomcat, as soon as I try to use the native metod, the Tomcat CRASH. I dont know if must keep the .so file placed at the jdk directory mencioned above, otherwise... WHERE shoud I place the .so file ?? Juan Pablo Muñoz Vidal _ MSN Amor: busca tu ½ naranja http://latam.msn.com/amor/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
External Access to Server (Servlets)
I am new to Tomcat and Servlets/JSP but things are going great except when I try to access the server from outside my house. I can access the home page (default Tomcat page), and I can also access various HTML files. But when I click on a link that uses a Servlet, the page will not display. I does however work fine when I am logged in locally and running things. (IE: http://localhost/Books/myBooks.htm ) More specifically I am testing the Book Catalog example in Chapter Nine of Marty Hall's Core Servlets and JavaServer Pages. Everything work perfectly running it locally! Does anyone have any ideas? Thanks so much, Gerry Oakson
Re: ServletContextListener: how to suspend web app on error
A simple generic way is to use a filter which executes on all requests. If the ServletContextListener has an error - it can set a variable in the application context. Then the filter can check for the existence of that variables. Then forward to an error page. For example ... doFilter( ... ) { if (null!=servletContext.getAttribute(startupError)) { servletContext.getRequestDispatcher(/WEB-INF/error.jsp) .forward(request, response); } else { chain.doFilter(...); } } -Tim Justin Ruthenbeck wrote: Seems like a simple question, can't seem to find the answer... If an error occurs in the #contextInitialized() method of an object that implements ServletContextListener, how can I suspend the web application so that it is unavailable for use by clients? Specifically, I have a ServletContextListener that needs to be run at application startup. If any one of many errors occur, I want to notify the appropriate people (this I can do) and make the entire webapp unavailable (this I can't figure out). Any help is appreciated. I have a feeling this is obvious and I'm just missing something. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CGI servlet in tomcat
You place the scripts in your webapp. For example, you should have a ROOT context in a default install under %CATALINA_HOME/webapps/ROOT. In there create a cgi-bin directory. If you have other webapps - you can create subdirectories int here to. If you wish to forgo /cgi-bin/ you can map *.cgi to cgi by editing web.xml in any webapp or $CATALINA_HOME/conf/server.xml -Tim [EMAIL PROTECTED] wrote: In the web.xml, I've uncommented the servlets ssi and cgi. I've also -uncommented the servlets-mapping for these 2 servlets. I've renamed the servlets-cgi.renametojar and servlets-ssi.renametojar files. Where do I place the folder cgi-bin? Are there any other changes to be made to use the CGI servlet? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How does a servlet request work. Not a newbie question ;)
Hi all I want to insert some form of scheduling into our application and I was wondering how Tomcat passes the request to the actual servlet I write. Does Tomcat just read the headers to create the request object and leave the body of the message in an inputstream for the servlet to read or is all the data in the request read by Tomcat before passing it to servlet? Some of my traffic is more important that other based on headers in the request. I want to prioritise the handling of requests under load conditions. Any input on this is welcome. Thanks Donie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: odd subclassed-servlet behavior
Yoav, thank you for your reply. The classes are all packaged up neatly into .wars and .jars inside of a .ear. I have no reason to believe they are not all being loaded by the same classloader, but JBoss is a heavy beast, and I could be wrong. I did do a server stop/start to avoid any weird hot-deployment issues. I also made sure JAVA_HOME was set and pointing to my jdk1.4.2 directory. Code-wise, I provided a simplified description originally. The actual code is not ready for any sort of peer-review. Also, I am not satisfied with the architecture as described below, and will be refactoring it. The problem will probably, at that point, disappear. I guess I'm just checking for a known problem of some kind, some specific bug that I should be looking for that displays these kinds of symptoms. Thank you, and thanks to the whole Tomcat team! This is one hell of a piece of work. Bill On Thu, 8 Jan 2004, Shapira, Yoav wrote: Howdy, Can you share the relevant code? Are the classes all being loaded from the same classloader? Yoav Shapira Millennium ChemInformatics -Original Message- From: Bill Wadley [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:29 AM To: [EMAIL PROTECTED] Subject: odd subclassed-servlet behavior Hello! I have just upgraded from JBoss/Jetty 3.0.4 to JBoss/Tomcat 3.2.3, and have noticed some rather odd behavior. I have 3 servlets: SuperClazz |--- SubClazz |--- SubSubClazz SuperClazz subclasses HttpServlet but is not meant to be called directly, but SubClazz and SubSubClazz are both standalone servlets and I call them directly depending on what I need. SubClazz does general things, and SubSubClazz does more specific things. SubClazz delegates to SuperClazz and SubSubClazz delegates to SubClazz as needed. This was working in JBoss 3.0.4 and Jetty. However, in Tomcat 4.1.29 just now I observed that calling SubClazz directly resulted in SubSubClazz getting the call, then execution tracing straight to SuperClazz, _then_ SubClazz. SubSubClazz was the last thing executing before it failed. (That failure is the thing; SubSubClazz doesn't have what it takes to handle my request, and I don't want it called.) Here is an example of my problem. By calling the URL: http://localhost/myApp/servlet/SubClazz?a=1 I get this output from the running server: 10:23:24,020 INFO [STDOUT] [SubSubClazz.doGet] GOT HERE 1 10:23:24,020 INFO [STDOUT] [SubSubClazz.doPost] GOT HERE 1 10:23:24,020 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 1 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 2 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 3 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 4 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 5 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 6 10:23:24,021 INFO [STDOUT] [SubClazz.doPost] GOT HERE 1 10:23:24,021 INFO [STDOUT] [SubClazz.doPost] GOT HERE 2 10:23:24,021 INFO [STDOUT] [SuperClazz.doAThing] GOT HERE 1 10:23:24,023 ERROR [Engine] StandardWrapperValve[SubSubClazz]: Servlet.service() for servlet SubSubClazz threw exception java.lang.IllegalStateException: Cannot forward after response has been committed at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis patc her.java:368) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa tche r.java:356) ...bad stuff happening since correct calling order is not happening... Can anybody explain why: SubClazz is being skipped and SubSubClazz is getting the request in the first place? SubClazz is not getting the super() call, but instead it is going straight to SuperClazz? SubClazz is getting the call after SuperClazz, especially after having been skipped originally? Thanks very much in advance for any light that can be shed on this behavior. Bill Wadley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Bill -- Bill Wadley [EMAIL PROTECTED] 972.866.8200 x207 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem finding .keystore in change from TC 4.1.27 to 5.0.16
I'm having a problem with SSL keystore location moving from Tomcat 4.1.27 to Tomcat 5.0.16 Here's the 4.1.27 SSL connector code from servlet.xml !-- Define a SSL Coyote HTTP/1.1 Connector on port 443 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=443 minProcessors=5 maxProcessors=75 enableLookups=true acceptCount=100 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory keystoreFile=keys/.keystore keystorePass=password clientAuth=false protocol=TLS / /Connector Here's the new code from 5.0.16 !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -- Connector port=443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true keystoreFile=keys/.keystore keystorePass=password clientAuth=false sslProtocol=TLS / The file .keystore is stored in a directory keys located off $TOMCAT_ROOT$ (i.e. C:\jakarta-tomcat-5.0.16\keys. It was in the same relative place for 4.0.17, and the keystore file was found without any problems. But - If I start up Tomcat, I get a FileNotFoundException - it cannot find keys\.keystore. If I change this line to this: keystorePass=password Then it expects to find .keystore in C:\Documents and Settings\Richard\.keystore. If I put .keystore there, it all works perfectly. So my question is - where is Tomcat 5.0.16 expecting to find a file called keys/.keystore ? Should I have another directory parameter or some such? Thanks, -Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question on using Tomcat 5 in production environment; using m ultiple instances or not?
Isn't this a maintenance nightmare ? -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: dinsdag 6 januari 2004 14:40 To: Tomcat Users List Subject: RE: Question on using Tomcat 5 in production environment; using multiple instances or not? Howdy, For minimum interference, run one instance of tomcat per application per machine. So if you have five apps and two machines, that's ten instances of tomcat. Yoav Shapira Millennium ChemInformatics -Original Message- From: Marco Pas [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 5:30 AM To: '[EMAIL PROTECTED]' Subject: Question on using Tomcat 5 in production environment; using multiple instances or not? Hi, I cannot find a suitable answer on the situation and questions below: Situation: I want to use Tomcat in a high available environment, using 2 machines behind a load-balancer. On these machines several tomcat applications should be running. Requirements are: - maximum speed - ease of setup and maintenance - (possible) session clustering for failover purposes - when upgrading a specific application other applications should suffer no interference Questions that i have are: - Should i run multiple instances of Tomcat on each machine, or just 1 instance of Tomcat per machine ? - Should i run a Tomcat instance per application - Any experience in using session clustering and if this seems to hit the performance ? I am searching for an infrastructure setup that suites my needs! Any good hints and tips on implementing Tomcat in a production enviroment ? Greetings, Marco Pas This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.1.29: Pool exhausted
Hello, I tried to move my web application from Tomcat 4.1.27 to Tomcat 4.1.29. The application has a JNDI datasource. Everything worked properly in 4.1.27, but after I moved to 4.1.29 I've got an exception: Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause: java.util.NoSuchElementException: Could not create a validated object at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPoo l.java:851) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja va:140) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:5 18) at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(Datas ourceConnectionProvider.java:59) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:257) I know that 4.1.29 has the newest versions of Dbcp and Pool. May be some new parameters appeared for Dbcp 1.1. I think it is the reason of my exception. When I replace version 1.1 of Dbcp and Pool to version 1.0 in common/lib of Tomcat 4.1.29 - everything started working well! I wonder if anybody got success using JNDI datasource and Tomcat 4.1.29. Tomcat works under J2SE 1.3.1. Thanks. Dmitry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modifying tomcat startup options on Tomcat 5 with Windows .exe
Just open the windows services application and select the tomcat service from the list. Click poperties and set the parameters you want in the box provided. (I think) Andrew Waters. Allistair Crossley wrote: Hi, I have the windows version of Tomcat 5 installed and am using the windows service. I need to add the -security option to the startup. I notice that catalina.bat is still there but a) does the tomcat.exe use catalina.bat's config? b) how do I make the tomcat.exe service use -security? Cheers, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat 5.0.16 Replication
Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48% 88.34% 15 810 java.lang.Object.wait 12 4.47% 92.81% 1 910 java.net.PlainSocketImpl.socketAccept 13 0.71% 93.52% 2 623 java.lang.Object.wait 14 0.56% 94.08% 2 706 java.lang.Object.wait 15 0.38% 94.46% 2 914 java.lang.Object.wait 16 0.24% 94.70% 775 913
Re: How does a servlet request work. Not a newbie question ;)
Donie Kelly wrote: Hi all I want to insert some form of scheduling into our application and I was wondering how Tomcat passes the request to the actual servlet I write. Does Tomcat just read the headers to create the request object and leave the body of the message in an inputstream for the servlet to read or is all the data in the request read by Tomcat before passing it to servlet? Some of my traffic is more important that other based on headers in the request. I want to prioritise the handling of requests under load conditions. I'm not aware of any priority scheduling in Tomcat's worker threads. There is no public API for that, anyway. If I understand correctly, you'd like people to login to a part of your app and then they will be issued a Cookie, which would be the token for boosting priority of such requests. Possibly in a Filter. Unless you wish to employ your own thread pools, internal or real, I think this is a no-go. As a quick solution, you'd be better off using IP layer stuff, like IP QoS (Quality of Service), Linux policy routing, etc. Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Modifying tomcat startup options on Tomcat 5 with Windows .exe
Nope, all that is there is name, description and an uneditable path to exe set as d:\Tomcat 5.0\bin\tomcat.exe //RS//Tomcat5 That's it. There is a Tomcat COnfiguration utility that comes with it but you can only set the JVM params, not Tomcat's. -Original Message- From: Andrew Waters [mailto:[EMAIL PROTECTED] Sent: 09 January 2004 12:28 To: [EMAIL PROTECTED] Subject: Re: Modifying tomcat startup options on Tomcat 5 with Windows .exe Just open the windows services application and select the tomcat service from the list. Click poperties and set the parameters you want in the box provided. (I think) Andrew Waters. Allistair Crossley wrote: Hi, I have the windows version of Tomcat 5 installed and am using the windows service. I need to add the -security option to the startup. I notice that catalina.bat is still there but a) does the tomcat.exe use catalina.bat's config? b) how do I make the tomcat.exe service use -security? Cheers, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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: How does a servlet request work. Not a newbie question ;)
Hi Nix I need to read the headers to see if the request can be moved up in priority. If no I will put that particular servlet into a wait state to be woken up by some scheduler I create in the servlet engine. Ideally, all requests will be processed but some will be done before others. It is not a login or cookie application. We are not using browsers to access the application so the headers are customizable and we know the type of message arriving. It's just we want some types of messages to be done. Under load we can reject certain messages that are not high priority if an internal processor cannot be assigned with a specified time frame. Thanks Donie -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: 09 January 2004 12:34 To: Tomcat Users List Subject: Re: How does a servlet request work. Not a newbie question ;) Donie Kelly wrote: Hi all I want to insert some form of scheduling into our application and I was wondering how Tomcat passes the request to the actual servlet I write. Does Tomcat just read the headers to create the request object and leave the body of the message in an inputstream for the servlet to read or is all the data in the request read by Tomcat before passing it to servlet? Some of my traffic is more important that other based on headers in the request. I want to prioritise the handling of requests under load conditions. I'm not aware of any priority scheduling in Tomcat's worker threads. There is no public API for that, anyway. If I understand correctly, you'd like people to login to a part of your app and then they will be issued a Cookie, which would be the token for boosting priority of such requests. Possibly in a Filter. Unless you wish to employ your own thread pools, internal or real, I think this is a no-go. As a quick solution, you'd be better off using IP layer stuff, like IP QoS (Quality of Service), Linux policy routing, etc. 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]
Using acceptCount in server.xml
Hi all Just wondering how to use acceptCount in the Connector class. Default example here modified to show what Im trying to test to understand how this works. Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 minProcessors=1 maxProcessors=1 enableLookups=true acceptCount=2 debug=0 scheme=https secure=true useURIValidationHack=false disableUploadTimeout=true Factory className=org.apache.coyote.tomcat4.CoyoteServerSocketFactory clientAuth=false protocol=TLS / /Connector I start Tomcat with this setup and see that it has only one object in its connection pool as expected. I have a small servlet that just returns a number (incrementing) and has a forced pause to simulate work being done. 2 seconds wait. I send the request with Browser 1 to the servlet and it doesnt return yet. Should be asleep for 2 seconds I send the request with Browser 2 to the servlet and it does noting but looks like its busy as expected as maxProcessors=1 above Browser 1 now returns with its incrementing number Now I expect browser 2 to be assigned to the free connection in Tomcats pool but nothing happens ever. Browser 1 goes again and works after 2 seconds. Q: Why did browser 2 not get assigned the servlet that browser 1 freed up when it finished the request Q: Does the acceptCount does what I think it does? Thanks for any help in understanding how this works. Donie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.1.29: Pool exhausted
Hello, I tried to move my web application from Tomcat 4.1.27 to Tomcat 4.1.29. The application has a JNDI datasource. Everything worked properly in 4.1.27, but after I moved to 4.1.29 I've got an exception: Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool exhausted, cause: java.util.NoSuchElementException: Could not create a validated object at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPoo l.java:851) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja va:140) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:5 18) at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(Datas ourceConnectionProvider.java:59) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:257) I know that 4.1.29 has the newest versions of Dbcp and Pool. May be some new parameters appeared for Dbcp 1.1. I think it is the reason of my exception. When I replace version 1.1 of Dbcp and Pool to version 1.0 in common/lib of Tomcat 4.1.29 - everything started working well! I wonder if anybody got success using JNDI datasource and Tomcat 4.1.29. Tomcat works under J2SE 1.3.1. Thanks. Dmitry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: External Access to Server (Servlets)
Howdy, Well, it might be a network issue -- do you have a static IP address registered with the name servers? Your servlets are mapped in web.xml? What tomcat version are you using? Yoav Shapira Millennium ChemInformatics -Original Message- From: Gerry Oakson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 7:07 AM To: 'Tomcat Users List' Subject: External Access to Server (Servlets) I am new to Tomcat and Servlets/JSP but things are going great except when I try to access the server from outside my house. I can access the home page (default Tomcat page), and I can also access various HTML files. But when I click on a link that uses a Servlet, the page will not display. I does however work fine when I am logged in locally and running things. (IE: http://localhost/Books/myBooks.htm ) More specifically I am testing the Book Catalog example in Chapter Nine of Marty Hall's Core Servlets and JavaServer Pages. Everything work perfectly running it locally! Does anyone have any ideas? Thanks so much, Gerry Oakson This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How does a servlet request work. Not a newbie question ;)
Howdy, I see three options that fall within the realm of not a huge amount of work: - Dig into tomcat source code, extend Coyote in some custom way to recognize your headers, recognize what you call load (which is much harder to do than recognizing headers), and filter requests appropriately. - Create a simple Filter (ServletFilter) that looks for your request headers, again recognizes load, and filters requests appropriately (this filter would be mapped to url-pattern /*). This is far less efficient than the Coyote solution, because you will reject requests further along the processing pipeline that you need to, but this approach is portable. - Attack the problem with clustering: install more tomcat instances and a load balancer, ideally one that can assign weights to your workers and direct requests to workers according to headers. (The balancer webapp that ships with tomcat 5 has a request header rule that will let you redirect requests based upon header values -- you'd have to add the load recognition capability). Yoav Shapira Millennium ChemInformatics -Original Message- From: Donie Kelly [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 7:20 AM To: Tomcat Users List (E-mail) Subject: How does a servlet request work. Not a newbie question ;) Hi all I want to insert some form of scheduling into our application and I was wondering how Tomcat passes the request to the actual servlet I write. Does Tomcat just read the headers to create the request object and leave the body of the message in an inputstream for the servlet to read or is all the data in the request read by Tomcat before passing it to servlet? Some of my traffic is more important that other based on headers in the request. I want to prioritise the handling of requests under load conditions. Any input on this is welcome. Thanks Donie This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Invoking script from TC 5.0.16
Howdy, Specify the full path to chmod. Your Runtime.exec calls will only have a limited environment inherited. If you're not running tomcat explicitly with a security manager, you don't need to worry about the policy as it's not consulted anyways. Of course, since you're running tomcat as root we can only assume you don't care much for security. Yoav Shapira Millennium ChemInformatics -Original Message- From: Keshav Sarin [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 3:20 PM To: [EMAIL PROTECTED] Subject: Invoking script from TC 5.0.16 I have configured TC 5.0.16 on Linux. In a JSP, using RunTime.exec(), I'm trying to run a bash script that changes the mode of a file. I get the following exception in the logs: java.io.IOException: chmod : not found. If the chmod line is commented in the script or when the script is run from console, there are no errors. Is there any permission issue here? TC runs as root. I read some earlier posts that lead me to using security-manager policy. I tried the following setting in catalina.policy and restarted TC with security flag but didn't help. grant codeBase file:${catalina.home}/webapps/myapp/- { permission java.security.AllPermission; }; Thanks Keshav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Mapping /BAH/ to /
Howdy, That's a context path clash: you need to ensure unique context paths for your apps across hosts. For example, use reports and reports2, or salesReports and itReports, or whatever, as long as they're different. Keep the two hosts with separate appBases (which can be absolute directories if you wish, BTW, or relative e.g. webapps/IT and webapps/Sales). Yoav Shapira Millennium ChemInformatics -Original Message- From: Green, Jeffrey [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 8:03 PM To: 'Tomcat Users List' Subject: RE: Mapping /BAH/ to / Tried setting up two hosts as Yoav suggested. No errors when I start tomcat and the log records deployments within the second deploy directory, but I cannot access those webapps. EG, if I deploy reports.war in the first (default) deploy directory of webapps, I can access it at http://localhost:8080/reports but if I only deploy reports.war in the secondary deploy directory (without putting it in the first), going to the same URL returns nothing. Can one set up two Host configurations even if they only have one domain name (as is the case with me). If not, how else can one set up two different deploy directories? -Original Message- From: Green, Jeffrey Sent: Thursday, January 08, 2004 3:25 PM To: 'Tomcat Users List' Subject: RE: Mapping /BAH/ to / Hrm... Tried this and it doesn't quite work for me. In my server.xml, I have one Host defined. Setting its appBase=BAR simply requires all webapps to be in the $TOMCAT_HOME/BAR directory instead of the $TOMCAT_HOME/webapps directory. The user (at the browser) sees none of this since the path to a webapp is not http://localhost:8080/webapps/myApp.war but is instead http://localhost:8080/myApp.war. Thus, changing the appBase has no effect on what the user sees, only where the files are stored. I must have worded my question wrong. Say for example, we have mycompany.com who has two divisions - Sales and IT. Each wants to use JSP / Servlets, but they want different deploy directories and different paths visible to the user. Thus, sales wants all of its webapps to be at http://mycompany.com:8080/Sales/someSalesWebapp/foo.jsp http://mycompany.com:8080/Sales/anotherSalesWebapp/foo2.jsp Whereas IT wants all of its webapps to be at http://mycompany.com:8080/IT/someITWebapp/bar.jsp http://mycompany.com:8080/IT/anotherITWebapp/bar2.jsp Sales people can copy their .war files to the $SALES_DEPLOY directory and their webapps will be deployed to the /Sales/ space. IT people can copy their .war files to the $IT_DEPLOY directory and their webapps will be deployed to the /IT space. Is such a configuration possible? :) All advice has and will be a huge help. Thanks. -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:22 PM To: Tomcat Users List Subject: RE: Mapping /BAH/ to / Howdy, Sure, define a Host with the BAR appBase. (See the Host configuration reference if you're not sure what I mean). Yoav Shapira Millennium ChemInformatics -Original Message- From: Green, Jeffrey [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:21 PM To: 'Tomcat Users List' Subject: RE: Mapping /BAH/ to / The balancer is nice, but having to add a balancer filter to each webapp is not feasible in our setup (where we'd prefer to separate administration from deployment). Perhaps I could solve this problem by altering how webapps are deployed. Is there a way to deploy all webapps in a /BAR/ top level directory instead of simply in / without changing how users deploy? Thus if a user puts a webapp.war file in $DEPLOYDIRECTORY, Tomcat will serve it up only in http://hostname:8080/BAR/webapp. This should be do-able, right? -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:02 AM To: Tomcat Users List Subject: RE: Mapping /BAH/ to / Howdy, Thanks for the response. How bout if I want the mapping to be for *all* webapps on the appserver? Eg, I want: http://hostname:8080/FOO/bar to map to /bar http://hostname:8080/FOO/sampleWebapp to map to /sampleWebapp http://hostname:8080/FOO/anotherWebapp to map to /anotherWebapp Etc for all webapps in the server. Is this behavior possible? Take a look at the balancer webapp's URLStringMatchRule (Balancer ships with tomcat 5). It's perfect for your needs. You would add the balancer filter to your webapp and add a string match rule to balancer's rules.xml file for every case like the above 3. Yoav Shapira -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:52 AM To: Tomcat Users List Subject: RE: Mapping /BAH/ to / Howdy, Sure, make BAH a simple web application with just one class, a filter mapped to url-pattern /* that does a sendRedirect to / + the rest of the path. I don't know if that's simpler than a Valve, but it's portable. Apache's mod_rewrite can also
RE: odd subclassed-servlet behavior
Howdy, OK ;) If/when you want us to help with the code, feel free to ask. There are no known problems with tomcat skipping steps in the class hierarchy or invoking the wrong class, e.g. a superclass instead of a subclass. It would be a JVM rather than a Tomcat problem anyways. One time I thought that was happening, I misspelled a method in the subclass ;) Check for that, and use instanceof to check the actual runtime class of your objects if you need to ascertain it. Yoav Shapira Millennium ChemInformatics -Original Message- From: Bill Wadley [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 3:23 PM To: Tomcat Users List Subject: RE: odd subclassed-servlet behavior Yoav, thank you for your reply. The classes are all packaged up neatly into .wars and .jars inside of a .ear. I have no reason to believe they are not all being loaded by the same classloader, but JBoss is a heavy beast, and I could be wrong. I did do a server stop/start to avoid any weird hot-deployment issues. I also made sure JAVA_HOME was set and pointing to my jdk1.4.2 directory. Code-wise, I provided a simplified description originally. The actual code is not ready for any sort of peer-review. Also, I am not satisfied with the architecture as described below, and will be refactoring it. The problem will probably, at that point, disappear. I guess I'm just checking for a known problem of some kind, some specific bug that I should be looking for that displays these kinds of symptoms. Thank you, and thanks to the whole Tomcat team! This is one hell of a piece of work. Bill On Thu, 8 Jan 2004, Shapira, Yoav wrote: Howdy, Can you share the relevant code? Are the classes all being loaded from the same classloader? Yoav Shapira Millennium ChemInformatics -Original Message- From: Bill Wadley [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:29 AM To: [EMAIL PROTECTED] Subject: odd subclassed-servlet behavior Hello! I have just upgraded from JBoss/Jetty 3.0.4 to JBoss/Tomcat 3.2.3, and have noticed some rather odd behavior. I have 3 servlets: SuperClazz |--- SubClazz |--- SubSubClazz SuperClazz subclasses HttpServlet but is not meant to be called directly, but SubClazz and SubSubClazz are both standalone servlets and I call them directly depending on what I need. SubClazz does general things, and SubSubClazz does more specific things. SubClazz delegates to SuperClazz and SubSubClazz delegates to SubClazz as needed. This was working in JBoss 3.0.4 and Jetty. However, in Tomcat 4.1.29 just now I observed that calling SubClazz directly resulted in SubSubClazz getting the call, then execution tracing straight to SuperClazz, _then_ SubClazz. SubSubClazz was the last thing executing before it failed. (That failure is the thing; SubSubClazz doesn't have what it takes to handle my request, and I don't want it called.) Here is an example of my problem. By calling the URL: http://localhost/myApp/servlet/SubClazz?a=1 I get this output from the running server: 10:23:24,020 INFO [STDOUT] [SubSubClazz.doGet] GOT HERE 1 10:23:24,020 INFO [STDOUT] [SubSubClazz.doPost] GOT HERE 1 10:23:24,020 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 1 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 2 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 3 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 4 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 5 10:23:24,021 INFO [STDOUT] [SuperClazz.doPost] GOT HERE 6 10:23:24,021 INFO [STDOUT] [SubClazz.doPost] GOT HERE 1 10:23:24,021 INFO [STDOUT] [SubClazz.doPost] GOT HERE 2 10:23:24,021 INFO [STDOUT] [SuperClazz.doAThing] GOT HERE 1 10:23:24,023 ERROR [Engine] StandardWrapperValve[SubSubClazz]: Servlet.service() for servlet SubSubClazz threw exception java.lang.IllegalStateException: Cannot forward after response has been committed at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis patc her.java:368) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa tche r.java:356) ...bad stuff happening since correct calling order is not happening... Can anybody explain why: SubClazz is being skipped and SubSubClazz is getting the request in the first place? SubClazz is not getting the super() call, but instead it is going straight to SuperClazz? SubClazz is getting the call after SuperClazz, especially after having been skipped originally? Thanks very much in advance for any light that can be shed on this behavior. Bill Wadley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is
RE: Question on using Tomcat 5 in production environment; using multiple instances or not?
Howdy, It's always about tradeoffs. The poster asked for minimum interference, which I read to say if one webapp crashes, or a JSP does System.exit(), or there's malicious code running, then other webapps should not be affected. There's no way to do that if the webapps are within the same JVM, so separate tomcat instances are needed. As for the per machine part, he has a cluster already, so if you want to keep the above separation on every machine in the cluster (which I would), then that's what you have to do. Whether it's a maintenance nightmare depends on the setup. If you use tomcat out of the box, just changing the port numbers, then probably not. We have dozens and dozens of such tomcat instances. Since they're so stable, monitored by services like Nagios, and hardly ever restarted, it hasn't been a maintenance issue for us at all. And then there's the counter-argument: if you have to explain to your CEO that one little reporting webapp brought down all your other webapps because of a bug and you didn't want to separate them in order to save a bit of maintenance time/money, well, that's a tough sell. (And I've been in that spot before ;)) Yoav Shapira Millennium ChemInformatics -Original Message- From: Marco Pas [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 3:08 AM To: 'Tomcat Users List' Subject: RE: Question on using Tomcat 5 in production environment; using multiple instances or not? Isn't this a maintenance nightmare ? -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: dinsdag 6 januari 2004 14:40 To: Tomcat Users List Subject: RE: Question on using Tomcat 5 in production environment; using multiple instances or not? Howdy, For minimum interference, run one instance of tomcat per application per machine. So if you have five apps and two machines, that's ten instances of tomcat. Yoav Shapira Millennium ChemInformatics -Original Message- From: Marco Pas [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 06, 2004 5:30 AM To: '[EMAIL PROTECTED]' Subject: Question on using Tomcat 5 in production environment; using multiple instances or not? Hi, I cannot find a suitable answer on the situation and questions below: Situation: I want to use Tomcat in a high available environment, using 2 machines behind a load-balancer. On these machines several tomcat applications should be running. Requirements are: - maximum speed - ease of setup and maintenance - (possible) session clustering for failover purposes - when upgrading a specific application other applications should suffer no interference Questions that i have are: - Should i run multiple instances of Tomcat on each machine, or just 1 instance of Tomcat per machine ? - Should i run a Tomcat instance per application - Any experience in using session clustering and if this seems to hit the performance ? I am searching for an infrastructure setup that suites my needs! Any good hints and tips on implementing Tomcat in a production enviroment ? Greetings, Marco Pas This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.
RE: ServletContextListener: how to suspend web app on error
Howdy, Throw any RuntimeException from the method, and the server will mark the context as unavailable -- all requests will return HTTP code 503. Tim's filter approach is fine too. Yoav Shapira Millennium ChemInformatics -Original Message- From: Justin Ruthenbeck [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 7:36 PM To: Tomcat User List Subject: ServletContextListener: how to suspend web app on error Seems like a simple question, can't seem to find the answer... If an error occurs in the #contextInitialized() method of an object that implements ServletContextListener, how can I suspend the web application so that it is unavailable for use by clients? Specifically, I have a ServletContextListener that needs to be run at application startup. If any one of many errors occur, I want to notify the appropriate people (this I can do) and make the entire webapp unavailable (this I can't figure out). Any help is appreciated. I have a feeling this is obvious and I'm just missing something. Cheers, justin __ 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] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and IBM JVM
Howdy, Is this a JAXP 1.1-compatible JVM? Yoav Shapira Millennium ChemInformatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:27 PM To: [EMAIL PROTECTED] Subject: Tomcat and IBM JVM I have been able to run our tomcat installation without any problem on Solaris and Windows. However when I try to run it in AIX I am having the following problem: Apache Tomcat/4.0.4 Exception in thread main javax.xml.parsers.FactoryConfigurationError: Provider null could not be instantiated: java.lang.NullPointerException at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:14 1) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:224) at org.apache.catalina.realm.MemoryRealm.start(MemoryRealm.java:333) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.startup.Embedded.addEngine(Embedded.java:469) at geh.appserver.webserver.WebServerManager.prepareWebServerEngine(WebServ erMa n ager.java:265) at geh.appserver.webserver.WebServerManager.init(WebServerManager.java:7 4) at geh.appserver.webserver.WebServerManager.getInstance(WebServerManager.j ava: 9 2) I suppose I have to change some System property so that it uses a specified XML parser but I do not know which one it is. Any help would be greatly appreciated. Thank You Carlos Javier Rivera Vazquez Staff Engineer GE Power Systems Network Reliability Services 1990 West NASA Blvd Melbourne, FL 32904 __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat disableProxyCaching
Howdy, That's server.xml. Yoav Shapira Millennium ChemInformatics -Original Message- From: Konrad [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 4:27 AM To: Tomcat Users List Subject: Re: Tomcat disableProxyCaching Konrad [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Can I somehow instract Tomcat *in config files* to set disableProxyCaching to false ? Context docBase=myapp path=/myapp ... Valve className=org.apache.catalina.authenticator.FormAuthenticator disableProxyCaching=false / /Context Of course, if you are not using Form authentication, then substitute the correct class (e.g. BasicAuthenticator, DigestAuthenticator, SSLAuthenticator). One more thing ... in which file shold I add these lines ? ;-) -- Regards Konrad :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Webapp names and paths within JSPs for images
Howdy, THIS is what request.getContextPath() is for. Don't construct absolute URLs unless you have to -- what's the advantage? Yoav Shapira Millennium ChemInformatics -Original Message- From: Mike Curwen [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 4:20 PM To: 'Tomcat Users List'; 'David Wall' Subject: RE: Webapp names and paths within JSPs for images I've become used to constructing image URL paths (where necessary) as absolute paths. So I'd do something like: http://%= request.getServerName() + request.getContextPath() %/images/foo.gif If you wanted to, you could wrap that String construction up into a taglib or even a method declared in your JSP with a %! tag. As for escaping HTML for display, there are plenty of taglibs that will do this for you, including JSTL (a 'standard' way of doing it). -Original Message- From: David Wall [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 3:11 PM To: 'Tomcat Users List' Subject: Re: Webapp names and paths within JSPs for images Well, right now we have a hard-coded app name for the paths (when we can't rely on relative path names) in the image tags since making all image tag path names dynamic would be a bit of a pain, plus it would make those images not appear in tools like Macromedia that need to be able to resolve the paths locally. It seems that we're either doing this wrong or the pretense that webapps can be deployed using any name chosen at deployment time simply is not true. I would not be surprised since I find a lot of plumbing type work is still necessary when using JSPs. Another one is having to encode all output so it's HTML safe, including data values that appear in INPUT value=abc type tags as well as SELECT and TEXTAREA when 99.99% of the time we want our output to be HTML safe. While it's a pain coding-wise, there's also no standard way to do that encoding so we all write our own routines that convert to quot; and the like. It just seems like there's a lot more marketing to JSPs right now than is delivered considering how mature Java/JSPs are already. David - Original Message - From: Green, Jeffrey [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED]; 'David Wall' [EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:53 PM Subject: RE: Webapp names and paths within JSPs for images I'm running into the exact same issue. It seems that you could use HttpServletRequest.getContextPath() or parse through HttpServletRequest.getRequestURI() to get the root-relative path of the URL. Then prepend that with the image name (or do whatever manipulation is necessary). I've found it tougher to actually get a webapp deployed using any 'name' I'd like. Hod did you get that working? -Original Message- From: David Wall [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 3:43 PM To: Tomcat Users List Subject: Webapp names and paths within JSPs for images In theory I should be able to take my webapp (starting with the base directory that contains the WEB-INF subdirectory) and deploy it using any name I'd like, so I could easily deploy the same webapp with URLs like http://mydomain.com/ (using the root context) or http://mydomain.com/app1/ or even http://mydomain.com/app2/ etc. However, JSPs can include files using the / root to indicate I'm talking about a file at the top of the webapp directory and that works fine. But images need to include URLs that that aren't processed by tomcat (so it doesn't know about the webapp's base directory), so I have to use names like /images/image.gif or /app1/images/image.gif or /app2/images/image.gif depending on where the webapp was actually deployed. While I can use relative paths for such images much of the time, when using servlets that redirect/forward or whatever, the current directory is not always the same, so you can't just use images/image.gif or ../images/image.gif to make it work. How are people coding their JSPs and servlets that return IMG tags so that the images can always be defined without including the webapp path name? Thanks, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction,
RE: Question on using Tomcat 5 in production environment; using multiple instances or not?
One additinal remark: In the long term having one instance with multiple webapps can easily become a maintainance and/or qs nightmare. With each webapp in a dedicated instance it's much easier to change versions of libraries or even the vm. Just imagine what happens if one of 100 applications requires an incompatible change in a library. -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 2:32 PM To: Tomcat Users List Subject: RE: Question on using Tomcat 5 in production environment; using multiple instances or not? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SSL failure with some browsers - Access denied by access control list
Problem: - Making any https call fails with the message Forbidden. You were denied access because: Access denied by access control list.. - The failure happens even accessing https://host:8443/tomcat-docs, while a regular http call succeeds. - The failure happens with some browsers (i.e.: Mozilla) but now with others (i.e.: Internet Explorer, and most versions of Netscape). - The failure appears to only happen when accessing a server on a different box than the one where the browser is running. It has not happened (so far) on the same box as the client. - The failure appears to happen with the Tomcat running on either Windows or Solaris. - The failure is not related to the JDK's Verisign Certificate issue (expired Jan 7). It was happening in December, and it was not corrected by JDK 1.4.2_03. Also, the certificates being used are self-signed according to the Tomcat's default instructions. Questions: - Is this a configuration issue? Or is it a deeper problem with either Tomcat or the browsers? I have not seen many postings out there on this topic, so I assume (and hope) the problem is a dumb configuration snafu. - Is there a know solution? I have not found any on the Tomcat archives, on the Mozilla archives, or even after several exchanges with the Mozilla support people. - Is there any additional information I can provide that might shed some light as to why this is happening? Environment details: - Tomcat version: 5. - JDK version 1.4.2 (both _02 and _03). - Mozilla versions failing (at least 1.4 and 1.5). - IE version succeeding (at least 6.0) - Netscape version succeeding (at least 4.5, 4.7, and I believe one of the 7.x versions). server.xml: (feel free to comment if you see something wrong even if unrelated) Server port=8105 shutdown=SHUTDOWN debug=0 Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=0/ GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams /GlobalNamingResources Service name=Catalina Connector port=8089 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true / Connector port=8443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true clientAuth=false sslProtocol=TLS / Connector port=8109 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost debug=0 Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/ Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ /Host /Engine /Service /Server Bruno Melloni eBusiness Application Center, Americas Nokia, Inc 6000 Connection Drive, Mailstop 4w223 Irving, TX 75039 USA *Office: +1 (972)894-6120 *Cellular: +1 (469) 939-1067 * SMS: [EMAIL PROTECTED] * e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on using Tomcat 5 in production environment; using multiple instances or not?
Do u mean webapp or virtual host. Right now i have 1 tomcat to 1 machine setup with more then 10 virtual hosts in the server.xml. They all point to one server that is the data server for them. Would /Will this create a maintainance nightmare for me? Should each box have a copy of the code? Thanks, Daniel Schulken - Original Message - From: Ralph Einfeldt [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, January 09, 2004 8:46 AM Subject: RE: Question on using Tomcat 5 in production environment; using multiple instances or not? One additinal remark: In the long term having one instance with multiple webapps can easily become a maintainance and/or qs nightmare. With each webapp in a dedicated instance it's much easier to change versions of libraries or even the vm. Just imagine what happens if one of 100 applications requires an incompatible change in a library. -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 2:32 PM To: Tomcat Users List Subject: RE: Question on using Tomcat 5 in production environment; using multiple instances or not? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.560 / Virus Database: 352 - Release Date: 1/8/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Microsoft SQL Server validation query
These queries all seem like an awful lot of unnecessary processing. Here's what I use: SELECT 1+1 -Original Message- From: Antonio Fiol Bonnín [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:25 AM To: Tomcat Users List Subject: Re: Microsoft SQL Server validation query For any database server I can think of: CREATE TABLE validation ( dummy char(1) ); INSERT INTO validation VALUES ( 'X' ); -- and make sure you do this only once And then use as a validation query: SELECT * FROM validation; Well. Yes. I am ashamed of reimplementing Oracle's DUAL, but if you really want to know of a table that will always be there, provide it yourself. And anyway, I mostly agree with Mike's statement about server-specific params in the config files: Adding one more ... is not too much of a burden. Only if you set the validation query from outside the config files, which is very unlikely, Mike's statement would not strictly apply IMHO. Antonio Fiol Derek Mahar wrote: Thank you to all of you for your quick replies. It seems that the connection pool validation query is not specific to any database server implementation unless the query statement itself is server-specific (that is, it refers to a special server system database, table, or function). I like the idea of querying the server for the date, but I'm not sure that the date function is standard SQL and portable across all server implementations. Does anyone know otherwise? Derek -Original Message- From: Peter Lin [mailto:[EMAIL PROTECTED] Sent: January 8, 2004 10:35 AM To: Tomcat Users List Subject: RE: Microsoft SQL Server validation query in the past I just select the date from sql server. unless you want to test a specific table, but that has potential performance impact. the safe simple query to see if sql server is alive is to just select the date. peter lin Allistair Crossley [EMAIL PROTECTED] wrote: I would not do that because that would return as many 1s as there are rows in the table. Something like count(*) may not be the most efficient but it returns just 1 row always. Also with using 1, you cannot guarantee a row will come back. Allistair Crossley __ Intranet Senior Developer New Media Group, QAS Ltd Telephone: 020 7819 5343 __ -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:25 To: Tomcat Users List Subject: RE: Microsoft SQL Server validation query Or even SELECT 1 FROM TABLE. No COUNT overhead, if any. - MOD --- Allistair Crossley wrote: i think you could use anything .. maybe SELECT COUNT(*) FROM table The dual table is an oracle dummy table and is quite handy, but I think the validation query can just be any old select statement that should return true a result always. ADC -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:15 To: Tomcat Users List Subject: Microsoft SQL Server validation query Does anyone happen to know which validation query I should use for Microsoft SQL Server? Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk2 doesn't create jk2.socket
Apache 2.0.48 Tomcat 4.1.27 mod_jk2 2.0.2 Everything is built and configured but there is no jk2.socket being created. I'm not sure exactly which process (apache or tomcat ) should be creating the socket? I can post my config files if it would help but I'm hoping there is a simple solution. Thanks, -Mark
mod_jk2 doesn't create jk2.socket
Thought I'd post some additional information that may be helpful: Apache Error Logs: [Fri Jan 09 09:32:43 2004] [error] channelUn.connect() connect failed 2 No such file or directory [Fri Jan 09 09:32:43 2004] [error] ajp13.connect() failed ajp13:/usr/local/tomcat/work/jk2.socket [Fri Jan 09 09:32:43 2004] [error] ajp13.service() failed to connect endpoint errno=2 No such file or directory [Fri Jan 09 09:32:43 2004] [error] ajp13.service() Error forwarding ajp13:/usr/local/tomcat/work/jk2.socket 1 1 [Fri Jan 09 09:32:43 2004] [error] lb.service() worker failed 12 for ajp13:/usr/local/tomcat/work/jk2.socket Thanks, -Mark
java.security.AccessControlException
hello, i'm problem with my tomcat 5.0.16. i have a error message when tomcat start with the following message : java.security.AccessControlException: access denied (java.io.FilePermission C:\Tomcat\webapps\V2\WEB-INF\classes\mx4j\tools\naming\NamingService.class read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkRead(Unknown Source) at java.io.File.exists(Unknown Source) at org.apache.naming.resources.FileDirContext.file(FileDirContext.java:873) at org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:255) at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:334) at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClassLoader.java:1726) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1594) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:883) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1333) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1213) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at test.maclasse.database.rmi.ReloadCacheEngine.startServerRmi(ReloadCacheEngine.java:83) at test.maclasse.servlet.Init.init(ClientVersion.java:56) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3948) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) Caused by: java.lang.RuntimeException: access denied (java.util.PropertyPermission catalina.base read) at org.apache.catalina.core.ApplicationContextFacade.doPrivileged(ApplicationContextFacade.java:489) at org.apache.catalina.core.ApplicationContextFacade.log(ApplicationContextFacade.java:315) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1081) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3948) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) ... 6 more i modified the catalina.policy (WEB APPLICATION PERMISSIONS) to : grant { permission java.security.AllPermission; }; and the jar (mx4j-tools.jar) in tomcat/common/lib but doesn't work :(, on tomcat 4.1.29 it's work with the same settings where is my mistake ? thanks a lot
Tomcat 5, Apache2 and mod_jk2 integration problem
Hi I am running RedHat 9 with Tomcat 5.0.16 and Apache 2.0.48 and trying to get mod_jk2 to work so that I can use apache as the server and just pass jsp and servlet requests on to tomcat. In order to get tomcat to auto-generate the apache configuration files I have had to take tomcat-jk2.jar from the most recent nightly build (to get ApacheConfig.class) - see bugzilla bug report 25838 and its resolution. I eventually managed to get mod_jk2 to compile (using configure, make etc - not ant) and put mod_jk2.so and jkjni.so into apache/modules directory (and added the LoadModule to httpd.conf). Below I have pasted in my server.xml, workers2.properties and jk2.properties files which at least get apache and tomcat to both start without errors. My problem is that when I try to open /jsp-examples/ through apache, I get the following message in the browser : The servlet container is temporary unavailable or being upgraded along with an Internal Error (500), and in the catalina.out file I get : Jan 9, 2004 1:53:58 PM org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run SEVERE: Caught exception (java.lang.NoSuchMethodError: org.apache.coyote.Request.localName()Lorg/apache/tomcat/util/buf/MessageBytes;) executing [EMAIL PROTECTED], terminating thread in the apache error_log file is the following : [Fri Jan 09 13:53:58 2004] [error] msgAjp.receive(): Bad signature 00 [Fri Jan 09 13:53:58 2004] [error] channelSocket.receive(): Bad header [Fri Jan 09 13:53:58 2004] [error] workerEnv.processCallbacks() Error reading reply [Fri Jan 09 13:53:58 2004] [error] ajp13.service() ajpGetReply recoverable error 12 I have turned on as much logging as I can find and the jk2.log from mod_jk2 doesn't log anything after it has started up. However, I still have tomcat listening on port 8080 and the /jsp-examples/ works fine through there. From the contents of the log files I think mod_jk2 is working OK and passing the request on to Tomcat, but tomcat is failing to process the request - have I missed a step somewhere ? I have experimented with [uri: ...] entries in workers2.properties and with the Context tag in server.xml but haven't succeeded yet - can anyone help please ? Thanks for your time. Paul (Config files all with their comments removed) jk2.properties : shm.file=/usr/local/jakarta-tomcat-5/work/jk2.shm -- workers2.properties : [shm] file=/usr/local/jakarta-tomcat-5/work/jk2.shm size=1048576 [channel.socket:localhost:8009] tomcatId=localhost:8009 info=Ajp13 forwarding over socket [uri:/jsp-examples/*] [logger.file:0] level=DEBUG file=/usr/local/apache/logs/jk2.log -- server.xml Server port=8005 shutdown=SHUTDOWN debug=0 Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener forwardAll=false noRoot=false/ Listener className=org.apache.jk.config.ApacheConfig modJk=/usr/local/apache/modules/mod_jk2.so workersConfig=/usr/local/apache/conf/workers2.properties/ GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams /GlobalNamingResources Service name=Catalina Connector port=8080 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true / Connector className=org.apache.coyote.tomcat5.CoyoteConnector port=8009 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost debug=0 Logger className=org.apache.catalina.logger.FileLogger verbosity=4 prefix=catalina_log. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Listener className=org.apache.jk.config.ApacheConfig append=true forwardAll=false modJk=/usr/local/apache/modules/mod_jk2.so / Logger className=org.apache.catalina.logger.FileLogger verbosity=4
Re: java.security.AccessControlException
no thanks i see my error i'm a noobie .. - Original Message - From: thuret olivier [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, January 09, 2004 5:00 PM Subject: java.security.AccessControlException hello, i'm problem with my tomcat 5.0.16. i have a error message when tomcat start with the following message : java.security.AccessControlException: access denied (java.io.FilePermission C:\Tomcat\webapps\V2\WEB-INF\classes\mx4j\tools\naming\NamingService.class read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkRead(Unknown Source) at java.io.File.exists(Unknown Source) at org.apache.naming.resources.FileDirContext.file(FileDirContext.java:873) at org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:255) at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:334) at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClas sLoader.java:1726) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo ader.java:1594) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav a:883) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1333) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1213) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at test.maclasse.database.rmi.ReloadCacheEngine.startServerRmi(ReloadCacheEngin e.java:83) at test.maclasse.servlet.Init.init(ClientVersion.java:56) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10 44) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3948) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) Caused by: java.lang.RuntimeException: access denied (java.util.PropertyPermission catalina.base read) at org.apache.catalina.core.ApplicationContextFacade.doPrivileged(ApplicationCo ntextFacade.java:489) at org.apache.catalina.core.ApplicationContextFacade.log(ApplicationContextFaca de.java:315) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10 81) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3948) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) ... 6 more i modified the catalina.policy (WEB APPLICATION PERMISSIONS) to : grant { permission
Tomcat Deadlock
I'm having a weird problem with Tomcat locking up. I have a couple of functions on my site that rely heavily on transactions. To do a simple load test, I picked the function that hits the database the most and opened that same page in two different browser windows. I hit the submit button at roughly the same time, and waited. It appeared that both browser windows stalled. I looked at the processes in SQL Server (2000) and it said that all of the processes for the app were sleeping, and the two being used were sitting on insert statements for the same table (database deadlock?). I let both browsers sit trying to load for a lot longer than it should have taken for the page to finish, then just closed the windows. After that, the site was no longer accessible. The only way to get it working again was to restart the Tomcat service. Looking at the various log files, the only entry that appears interesting is the following from the site's log: 2004-01-09 10:43:18 StandardWrapper[/WIPT:action]: Waiting for 2 instance(s) to be deallocated I'm using tomcat 4.1.27 with SQL Server 2000 on a Win2K box. I've been having similar problems off and on for the last couple of weeks and have tried a number of different things to fix it. I made sure I closed all connections, statements, and result sets. I put all of the close code in a finally block. Another quick question - if the browser is closed in the middle of an operation, is the code in the finally block executed? Here is the JNDI data source definition from server.xml: Resource name=jdbc/WIPTDataSource auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/WIPTDataSource parameternamefactory/namevalueorg.apache.commons.dbcp.BasicDataS ourceFactory/value/parameter parameternamedriverClassName/namevaluecom.jnetdirect.jsql.JSQLDr iver/value/parameter parameternameurl/namevaluejdbc:JSQLConnect://:1433/WIPT/val ue/parameter parameternameusername/namevalue/value/parameter parameternamepassword/namevalue/value/parameter parameternamemaxActive/namevalue15/value/parameter parameternamemaxIdle/namevalue15/value/parameter parameternameminIdle/namevalue2/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternamevalidationQuery/namevalueSELECT 1+1/value/parameter parameternametestOnBorrow/namevaluetrue/value/parameter parameternametestOnReturn/namevaluetrue/value/parameter parameternametestWhileIdle/namevaluetrue/value/parameter parameternametimeBetweenEvictionRunsMillis/namevalue180/val ue/parameter parameternametestWhileIdle/namevaluetrue/value/parameter parameternamenumTestsPerEvictionRun/namevalue3/value/paramete r parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue300/value/parame ter parameternamelogAbandoned/namevaluetrue/value/parameter /ResourceParams Thanks! -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Deadlock
Howdy, Can you share your code that serves the page that locked up? Yoav Shapira Millennium ChemInformatics -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:19 AM To: Tomcat Users List Subject: Tomcat Deadlock I'm having a weird problem with Tomcat locking up. I have a couple of functions on my site that rely heavily on transactions. To do a simple load test, I picked the function that hits the database the most and opened that same page in two different browser windows. I hit the submit button at roughly the same time, and waited. It appeared that both browser windows stalled. I looked at the processes in SQL Server (2000) and it said that all of the processes for the app were sleeping, and the two being used were sitting on insert statements for the same table (database deadlock?). I let both browsers sit trying to load for a lot longer than it should have taken for the page to finish, then just closed the windows. After that, the site was no longer accessible. The only way to get it working again was to restart the Tomcat service. Looking at the various log files, the only entry that appears interesting is the following from the site's log: 2004-01-09 10:43:18 StandardWrapper[/WIPT:action]: Waiting for 2 instance(s) to be deallocated I'm using tomcat 4.1.27 with SQL Server 2000 on a Win2K box. I've been having similar problems off and on for the last couple of weeks and have tried a number of different things to fix it. I made sure I closed all connections, statements, and result sets. I put all of the close code in a finally block. Another quick question - if the browser is closed in the middle of an operation, is the code in the finally block executed? Here is the JNDI data source definition from server.xml: Resource name=jdbc/WIPTDataSource auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/WIPTDataSource parameternamefactory/namevalueorg.apache.commons.dbcp.BasicData S ourceFactory/value/parameter parameternamedriverClassName/namevaluecom.jnetdirect.jsql.JSQLD r iver/value/parameter parameternameurl/namevaluejdbc:JSQLConnect://:1433/WIPT/va l ue/parameter parameternameusername/namevalue/value/parameter parameternamepassword/namevalue/value/parameter parameternamemaxActive/namevalue15/value/parameter parameternamemaxIdle/namevalue15/value/parameter parameternameminIdle/namevalue2/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternamevalidationQuery/namevalueSELECT 1+1/value/parameter parameternametestOnBorrow/namevaluetrue/value/parameter parameternametestOnReturn/namevaluetrue/value/parameter parameternametestWhileIdle/namevaluetrue/value/parameter parameternametimeBetweenEvictionRunsMillis/namevalue180/va l ue/parameter parameternametestWhileIdle/namevaluetrue/value/parameter parameternamenumTestsPerEvictionRun/namevalue3/value/paramet e r parameternameremoveAbandoned/namevaluetrue/value/parameter parameternameremoveAbandonedTimeout/namevalue300/value/param e ter parameternamelogAbandoned/namevaluetrue/value/parameter /ResourceParams Thanks! -Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Deadlock
Can just answer the easy one: If a browser is closed in the middle of the request doesn't change the way the request is processed. If the application is waiting on a lock, it will keep waiting. There is just one way to find out if the browser has been closed: write to the output stream (but that isn't very precise due to buffers and caches). Sorry for the rest. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 5:19 PM To: Tomcat Users List Subject: Tomcat Deadlock After that, the site was no longer accessible. The only way to get it working again was to restart the Tomcat service. Looking at the various log files, the only entry that appears interesting is the following from the site's log: 2004-01-09 10:43:18 StandardWrapper[/WIPT:action]: Waiting for 2 instance(s) to be deallocated I'm using tomcat 4.1.27 with SQL Server 2000 on a Win2K box. I've been having similar problems off and on for the last couple of weeks and have tried a number of different things to fix it. I made sure I closed all connections, statements, and result sets. I put all of the close code in a finally block. Another quick question - if the browser is closed in the middle of an operation, is the code in the finally block executed? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem connecting Apache2 and Tomcat 5 via mod_jk2
I am receiving a java.lang.ClassNotFoundException for the org.apache.ajp.tomcat4.config.ApacheConfig class. Has anyone experienced this ? Has the ApacheConfig class been changed or had its package changed ? Is there a new Listener class I should be using instead of this one ? I have tried using both the Tomcat 5 source and the binary. I am using build 5.0.16. I tried switching back to tomcat 4 and i can get tomcat running and creating the expected, mod_jk.conf file... but then run into problems with the jk2 configuration on the apache side. It 'appears' like the tomcat 4 version is not creating the right files for use with mod_jk2 (it creates files for use with mod_jk ?) I am really at a loss here.
Re: Microsoft SQL Server validation query
Hooper, Brian wrote: These queries all seem like an awful lot of unnecessary processing. Here's what I use: SELECT 1+1 Indeed. If your server supports it, there is an even simpler one: select 1 or select 0. But this is not correct SQL for an Oracle server. Equivalent Oracle syntax is select 1 from dual. But on other servers, dual does not exist by default. Well... you see what I mean... Antonio smime.p7s Description: S/MIME Cryptographic Signature
RE: Tomcat 5, Apache2 and mod_jk2 integration problem
Try adding the following to your workers2.properties Try adding the followign to your workers2.properties [ajp13:localhost:8009] channel=channel.socket:localhost:8009 and add this to [uri:/jsp-examples] worker=ajp13:localhost:8009 Hope this helps, Yiannis workers2.properties : [shm] file=/usr/local/jakarta-tomcat-5/work/jk2.shm size=1048576 [channel.socket:localhost:8009] tomcatId=localhost:8009 info=Ajp13 forwarding over socket [uri:/jsp-examples/*] [logger.file:0] level=DEBUG file=/usr/local/apache/logs/jk2.log -- server.xml Server port=8005 shutdown=SHUTDOWN debug=0 Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener forwardAll=false noRoot=false/ Listener className=org.apache.jk.config.ApacheConfig modJk=/usr/local/apache/modules/mod_jk2.so workersConfig=/usr/local/apache/conf/workers2.properties/ GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams /GlobalNamingResources Service name=Catalina Connector port=8080 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=8443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true / Connector className=org.apache.coyote.tomcat5.CoyoteConnector port=8009 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost debug=0 Logger className=org.apache.catalina.logger.FileLogger verbosity=4 prefix=catalina_log. suffix=.log timestamp=true/ Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ Host name=localhost debug=0 appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Listener className=org.apache.jk.config.ApacheConfig append=true forwardAll=false modJk=/usr/local/apache/modules/mod_jk2.so / Logger className=org.apache.catalina.logger.FileLogger verbosity=4 directory=logs prefix=localhost. suffix=.log timestamp=true/ /Host /Engine /Service /Server --- If you are not the intended recipient please notify the author by replying to this email. Internet communications are not secure and therefore Red Squared plc does not accept legal responsibility for the contents of this message. Although we operate anti-virus programs, Red Squared does not accept responsibility for any damage that may be caused by viruses being passed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Red Squared. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk Note:__ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been
XML JDBC driver
Hello folks, does anybody here know a good JDBC driver to deal with XML files? Regards, Edson
Re: CGI servlet in tomcat
Tim, Thanks. I followed your instructions but I get the error CGI script not found or not specified. Any idea on what I should do? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best practices - doing code pushes
Thanks for the information. It looks like this is for Tomcat 5. We're using 4. Is there any similar functionality in 4? TIA, -- Sean LeBlanc Software Developer insightamerica Those who do not understand Unix are condemned to reinvent it, poorly. --Henry Spencer -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 10:15 PM To: Tomcat Users List Subject: Re: Best practices - doing code pushes At 03:29 PM 1/7/2004 -0700, you wrote: I have a question about how to load a new application w/o interruption of service. What do others do to remove/reduce service interruption when doing a new code push? I would like to be able to push new code for new Axis services w/o having to kill any service requests currently being serviced, and pick up the new code for any new incoming requests. Is this possible? There's a new pause parameter for the manager deploy servlet which should do what you require... http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html#Deploy%20 A%20New%20Application%20Remotely Jake - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] e-Mail Notice: This communication may contain sensitive information. If you are not the intended recipient, or believe that you have received this communication in error, do not print, copy, retransmit, disseminate, or otherwise use the information contained herein for any purpose. Please alert the sender that you have received this message in error and delete the copy that you received. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connection pool exhausted
Hi All, My tomcat is chucking a connection pool exhausted at me after about 15 minutes of operations on my web application. Here is my resource; Resource name=jdbc/theDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/theDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://server:1433/value /parameter parameter nameusername/name valuesa/value /parameter parameter namepassword/name valuepassword/value /parameter parameter namemaxActive/name value50/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxWait/name value1/value /parameter parameter namevalidationQuery/name valueSELECT 1 + 1/value /parameter parameternamelogAbandoned/namevaluetrue/value/parameter parameternameremoveAbandoned/namevaluetrue/value/parameter /ResourceParams I have checked that all my code have finally blocks to close result sets, connections and statements. I have also checked my SQL server monitors and it shows the connections are all idle. Any starter tips on this problem? Cheers, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CGI servlet in tomcat
See the tomcat-dev and tomcat-user archives. There were some recent patches to CGI Servlet and some discussions about it. I don't rember the specifics. (Since I don't use cgi) Worst case scenario is you'll need to build from CVS or wait for the next release depending on what was in those discussions. -Tim [EMAIL PROTECTED] wrote: Tim, Thanks. I followed your instructions but I get the error CGI script not found or not specified. Any idea on what I should do? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Datasource - OK in app context - Fails in Global context
I have an Oracle JDBC datasource that I defined in the Tomcat5 context for an application (conf/Catalina/localhost/nwg.xml). Works fine, context file listed below. But when I tried to move the datasource to the GlobalNamingResources section of server.xml so that it would be accessible to all apps it gets recognized in the admin console, but not by the application. What gives? I thought a Global resource is supposed to function identically to an application resource. Any help would be greatly welcomed. nwg.xml: Resource auth=Container name=rcfDS type=javax.sql.DataSource/ ResourceParams name=rcfDS parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter namedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value /parameter parameter nameurl/name valuejdbc:oracle:thin:@hostNameHere:portNumberHere:dbNameHere/value /parameter parameter nameusername/name valueusernameHere/value /parameter parameter namepassword/name valueuserpasswordHere/value /parameter parameter namemaxIdle/name value10/value /parameter parameter namemaxActive/name value20/value /parameter parameter namemaxWait/name value-1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namelogAbandoned/name valuetrue/value /parameter /ResourceParams Note: The JDBC driver is ojdbc14.jar and is present in common/lib, the application's WEB-INF/lib and is present also in the JRE's lib/ext for unrelated JAAS reasons. Bruno Melloni eBusiness Application Center, Americas Nokia, Inc 6000 Connection Drive, Mailstop 4w223 Irving, TX 75039 USA *Office: +1 (972)894-6120 *Cellular: +1 (469) 939-1067 * SMS: [EMAIL PROTECTED] * e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IIS + Tomcat 5.0 + NT authentication AUTH_USER
Sorry, don't know where i found this anymore. The jk2 docs are out of date. but its definitely in the source code. some links: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-connectors/jk/native2/server/isapi/isapi_redirector2.reg?rev=1.5hideattic=0view=markup http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-connectors/jk/native2/server/isapi/jk_isapi_plugin.c?rev=1.57view=markup (11 month old) Why not give it a try? Jason Wilson wrote: Hi, I appreciate the info. Could you please point me to the documentation where you found this information, preferably some official documentation on the apache site, perhaps? Thanks, Jason --- Daniel Schmitt [EMAIL PROTECTED] wrote: There is an registry entry [HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\2.0] authComplete=0 which toggles authentication handled by tomcat or iis. just an idea -- Daniel Schmitt http://www.shiftomat.com -- Daniel Schmitt http://www.shiftomat.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Deadlock
The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified and the database to be used (wipt or user) public DatabaseManager(boolean transact, String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Return the dbName being used public String getDBName() { return this.dbName; } // Initialize the data source private void initDataSource(String dbName) throws Exception { try { Context ctx = new InitialContext(); if (ctx == null) throw new Exception(Unable to initialize the WIPT database.); else { if (dbName != null dbName.toLowerCase().equals(user)) { this.dbName = user; this.ds = (DataSource)ctx.lookup(Globals.DB_USER_JNDI_NAME); } else { this.dbName = wipt; this.ds = (DataSource)ctx.lookup(Globals.DB_WIPT_JNDI_NAME); } } } catch (Exception e) { cleanUpDatabase(); throw new Exception(e); } } // Initialize the connection private void initConnection(boolean transact) throws Exception { try { this.conn = this.ds.getConnection(); if (transact) { this.conn.setAutoCommit(false); this.conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
RE: Tomcat Deadlock
First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified and the database to be used (wipt or user) public DatabaseManager(boolean transact, String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Return the dbName being used public String getDBName() { return this.dbName; } // Initialize the data source private void initDataSource(String dbName) throws Exception { try { Context ctx = new InitialContext(); if (ctx == null) throw new Exception(Unable to initialize the WIPT database.); else { if (dbName != null dbName.toLowerCase().equals(user)) { this.dbName = user; this.ds =
RE: Microsoft SQL Server validation query
Oops, I didn't realize those types of queries don't fly on other databases. Thanks for the tip. -Original Message- From: Antonio Fiol Bonnín [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:03 PM To: Tomcat Users List Subject: Re: Microsoft SQL Server validation query Hooper, Brian wrote: These queries all seem like an awful lot of unnecessary processing. Here's what I use: SELECT 1+1 Indeed. If your server supports it, there is an even simpler one: select 1 or select 0. But this is not correct SQL for an Oracle server. Equivalent Oracle syntax is select 1 from dual. But on other servers, dual does not exist by default. Well... you see what I mean... Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How does Tomcat 5.0.16 process the keystoreFile tag?
Greetings! I was usingthe keystoreFile tag successfully with Tomcat 4.1.27. However the same tag does not work as expected with Tomcat 5.0.16. Here's the SSL connector code from server.xml: !-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -- Connector port=443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https secure=true keystoreFile=keys/.keystore keystorePass=password clientAuth=false sslProtocol=TLS / The file .keystore is stored in a directory keys located off $TOMCAT_ROOT$ - i.e. C:\jakarta-tomcat-5.0.16\keys\.keystore. For Tomcat 4.1.27 this location worked with the keystoreFile tag shown above. Now with 5.0.16, I get the error FileNotFoundException. If I remove the keystoreFile tag, then 5.0.16 looks for the .keystore file in C:\Documents and Settings\Richard\.keystore. If I put .keystore there, 5.0.16 works perfectly. So my question is - How does Tomcat 5.0.16 parse the keystoreFile tag? Where is Tomcat 5.0.16 expecting to find a file called keys/.keystore? Thanks in advance, -Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Deadlock
I thought I was by defining the data source (using org.apache.commons.dbcp.BasicDataSourceFactory) in my server.xml file and using JNDI to access it? -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified and the database to be used (wipt or user) public DatabaseManager(boolean transact, String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Return the dbName being used public String getDBName() { return this.dbName; } // Initialize the data source private void initDataSource(String dbName) throws Exception { try { Context ctx = new InitialContext();
RE: Tomcat Deadlock
Take a look at this. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-how to.html Every time you load a page open the connection, then close it to release it to the pool. That way each thread should get 1 connection. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:20 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I thought I was by defining the data source (using org.apache.commons.dbcp.BasicDataSourceFactory) in my server.xml file and using JNDI to access it? -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified and the database to be used (wipt or user) public DatabaseManager(boolean transact, String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); }
Re: java.security.AccessControlException
thuret olivier wrote: no thanks i see my error i'm a noobie .. Have you fixed your problem? -- Jeanfrancois - Original Message - From: thuret olivier [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, January 09, 2004 5:00 PM Subject: java.security.AccessControlException hello, i'm problem with my tomcat 5.0.16. i have a error message when tomcat start with the following message : java.security.AccessControlException: access denied (java.io.FilePermission C:\Tomcat\webapps\V2\WEB-INF\classes\mx4j\tools\naming\NamingService.class read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkRead(Unknown Source) at java.io.File.exists(Unknown Source) at org.apache.naming.resources.FileDirContext.file(FileDirContext.java:873) at org.apache.naming.resources.FileDirContext.lookup(FileDirContext.java:255) at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:334) at org.apache.catalina.loader.WebappClassLoader.findResourceInternal(WebappClas sLoader.java:1726) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLo ader.java:1594) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.jav a:883) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1333) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1213) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at test.maclasse.database.rmi.ReloadCacheEngine.startServerRmi(ReloadCacheEngin e.java:83) at test.maclasse.servlet.Init.init(ClientVersion.java:56) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10 44) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3948) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398) Caused by: java.lang.RuntimeException: access denied (java.util.PropertyPermission catalina.base read) at org.apache.catalina.core.ApplicationContextFacade.doPrivileged(ApplicationCo ntextFacade.java:489) at org.apache.catalina.core.ApplicationContextFacade.log(ApplicationContextFaca de.java:315) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10 81) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 3948) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardHost.start(StandardHost.java:816) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) ... 6 more i modified the catalina.policy (WEB APPLICATION PERMISSIONS) to : grant {
RE: Tomcat and IBM JVM
The solution to the problem was to uncomment the properties found in the jaxp.properties file located in the lib directory of the IBM jre installation -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 8:35 AM To: Tomcat Users List Subject: RE: Tomcat and IBM JVM Howdy, Is this a JAXP 1.1-compatible JVM? Yoav Shapira Millennium ChemInformatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:27 PM To: [EMAIL PROTECTED] Subject: Tomcat and IBM JVM I have been able to run our tomcat installation without any problem on Solaris and Windows. However when I try to run it in AIX I am having the following problem: Apache Tomcat/4.0.4 Exception in thread main javax.xml.parsers.FactoryConfigurationError: Provider null could not be instantiated: java.lang.NullPointerException at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:14 1) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:224) at org.apache.catalina.realm.MemoryRealm.start(MemoryRealm.java:333) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.startup.Embedded.addEngine(Embedded.java:469) at geh.appserver.webserver.WebServerManager.prepareWebServerEngine(WebServ erMa n ager.java:265) at geh.appserver.webserver.WebServerManager.init(WebServerManager.java:7 4) at geh.appserver.webserver.WebServerManager.getInstance(WebServerManager.j ava: 9 2) I suppose I have to change some System property so that it uses a specified XML parser but I do not know which one it is. Any help would be greatly appreciated. Thank You Carlos Javier Rivera Vazquez Staff Engineer GE Power Systems Network Reliability Services 1990 West NASA Blvd Melbourne, FL 32904 __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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 and IBM JVM
Howdy, That's what I thought. Thanks for posting your confirmation. Yoav Shapira Millennium ChemInformatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:24 PM To: [EMAIL PROTECTED] Subject: RE: Tomcat and IBM JVM The solution to the problem was to uncomment the properties found in the jaxp.properties file located in the lib directory of the IBM jre installation -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 8:35 AM To: Tomcat Users List Subject: RE: Tomcat and IBM JVM Howdy, Is this a JAXP 1.1-compatible JVM? Yoav Shapira Millennium ChemInformatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:27 PM To: [EMAIL PROTECTED] Subject: Tomcat and IBM JVM I have been able to run our tomcat installation without any problem on Solaris and Windows. However when I try to run it in AIX I am having the following problem: Apache Tomcat/4.0.4 Exception in thread main javax.xml.parsers.FactoryConfigurationError: Provider null could not be instantiated: java.lang.NullPointerException at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:1 4 1) at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:224) at org.apache.catalina.realm.MemoryRealm.start(MemoryRealm.java:333) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343) at org.apache.catalina.startup.Embedded.addEngine(Embedded.java:469) at geh.appserver.webserver.WebServerManager.prepareWebServerEngine(WebSer v erMa n ager.java:265) at geh.appserver.webserver.WebServerManager.init(WebServerManager.java: 7 4) at geh.appserver.webserver.WebServerManager.getInstance(WebServerManager. j ava: 9 2) I suppose I have to change some System property so that it uses a specified XML parser but I do not know which one it is. Any help would be greatly appreciated. Thank You Carlos Javier Rivera Vazquez Staff Engineer GE Power Systems Network Reliability Services 1990 West NASA Blvd Melbourne, FL 32904 __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - 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] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat 5.0.16 Replication
Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48%
RE: tomcat 5.0.16 Replication
I will be implementing some performance improvements today. I'll let you know how it goes -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 4:33 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48% 88.34% 15 810
RE: tomcat 5.0.16 Replication
useDirtyFlag=true means that session (yes the whole) only gets replicated when setAttribute and removeAttribute is called -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:33 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215
RE: tomcat 5.0.16 Replication
I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215
Re: tomcat 5.0.16 Replication
A... I see. So no way to have only the value which setAttribute was called on to be replicated (yet...) ? Thanks Jean-Philippe Bélanger Filip Hanik wrote: useDirtyFlag=true means that session (yes the whole) only gets replicated when setAttribute and removeAttribute is called -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:33 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait
RE: Tomcat Deadlock
I followed the example for Tomcat 4.x when I set it up. The only reason I have a separate object is to hide some of the complexity. I'm pretty sure it's using a connection pool right now. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:25 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock Take a look at this. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples -how to.html Every time you load a page open the connection, then close it to release it to the pool. That way each thread should get 1 connection. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:20 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I thought I was by defining the data source (using org.apache.commons.dbcp.BasicDataSourceFactory) in my server.xml file and using JNDI to access it? -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified and the database to be used (wipt or user) public DatabaseManager(boolean
Re: tomcat 5.0.16 Replication
The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485
RE: tomcat 5.0.16 Replication
Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was
Tomcat 5.0.16 user configuration
Hello, i have installed the tomcat-server. It is running an i see the index.jsp-default-site. The following part is be placed on the first site. NOTE: For security reasons, using the administration webapp is restricted to users with role admin. The manager webapp is restricted to users with role manager. Users are defined in $CATALINA_HOME/conf/tomcat-users.xml. Ok.. i have to create an user with the roles admin,manager that i have a root for the server. My current text in the tomcat-users.xml-file is --- ?xml version='1.0' encoding='utf-8'? tomcat-users role rolename=tomcat/ role rolename=role1/ role rolename=admin/ role rolename=manager/ user username=tomcat password=tomcat roles=tomcat/ user username=both password=tomcat roles=tomcat,role1/ user username=role1 password=tomcat roles=role1/ user username=michael password=xxXxxXx roles=admin,manager/ /tomcat-users --- Now i restart the server with shutdown.sh and startup.sh. But if i want to login at the index.jsp - site i get an HTTP Status 403 - Access to the requested resource has been denied Error. What can i do? Where is my mistake? Is there always an default-root? I use the binary-installation-files. THX for answers. Greets Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Deadlock
Hrmm... Do you create a new instance of the DatabaseManager class during each load of the page? For some strange, wacky reason I thought you were using it almost as a singleton. If that's not the case then you probably are doing the right thing with that, and I am just talkin fluff. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I followed the example for Tomcat 4.x when I set it up. The only reason I have a separate object is to hide some of the complexity. I'm pretty sure it's using a connection pool right now. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:25 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock Take a look at this. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples -how to.html Every time you load a page open the connection, then close it to release it to the pool. That way each thread should get 1 connection. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:20 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I thought I was by defining the data source (using org.apache.commons.dbcp.BasicDataSourceFactory) in my server.xml file and using JNDI to access it? -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the transaction level to be specified public DatabaseManager(boolean transact) throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { this.dbName = wipt; this.transaction = transact; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the database to be used (wipt or user) public DatabaseManager(String dbName) throws Exception { try { if (dbName != null dbName.toLowerCase().equals(user)) this.dbName = user; else
RE: tomcat 5.0.16 Replication
interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that
RE: Tomcat Deadlock
I do create a new instance, but each instance grabs a connection from the pool instead of making a new connection. I think this is ok. Maybe my problem is with SQL Server locks instead of anything on the tomcat side. It just seems like something on the tomcat side should timeout instead of locking up the server. If I assume that it's a deadlock in SQL Server (and for some reason SQL Server isn't reporting it), can anyone think of a reason why tomcat would not respond? The connection pool still has connections available. It could be that tomcat isn't really hanging. I have a filter set up that checks to see if the user is authenticated, so the database is hit before every page request. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:59 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock Hrmm... Do you create a new instance of the DatabaseManager class during each load of the page? For some strange, wacky reason I thought you were using it almost as a singleton. If that's not the case then you probably are doing the right thing with that, and I am just talkin fluff. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I followed the example for Tomcat 4.x when I set it up. The only reason I have a separate object is to hide some of the complexity. I'm pretty sure it's using a connection pool right now. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:25 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock Take a look at this. http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples -how to.html Every time you load a page open the connection, then close it to release it to the pool. That way each thread should get 1 connection. -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:20 PM To: Tomcat Users List Subject: RE: Tomcat Deadlock I thought I was by defining the data source (using org.apache.commons.dbcp.BasicDataSourceFactory) in my server.xml file and using JNDI to access it? -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:50 PM To: 'Tomcat Users List' Subject: RE: Tomcat Deadlock First off, if you have the option you might try using a database pool instead of using 1 connection for multiple threads (As in Tomcat). At one company I worked for we had some problems with using 1 connection. Data would be read/written incorrectly. Results from one query would be returned to another etc. Bad driver...probably, but it's still a safer and better use of resources to let Tomcat give you a connection from a pool and then release it back when you are done. -Steve -Original Message- From: Hooper, Brian [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:46 AM To: Tomcat Users List Subject: RE: Tomcat Deadlock The code itself is pretty long. Maybe it would be better if I explain how I handle database connectivity (which I'm guessing has some flaws), and I know I should be encapsulating my queries in EJB's, but for now I just have a lot of inline SQL in my Actions. I use a DatabaseManager class (at the end of the e-mail) to connect to my database. If an action needs to connect, it makes a new DatabaseManager object. It uses the methods in the class, then at the end it calls a function to clean up the connection, etc. Here is the code for the database manager class: package WIPT; import java.sql.*; import javax.sql.*; import java.util.*; import java.lang.*; import java.io.*; import javax.naming.*; public class DatabaseManager { // Data Members // Keep track of the current database in use for transactions private String dbName; // The data source private DataSource ds; // The connection private Connection conn; // The statement private Statement stmt; // The prepared statement private PreparedStatement pstmt; // The callable statement (for stored procedures) private CallableStatement cstmt; // If transactions are being used or not private boolean transaction; // Empty constructor public DatabaseManager() throws Exception { // Initialize the database objects to null initially nullObjects(); // Initialize the database objects to their real values try { // Default the database to WIPT and not to use transactions this.dbName = wipt; this.transaction = false; initDataSource(this.dbName); initConnection(this.transaction); } catch (Exception e) { cleanUpDatabase(); throw new Exception(Unable to initialize the WIPT database); } } // Overloaded constructor to allow the
RE: tomcat 5.0.16 Replication
sun JDK 1.4.2 for Linux Kernel 2.4.20-8smp Tomcat 5.0.16 with catalina-cluster.jar from CVS head Hrmmmare yours SMP servers? Could be something odd with synch if that is the case. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:01 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you
Tomcat JProfiler
I setup JProfiler to run on my tomcat and I am running into 2 issues I was hoping someone else has also had. 1. I am passing the JProfiler parameters through my JAVA_OPTS in Catelina.sh and when I also try to set my heap size and/or garbage collection parameters tomcat doesn't seem to start. It works fine with one or the other. 2. If I shutdown tomcat the Jprofiler process will not shutdown unless I manually kill it. Thanks in advance, Rob
problem connecting Apache2 and Tomcat 5 via mod_jk2
I followed suggestion from an email on this list and got the latest tomcat-jk2.jar so that timcat had the needed org.apache.jk.config.ApacheConfig implementation. The problem I am having now is thet mod_jk.conf file that is auto generated by tomcat does not seem to be correct. I have read in many places that the module it tries to load jk_module needs to be renamed to jk2_module. However this cannot be done in the same file since it is regenerated each time tomcat starts. Should I not add this line to the httpd.conf file in apache: Include /usr/local/tomcat/conf/auto/mod_jk.conf also... if i do switch the LoadModule command to jk2_module, it then bombs on the JkMount command. Is this build of tomcat not creating a useable mod_jk.conf ? should I ignore this .conf file and simply add all the needed entries to the httpd.conf. If so, is there a document outlining all the needed entries here in order to properly mount different servlet zones so apache can contact tomcat when needed ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk2 doesn't create jk2.socket
I think I've discovered the real source of the problem but I don't understand how to fix it. Here is the output form catalina.out: Exception during startup processing java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203) Caused by: java.lang.UnsatisfiedLinkError: getJkEnv at org.apache.jk.apr.AprImpl.getJkEnv(Native Method) at org.apache.jk.common.JniHandler.initNative(JniHandler.java:132) at org.apache.jk.common.ChannelUn.init(ChannelUn.java:114) at org.apache.jk.server.JkMain.start(JkMain.java:354) at org.apache.jk.server.JkCoyoteHandler.start(JkCoyoteHandler.java:171) at org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:1180) at org.apache.catalina.core.StandardService.start(StandardService.java:506) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2190) at org.apache.catalina.startup.Catalina.start(Catalina.java:512) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) ... 5 more I would appreciate any help I could get on this. Thanks, -Mark
RE: Tomcat JProfiler
Howdy, 1. I am passing the JProfiler parameters through my JAVA_OPTS in Catelina.sh and when I also try to set my heap size and/or garbage collection parameters tomcat doesn't seem to start. It works fine with one or the other. There are some invalid combinations of the Java VM Options. I don't think there's an exhaustive list, but the VM will give you an error (Could Not Initialize Virtual Machine or something like that). This is not a tomcat problem. 2. If I shutdown tomcat the Jprofiler process will not shutdown unless I manually kill it. Again, not a tomcat problem. Contact the JProfiler folks if you think the above is an issue. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
StringIndexOutOfBoundsException on SetDocBaseRule - 5.0
Ok, something that should be in the docs here under docBase is that you can no longer have an empty string like you could in tomcat 4. I had to put a docBase=. to make it work in 5 or else you get this: SEVERE: Begin event threw exception java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1444) at java.lang.String.substring(String.java:1411) at org.apache.catalina.startup.SetDocBaseRule.begin(SetDocBaseRule.java:196) at org.apache.commons.digester.Rule.begin(Rule.java:200) at org.apache.commons.digester.Digester.startElement(Digester.java:1273) at org.apache.catalina.util.CatalinaDigester.startElement(CatalinaDigester.java:112) at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat 5.0.16 Replication
uname -a reports: 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux Filip Hanik wrote: interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back to the beginning. I've put traces and this is executed once every millisecond hence the 100% load on the server. Just to make sure, I've put a Thread.sleep(10) at the end of the loop and the CPU dropped back to 0% and the replication still worked nicely but probably a little slower since the wait of 10ms. I don't know much about those NIO packages but seams like the select(timeout) method shouldn't return a SelectorKey of that state. with any waiting. Let me know what you can dig from those. Jean-Philippe Bélanger [EMAIL PROTECTED] wrote: Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with
RE: Tomcat JProfiler
To make JProfiler work properly with tomcat you need to add agent.jar in tomcat´s CLASSPATH! #TOMCAT_HOME/bin/startup.sh JAVA_OPTS=-Xint -Xrunjprofiler:${PARAM_JPROFILER} -Xbootclasspath/a:/opt/jakarta-tomcat-4.1.18/bin/agent.jar export JAVA_OPTS -- De: Shapira, Yoav[SMTP:[EMAIL PROTECTED] Responder:Tomcat Users List Enviada: sexta-feira, 9 de janeiro de 2004 16:21 Para: Tomcat Users List Assunto: RE: Tomcat JProfiler Howdy, 1. I am passing the JProfiler parameters through my JAVA_OPTS in Catelina.sh and when I also try to set my heap size and/or garbage collection parameters tomcat doesn't seem to start. It works fine with one or the other. There are some invalid combinations of the Java VM Options. I don't think there's an exhaustive list, but the VM will give you an error (Could Not Initialize Virtual Machine or something like that). This is not a tomcat problem. 2. If I shutdown tomcat the Jprofiler process will not shutdown unless I manually kill it. Again, not a tomcat problem. Contact the JProfiler folks if you think the above is an issue. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat 5.0.16 Replication
[EMAIL PROTECTED] bin]# uname -a Linux rh9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux [EMAIL PROTECTED] bin]# java -version java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:05 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication sun JDK 1.4.2 for Linux Kernel 2.4.20-8smp Tomcat 5.0.16 with catalina-cluster.jar from CVS head Hrmmmare yours SMP servers? Could be something odd with synch if that is the case. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:01 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can figure it out when I get back to where I can diff the files. -Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:25 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication More content for you Filip. I've checked and followed the code of the listen event in ReplicationListener.java Here's what happening: selector.select(timeout) - return immediatly with one SelectorKey available That key is not Acceptable and not Readable so it immediatly skip those IFs and loops back
RE: tomcat 5.0.16 Replication
uname -a machine #1) Linux draco 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux machine #2) Linux scorpio 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux java -version: java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) same on both -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:56 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication [EMAIL PROTECTED] bin]# uname -a Linux rh9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux [EMAIL PROTECTED] bin]# java -version java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:05 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication sun JDK 1.4.2 for Linux Kernel 2.4.20-8smp Tomcat 5.0.16 with catalina-cluster.jar from CVS head Hrmmmare yours SMP servers? Could be something odd with synch if that is the case. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:01 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were actually experiencing crashes though. To verify your results I just put a Thread.Sleep(1); where you suggested and I also see the jump in performance. Something must have changed in ReplicationListener that causes this because the 5.0.16 version doesn't seem to have the problem. I'll see if I can
RE: tomcat 5.0.16 Replication
Hrmmm, perhaps I should reboot using the non-SMP kernel and try it. I'll have to do that when I get back to the servers. -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 2:04 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication uname -a machine #1) Linux draco 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux machine #2) Linux scorpio 2.4.20-8smp #1 SMP Thu Mar 13 17:45:54 EST 2003 i686 i686 i386 GNU/Linux java -version: java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) same on both -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:56 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication [EMAIL PROTECTED] bin]# uname -a Linux rh9 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux [EMAIL PROTECTED] bin]# java -version java version 1.4.2_03 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02) Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode) -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:05 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication sun JDK 1.4.2 for Linux Kernel 2.4.20-8smp Tomcat 5.0.16 with catalina-cluster.jar from CVS head Hrmmmare yours SMP servers? Could be something odd with synch if that is the case. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 1:01 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication interesting, mine doesn't work at all unless I set the LD_ASSUME_KERNEL what VM (version and name) are you using? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 10:59 AM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Now that's really very strange. I am running RH9 and everything seems to go through just fine. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:56 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The replication message ACK never get back to the sender. So my webpages never loads without that flag. I think it is only needed under REDHAT 9. Jean-Philippe Bélanger Steve Nelson wrote: I don't seem to need the ld_assume_kernel thing. What are the symptoms when it is required? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 12:33 PM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication Just tried the CVS head and everything works with any CPU going crazy! only if ld_assume_kernel is set to 2.4 One more question for you Filip, is the useDirtyFlag working at all? It seams like even if it's set to true, the whole session gets replicated after each request. :( Jean-Philippe [EMAIL PROTECTED] wrote: Hurray for Fillip! :) I'll get the CVS head for the module today and test this out. Happy to see that it got fixed that quickly! Thanks again and I'll let you know how it goes Jean-Philippe Filip Hanik wrote: Jean-Philippe and Steve, I fixed the bug, and tried replication on RH9. Immediately it didn't work. The problem is that when RH9 tries to write the ACK back to the NIO socket, it never reaches the other node. and times out after a long time. I set LD_ASSUME_KERNEL=2.4 and it started to work Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 6:43 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication ok guys, good news. The 100% cpu is totally my fault. I messed up on that one. I was registering OP_WRITE as an interest this is not good :) checking in the working code in 15 min, some more regression tests Filip -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:54 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication another code change was, that I am now accepting keys for OP_READ and OP_WRITE. before it was only OP_READ, but for synchronous replication I need both. this is good info, I just got RH9 installed. will be trying it out this and next week. Filip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:46 AM To: Tomcat Users List Subject: Re: tomcat 5.0.16 Replication The only changes in the ReplicationListener class is the try catch that was added. the code logic is the same. Weird enough. So it's probably elsewhere that something changed in the state of the SelectionKey. Jean-Philippe Bélanger Steve Nelson wrote: I was just about to try this actually. I found through googling alot of people having problems with select with 1.4 and NIO with Redhat 9. They were