Re: Help! Config of multiple hosts and JVM garbage.
Sergio wrote: Hi All! Guys, I need help! My system is Windows 2003 Enterprise Server with Apache 2.0.48 I need Windows for 3rd part application, but because I hate IIS so I am using Apache2(the best!!!). 1)Does somebody can help me with configuration of Tomcat 5.0.18 for multiple hosts? I need to deploy servlets separately for each user. Access will be configured in httpd.conf of Apache2.0.48 Some people uses multiples instances of Tomcat for each user. Somebody uses one instance of Jboss with various deployed folders (its actually my configuration now). But I need to do that trick with Tomcat. The biggest problem for me now - its to configure server.xml for two or more hosts. I cant find it in documentation. If you can help with with any tips and/or your examples of httpd.conf, workers.prop..s etc. (all related parts of configuration of the servers) - please help. I have never set up VirtualHosts in Tomcat. But if you do not need to have a root app, you do not need to (or at list I did not need to). Just mount the apps you need in the Apache VirtualHosts you need, and you are done. 2) How I can configure memory management for Tomcat (limits for memory using for each process/application)? Is it possible somehow? Not possible when using a single JVM. If you use multiple instances of Tomcat, you can set -Xmx256m (or whatever amount you need) in JAVA_OPTS environment variable. That will effectively limit the amount of memory used by your heap. 3) I have a problem with garbage of JVM caching. Any suggestions how I can organize autocleaning? How can I minimize the usage of the disk in this case? What do you mean by disk usage? How is that related do autocleaning, which I understand as garbage collection? Do you mean swapping? If so, ensure that your JVM is at most as big as your free _real_ memory. Otherwise, your OS qill start swapping unused bits. Then, the GC will reclaim them for collection. So, you are accessing the disk at least twice for something you could have avoided. (Side note: Get more RAM ;-) In any case, profiling your applications is a good way to go: you willl determine whether your app grows in memory usage with time, or if it remains constant. (Consider the former a bug.) If memory usage remains constant, you can stress your app, and determine how much memory it needs for full load, and then you may allow it (JAVA_OPTS) no more than that, knowing it will work. Yours, Antonio Fiol smime.p7s Description: S/MIME Cryptographic Signature
Configuring a Default Servlet
Hi, I want to have all incomming request forwarded to a default servlet. Depending on the URL the request is forwarded to a JSP-page (too dynamic to use apache mod_rewrite). The problem is that if I define the servlet as: servlet-mapping servlet-namecustom/servlet-name url-pattern/*/url-pattern /servlet-mapping It will work, but when I do getDispatcher(MyPage.jsp).forward(request,response), it will forward to the servlet in a recursive way. Is there any way to get a hold of a JSP-dispatcher when forwarding a request in order to do this? Best Regards, Stefan Görling - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
java startup option trouble
Hello List... I have a requirement to startup java with a -noverify option. I've put this is /etc/profile as a JAVA_OPTS value. My probem is on system startup, Tomcat starts ok but the classes that need the -noverify parameter don't work until I login as root, shutdown Tomcat then start it up again. It seems that the profile is not read until I've logged in (as root). If that's the case, how can I set it up so the -noverify parameter is the default when java loads? Tomcat 4.1.27 on Redhat 8.0 Thanks for any assistance. /j-p.
so many servlets
Hi I have a large project on Tomcat 4.1 standalone. Its servlets (about 100) are in four packages and all in one jar. My problem is trivial I'm sure but I cannot locate a solution. Do I need to specify all the servlets individually? Or can I just do something like servlet servlet-name*/servlet-name ie all the servlets in the lib-located jar of package package1 servlet-classpackage1/*/servlet-class /servlet servlet-mapping whatever I'm really just trying to avoid typing out this trivial info over and over. I have a gadget that generates this tag-pair list from a jar, but it is ugly. Thanks Geoff -- Geoffrey Jenkins (Dr) +61414 939523 [EMAIL PROTECTED] thestrix.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Repost] Tomcat logging
On 02/09/2004 07:51 AM Marcel Stor wrote: explains the new context descriptors. I still don't quite get it. It says ...which would normally be found in the main server configuration file Well, does this mean I can (have to?) remove all my context descriptions from server.xml and place them into individual files? Or do I need both? Or?? You only ever have one context description per app, and it can be in server.xml or in a seperate file. What really concerns me: Each of my contexts has a FileLogger and a AccessLogValve defined. Hoever, at startup only the valve log is created. With TC4 each context's FileLogger log was created and contained entries saying that the context had successfully been loaded etc. Why is the log not created anymore? Also, one app uses the standard Java logging framework. All the log entries end up in catalina.out instead of the app's own context log. How to resolve this? What are you using to log? The java.utils.logging framework will log to anywhere you define in its configuration. By default, as a file java0.log in the tomcat user's home directory. I'm not sure what tomcat does with its FileLoggers and catalina.out. Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Loads Deleted Context?
Remy Maucherat wrote: What I recommend with TC 5 is put your context declarations in /META-INF/context.xml, and use the manager to manage your webapps. If using external contexts, then it's the similar: either use the manager webapp or drop your context file in the right subdir of conf (and use the manager to undeploy). I've been playing with tomcat and the new way of doing things isn't all bad. In some ways its nice to have one file per context. Certainly its nice not having to restart tomcat for context changes. I still believe there is something to be said for everything in one place but for now I don't think this scheme is so bad as I did a few days ago. Could've been documented better but Yoav has addressed that to some degree. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Java(TM) Boutique - The Power of Three - Eclipse, Tomcat, and Struts
This is a really good article about how to integrate tomcat with eclipse (using the sysdeo plugin), as well as some struts information. I found it helpful, and I hope you do, too: http://javaboutique.internet.com/tutorials/three/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Repost] Tomcat logging
Adam Hardy mailto:[EMAIL PROTECTED] wrote: On 02/09/2004 07:51 AM Marcel Stor wrote: explains the new context descriptors. I still don't quite get it. It says ...which would normally be found in the main server configuration file Well, does this mean I can (have to?) remove all my context descriptions from server.xml and place them into individual files? Or do I need both? Or?? You only ever have one context description per app, and it can be in server.xml or in a seperate file. Ok, got that. What really concerns me: Each of my contexts has a FileLogger and a AccessLogValve defined. Hoever, at startup only the valve log is created. With TC4 each context's FileLogger log was created and contained entries saying that the context had successfully been loaded etc. Why is the log not created anymore? Also, one app uses the standard Java logging framework. All the log entries end up in catalina.out instead of the app's own context log. How to resolve this? What are you using to log? The java.utils.logging framework will log to anywhere you define in its configuration. By default, as a file java0.log in the tomcat user's home directory. I know. And if the app is started one would have to a runtime parameter to define the corresponding properties file with all the logging configuration... However, if the Sun framework is used withing a webapp that uses a FileLogger (as defined in the context) I would expect that logging messages end up in the context's log and not in catalina.out??? Regards, Marcel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: TC 5 production use
Yoav Shapira wrote: Howdy, I'm using it in production, no issues. But then again I steer clear of the practices that tend to cause issues frequently: I don't redeploy my apps in production (when I ship a new version I do so during our maintenance window and restart the server), I profile and test carefully for memory leaks, I don't use apache in front of tomcat, I do use a security manager, I do deploy and run only packed WARs, nothing reloadable or auto-deployed... Hello, one question: What tool do you (or anyone else) use for profiling? Thanks B. Burkhart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Excel Mime problem
Hi Pavan, maybe the thing I've done for a style sheet can help you. The style sheet is a JSP file with the ending .jsp. And in it I'm specifying [EMAIL PROTECTED] contentType=text/css % so I can refer to it from any web page by link rel=stylesheet type=text/css href=/path/to/style.jsp because the browser is getting the content type text/css. Maybe you can do sth similar when creating the Excel. Or, otherwise, just put the excel somewhere accessible and redirect the browser there from a servlet or JSP. Regards B. Burkhart [EMAIL PROTECTED] To: [EMAIL PROTECTED] 02/07/2004 11:03 cc: AM Subject: RE: Excel Mime problem Please respond to tomcat-user i did that also..but invain... Pavan Kumar Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com Allistair Crossley [EMAIL PROTECTED] To Tomcat Users List 02/06/2004 07:07 AM [EMAIL PROTECTED] cc Please respond to Tomcat Users List Subject [EMAIL PROTECTED] RE: Excel Mime problem add this to the tomcat_home/conf/web.xml file mime-mapping extensionxls/extension mime-typeapplication/msexcel/mime-type /mime-mapping this is why I asked about your URL .. you are using tomcat as a web server and web servers normally handle mime types -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 11:46 To: Tomcat Users List Subject: RE: Excel Mime problem i see the excel being created.. i can open the same excel from where it is created.. there is no question abt the file creation bcoz i can see the contents in IE but not as a excel opening in IE.. http://localhost:8000/test.xls i use window.open(http://localhost:8000/test.xls;); this opens the excel contents in the browser juss like a text file ..i mean no excel embedded in that.. but i copy the created excel to another folder and i create a html page haviong simple code of window,open(test.xls) then it IE opens the same contents as a Excel embedded within IE Pavan Kumar Tata Consultancy Services Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com 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] ForwardSourceID:NT519E (See attached file: InterScan_Disclaimer.txt) -
Tomcat w Java1.5 beta problem
Hello, Under Tomcat 5.0.18 with servlets compiled with 1.5 beta, I get an odd message, and the servlet won't load. When the same servlet is compiled with 1.4.2 it runs fine. The method signature in the following message is correct. There is simple nothing to complain about. Is this a problem with Tomcat or Java sdk1.5. Where is the best place to report this to? No, I have not altertered my common/endorsed jars 2004-02-09 12:00:13 StandardContext[/midp]Servlet /midp threw load() exception ... - Root Cause - java.lang.VerifyError: (class: com/koyuru/midp/servlets/LessonDownload, method: compareAvailableToOnHandset signature: (Ljava/util/Vector;Ljava/util/Vector;)[Ljava/lang/String;) Incompatible object argument for function call at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:1873) at java.lang.Class.getConstructor0(Class.java:2185) at java.lang.Class.newInstance0(Class.java:293) at java.lang.Class.newInstance(Class.java:275) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1002) Shawn Happily using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Configure some variables in an external file
Hello, I have a problem with tomcat 5. As we had used tomcat 4 with windows we could define some variables (e.g. DB Connection, connection pool, etc.) in an external file. We create an service called tomcat and write the path to this external file as an property of this service. But in Tomcat 5, tomcat ignores this property and it don't work. How could I give Tomcat this variable maybe in another way? Kind regards Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuring a Default Servlet
The defualt servlet is mapped by the following: SRV.11.2 Specification of Mappings A string containing only the / character indicates the default servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null. So you really want: url-pattern//url-pattern Also that same section states the /* has higher precendence than *.extension -Tim Stefan Grling wrote: Hi, I want to have all incomming request forwarded to a default servlet. Depending on the URL the request is forwarded to a JSP-page (too dynamic to use apache mod_rewrite). The problem is that if I define the servlet as: servlet-mapping servlet-namecustom/servlet-name url-pattern/*/url-pattern /servlet-mapping It will work, but when I do getDispatcher(MyPage.jsp).forward(request,response), it will forward to the servlet in a recursive way. Is there any way to get a hold of a JSP-dispatcher when forwarding a request in order to do this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Service and Classpath
Hi, I have a legacy set of classes (Orbix2000) that read configuration from the classpath. The classpath works fine for /webapps/axis/WEB-INF/classes/emapi.cfg, but it refuses to open licenses.txt. I have managed to get it working by changing setclasspath.bat to include the path of the licenses.txt which works fine when run from startup.bat, but when Tomcat is run as a service, it's not picking up the file. I am really frustrated, any help is appreciated. (PS I have changed the service.bat to include -classpath to the java parameters, but that didn't work either). Thanks in advance, Andi ** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: so many servlets
You could use the invoker. But in reality - with that many servlets all the servlets better be named in a coherent/standard manner. From there - a text editor with regular expressions to create many of the mappings from a file listing should do the trick. (Beyond the scope of this list) (Otherwise, happy typing) -Tim geoffj wrote: Hi I have a large project on Tomcat 4.1 standalone. Its servlets (about 100) are in four packages and all in one jar. My problem is trivial I'm sure but I cannot locate a solution. Do I need to specify all the servlets individually? Or can I just do something like servlet servlet-name*/servlet-name ie all the servlets in the lib-located jar of package package1 servlet-classpackage1/*/servlet-class /servlet servlet-mapping whatever I'm really just trying to avoid typing out this trivial info over and over. I have a gadget that generates this tag-pair list from a jar, but it is ugly. Thanks Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat 5.0.16 running out of resources
set your JAVA_OPTS accordingly to your needs in your startup.* If you need 750 Mbytes, try this : set JAVA_OPTS=-server -Xms750m -Xmx750m -XX:NewRatio=2 -Message d'origine- De : Jake Alley [mailto:[EMAIL PROTECTED] Envoyé : dimanche 8 février 2004 15:23 À : [EMAIL PROTECTED] Objet : tomcat 5.0.16 running out of resources Hi, I'm running Tomcat 5.0.16 and I'm getting the following error peiiodically: The system is out of resources. Consult the following stack trace for details. java.lang.OutOfMemoryError It happens when certain jsp forms are compiled. Is there a way to increase the amount of system resources? Sometimes the server just stops working and leaves no log traces as well. Could these be related? This is with code that worked fine in version 4. Thanks. _ Optimize your Internet experience to the max with the new MSN Premium Internet Software. http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/ - 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]
Deployment through Ant causes loss of session-control
When I deploy a WAR-file through Ant, I lose cookie-session-control in IE and Mozilla, but not Opera!!! I have looked at a lot of stuff and finally come to the conclusion, that if I deploy the exact same file with the tomcat-manager interface at e.g. http://localhost:8080//manager/html/, session-control is perfect, because suddenly the sessions-id is fixed and request.isRequestedSessionIdFromCookie() returns true. The context-elements for the two ways to deploy the WAR are *nearly* identical in the two cases, because in the failing case docBase and path contains a space: Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 docBase=C:\Program Files\Apache Group\Tomcat\4.1.29\webapps\Something XXX mapperClass=org.apache.catalina.core.StandardContextMapper path=/Something XXX privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper /Context Since my stripped down test-WAR is Something.war, it does not happen with a manual deploy through the manager. If I remove XXX from the two instances of Something XXX, then session-control is operational!!! I have no idea why Opera differs from IE and Mozilla. I have not seen, what Tomcat returns in its HTTP-replies, but opera sends in its second request a cookie - JSESSIONID Name:JSESSIONID Value: 6BED2E22402090337A37B624CB6BDF3A Domain: null Path:null Comment: null Version: 0 Maximum age: -1 - with no domain, path or anything. This thing with spaces in docBase/path and loss of session-control - is this a known problem? It is quite natural to put spaces in there. Regards, Morten Sabroe Mortensen - property name=external.tomcat.catalina.classpath.dir value=${krapyl.lib.dir}/Tomcat/4.1.29/Catalina / property name=external.tomcat.catalina.classpath value=${external.tomcat.catalina.classpath.dir}/catalina-ant.jar / target name=external.tomcat.catalina.init taskdef name=tomcat-deploy classname=org.apache.catalina.ant.DeployTask classpath=${external.tomcat.catalina.classpath} / ... /target target name=external.tomcat.catalina.deploy depends= external.tomcat.catalina.init, build tomcat-deploy url=${external.tomcat.manager.URL} username=${external.tomcat.manager.username} password=${external.tomcat.manager.password} path=${external.tomcat.app.path} war=${external.tomcat.WAR.file.URL}/ echoDeployed ${external.tomcat.app.path}./echo /target - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Deployment through Ant causes loss of session-control
By the way - the effect is identical with both TC 4.1.29 and 5.0.18. Regards, Morten Sabroe Mortensen -Original Message- From: Morten S. Mortensen Sent: 9. februar 2004 13:06 To: [EMAIL PROTECTED] Subject: Deployment through Ant causes loss of session-control When I deploy a WAR-file through Ant, I lose cookie-session-control in IE and Mozilla, but not Opera!!! I have looked at a lot of stuff and finally come to the conclusion, that if I deploy the exact same file with the tomcat-manager interface at e.g. http://localhost:8080//manager/html/, session-control is perfect, because suddenly the sessions-id is fixed and request.isRequestedSessionIdFromCookie() returns true. The context-elements for the two ways to deploy the WAR are *nearly* identical in the two cases, because in the failing case docBase and path contains a space: Context className=org.apache.catalina.core.StandardContext cachingAllowed=true charsetMapperClass=org.apache.catalina.util.CharsetMapper cookies=true crossContext=false debug=0 docBase=C:\Program Files\Apache Group\Tomcat\4.1.29\webapps\Something XXX mapperClass=org.apache.catalina.core.StandardContextMapper path=/Something XXX privileged=false reloadable=false swallowOutput=false useNaming=true wrapperClass=org.apache.catalina.core.StandardWrapper /Context Since my stripped down test-WAR is Something.war, it does not happen with a manual deploy through the manager. If I remove XXX from the two instances of Something XXX, then session-control is operational!!! I have no idea why Opera differs from IE and Mozilla. I have not seen, what Tomcat returns in its HTTP-replies, but opera sends in its second request a cookie - JSESSIONID Name:JSESSIONID Value: 6BED2E22402090337A37B624CB6BDF3A Domain: null Path:null Comment: null Version: 0 Maximum age: -1 - with no domain, path or anything. This thing with spaces in docBase/path and loss of session-control - is this a known problem? It is quite natural to put spaces in there. Regards, Morten Sabroe Mortensen - property name=external.tomcat.catalina.classpath.dir value=${krapyl.lib.dir}/Tomcat/4.1.29/Catalina / property name=external.tomcat.catalina.classpath value=${external.tomcat.catalina.classpath.dir}/catalina-ant.jar / target name=external.tomcat.catalina.init taskdef name=tomcat-deploy classname=org.apache.catalina.ant.DeployTask classpath=${external.tomcat.catalina.classpath} / ... /target target name=external.tomcat.catalina.deploy depends= external.tomcat.catalina.init, build tomcat-deploy url=${external.tomcat.manager.URL} username=${external.tomcat.manager.username} password=${external.tomcat.manager.password} path=${external.tomcat.app.path} war=${external.tomcat.WAR.file.URL}/ echoDeployed ${external.tomcat.app.path}./echo /target - - 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 5.0.18 with connector to IIS?
We build an jk2 installer you can get at http://www.shiftomat.com/opensource/ It uses the latest binary from Apache (Sep. build) and is tested with IIS 6. (tested means here the example pages are working) Richard Norman wrote: The one on the Apache site has NEVER worked for me except the origional Connector. Search the list for the ISAPI Connecter 2 and you will find several notes on this. I have a IIS6 server running with the connector compiled by someone else and it works, the only problem is that the Connector virtual directory can not be in a seperate appdomain, but that is the only limitation I have found so far. Let me know if more info or help is needed. Also if the connector binary for download from Apache works nowm someone please correct me. I have never gotten it to work for me. Sincerely, Richard Norman Web/Application Developer Web Site: http://www.Jazzynupe.net/ Web Site: http://Jazzynupe.no-ip.com/ Original Message Follows From: Allistair Crossley [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: Tomcat 5.0.18 with connector to IIS? Date: Fri, 6 Feb 2004 14:07:48 - MIME-Version: 1.0 Received: from mail.apache.org ([208.185.179.12]) by mc12-f11.hotmail.com with Microsoft SMTPSVC(5.0.2195.6824); Fri, 6 Feb 2004 06:09:46 -0800 Received: (qmail 54652 invoked by uid 500); 6 Feb 2004 14:07:49 - Received: (qmail 54449 invoked from network); 6 Feb 2004 14:07:48 - Received: from unknown (HELO mail3.qas.com) (195.172.82.234) by daedalus.apache.org with SMTP; 6 Feb 2004 14:07:48 - Received: from orion.qas.com (orion.qas.com [150.150.100.34]) by mail3.qas.com (Content Technologies SMTPRS 4.3.12) with ESMTP id [EMAIL PROTECTED]; Fri, 6 Feb 2004 14:07:48 + X-Message-Info: JGTYoYF78jF/uBGXt/cy0UmA/uI3Uq64 Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 content-class: urn:content-classes:message Message-ID: [EMAIL PROTECTED] X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Tomcat 5.0.18 with connector to IIS? Thread-Index: AcPss7sjHbt4eeqyReunmewN4ahUfgABs7SQ X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 06 Feb 2004 14:09:46.0694 (UTC) FILETIME=[E0411660:01C3ECBA] Yes. Use the JK2 connector available on the download index. -Original Message- From: Andrzej Jan Taramina [mailto:[EMAIL PROTECTED] Sent: 06 February 2004 13:20 To: [EMAIL PROTECTED] Subject: Tomcat 5.0.18 with connector to IIS? Has anyone got Tomcat 5.0.18 front-ended with IIS using a connector? If so, which connector/version are you using. Any config info and hints on how to set this up (the docs on connectors are pretty confusing sometimes) would be very much appreciated. Please copy responses to [EMAIL PROTECTED] if you could. Many thanks! Andrzej Jan Taramina Chaeron Corporation: Enterprise System Solutions http://www.chaeron.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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] _ Create your own personal Web page with the info you use most, at My MSN. http://click.atdmt.com/AVE/go/onm00200364ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Daniel Schmitt http://www.shiftomat.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Open native console application from servlet (java.net.SocketException: Connection reset by peer: socket write error)
Hi all, We have a servlet based application which open a native console application and read samo output from them. Sometimes we get an error in tomcat logfile but application work ok. What is happen? Here is error. What is mean? 2004-02-09 10:02:26 StandardWrapperValve[default]: Servlet.service() for servlet default threw exception java.net.SocketException: Connection reset by peer: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.d oWrite(InternalOutputBuffer.java:668) at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOu tputFilter.java:160) at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuff er.java:523) at org.apache.coyote.Response.doWrite(Response.java:524) at org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(OutputBuffer.java: 384) at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:439) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:359) at org.apache.coyote.tomcat4.OutputBuffer.writeBytes(OutputBuffer.java:411) at org.apache.coyote.tomcat4.OutputBuffer.write(OutputBuffer.java:398) at org.apache.coyote.tomcat4.CoyoteOutputStream.write(CoyoteOutputStream.ja va:110) at org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.jav a:1996) at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:174 5) at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet .java:1073) at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:50 6) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:59 4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:56 5) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:619) at java.lang.Thread.run(Thread.java:536)
Re: Configuring a Default Servlet
Dear Tim and others, Thank you for the reference. And now for the little twist which I forgot to mention: Before we introduced the default servlet we had urls with normal .jsp:s. We want to run those through the custom dispatcher as well in order to redirect to the proper url For example: A request to: /Foo.jsp - Permanent redirect to /foo/bar A request to: /foo/bar -- Internal forward to www/Foo.jsp A request to /Bar.jsp --Internal forward to www/Bar.jsp The problem is to say that all requests, including .jsp-files in the root should be handled by the Servlet, but _not_ .jsp-files residing in /www/ The following won't work: (neither with /www nor with /www/*) servlet-mapping servlet-namejsp/servlet-name url-pattern/www*/url-pattern /servlet-mapping servlet-mapping servlet-namecustom/servlet-name url-pattern//url-pattern /servlet-mapping As the getRequestDispatcher(/www/Foo.jsp).forward(request,response), creates a loop. So: Is it possible to: a) configure web.xml in a proper way b) get a JSP-dispatcher, like getJSPRequestDispatcher(/www/Foo.jsp).forward(request,response) (tomcat specific typecasting is ok). c) Rewrite the incoming RequestURI in a proper way? I've written code for : 1. in apache using mod_rewrite to change all url:s so that they begin with /custom/foo/bar, 2. In the Servlet, wrap the request by extending the HttpServletRequestWrapper and overriding getRequestURI() so that /custom is removed. This however gave a problem when trying to do a response.redirect to a relative URL, as tomcat used an internal representation of the Request object to retrieve the path information when converting the relative path to an aboslute one, hence giving back a /custom/foo/bar url. I can wrap the HttpServletResponse too to fix the redirect object, but I have no idea when the same problem will appear somewhere else. Best Regards, Stefan Grling The defualt servlet is mapped by the following: SRV.11.2 Specification of Mappings A string containing only the / character indicates the default servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null. So you really want: url-pattern//url-pattern Also that same section states the /* has higher precendence than *.extension -Tim Stefan Grling wrote: Hi, I want to have all incomming request forwarded to a default servlet. Depending on the URL the request is forwarded to a JSP-page (too dynamic to use apache mod_rewrite). The problem is that if I define the servlet as: servlet-mapping servlet-namecustom/servlet-name url-pattern/*/url-pattern /servlet-mapping It will work, but when I do getDispatcher(MyPage.jsp).forward(request,response), it will forward to the servlet in a recursive way. Is there any way to get a hold of a JSP-dispatcher when forwarding a request in order to do this? - 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 w Java1.5 beta problem
Shawn wrote: Under Tomcat 5.0.18 with servlets compiled with 1.5 beta, I get an odd message, and the servlet won't load. When the same servlet is compiled with 1.4.2 it runs fine. I have tried compiling with: javac -source 1.5 -target 1.4 ... ? I get the complaint from both IDEs I use because of the fact that the collections have changed, in order to support generics. I haven't tried running my JDK1.5 classes under jdk1.4.2 yet, as I am still trying to get all of my unit tests to pass. g -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuring a Default Servlet
Use filters. They only get applied on the incoming request. In the filter - you can place the logic to perform the extra logic you need or not. -Tim Stefan Grling wrote: Dear Tim and others, Thank you for the reference. And now for the little twist which I forgot to mention: Before we introduced the default servlet we had urls with normal .jsp:s. We want to run those through the custom dispatcher as well in order to redirect to the proper url For example: A request to: /Foo.jsp - Permanent redirect to /foo/bar A request to: /foo/bar -- Internal forward to www/Foo.jsp A request to /Bar.jsp --Internal forward to www/Bar.jsp The problem is to say that all requests, including .jsp-files in the root should be handled by the Servlet, but _not_ .jsp-files residing in /www/ The following won't work: (neither with /www nor with /www/*) servlet-mapping servlet-namejsp/servlet-name url-pattern/www*/url-pattern /servlet-mapping servlet-mapping servlet-namecustom/servlet-name url-pattern//url-pattern /servlet-mapping As the getRequestDispatcher(/www/Foo.jsp).forward(request,response), creates a loop. So: Is it possible to: a) configure web.xml in a proper way b) get a JSP-dispatcher, like getJSPRequestDispatcher(/www/Foo.jsp).forward(request,response) (tomcat specific typecasting is ok). c) Rewrite the incoming RequestURI in a proper way? I've written code for : 1. in apache using mod_rewrite to change all url:s so that they begin with /custom/foo/bar, 2. In the Servlet, wrap the request by extending the HttpServletRequestWrapper and overriding getRequestURI() so that /custom is removed. This however gave a problem when trying to do a response.redirect to a relative URL, as tomcat used an internal representation of the Request object to retrieve the path information when converting the relative path to an aboslute one, hence giving back a /custom/foo/bar url. I can wrap the HttpServletResponse too to fix the redirect object, but I have no idea when the same problem will appear somewhere else. Best Regards, Stefan Grling The defualt servlet is mapped by the following: SRV.11.2 Specification of Mappings A string containing only the / character indicates the default servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null. So you really want: url-pattern//url-pattern Also that same section states the /* has higher precendence than *.extension -Tim Stefan Grling wrote: Hi, I want to have all incomming request forwarded to a default servlet. Depending on the URL the request is forwarded to a JSP-page (too dynamic to use apache mod_rewrite). The problem is that if I define the servlet as: servlet-mapping servlet-namecustom/servlet-name url-pattern/*/url-pattern /servlet-mapping It will work, but when I do getDispatcher(MyPage.jsp).forward(request,response), it will forward to the servlet in a recursive way. Is there any way to get a hold of a JSP-dispatcher when forwarding a request in order to do this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
environment variables
Hi , I'm using TomCat + Axis. I have a web service implementation that is composed of: * the main function in the SoapBindingImpl file ; * JNI interface ; * a set of C/C++ API's. The main function calls the methods in the JNI interface and the latter calls some API methods. I have to set/unset some environment variables in the API methods using the C setenv/unsetenv functions. The values of these variables have to be different for each service-request process. There is a problem when I have several service-request processes running at the same time. These processes share the same environment: so when one of them modifies the value of a variable, all processes are involved in this change and see the new value. Could someone please tell me whether there is a possibility to separate the environment of every service process, in order to allow each one of them to handle only its own variable values? Thanks Regards Marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: so many servlets
While you can use the invoker, other engines don't have an equivalent. If portability is at all important, you need to explicitly name them out. -Original Message- From: geoffj [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:56 AM To: [EMAIL PROTECTED] Subject: so many servlets Hi I have a large project on Tomcat 4.1 standalone. Its servlets (about 100) are in four packages and all in one jar. My problem is trivial I'm sure but I cannot locate a solution. Do I need to specify all the servlets individually? Or can I just do something like servlet servlet-name*/servlet-name ie all the servlets in the lib-located jar of package package1 servlet-classpackage1/*/servlet-class /servlet servlet-mapping whatever I'm really just trying to avoid typing out this trivial info over and over. I have a gadget that generates this tag-pair list from a jar, but it is ugly. Thanks Geoff -- Geoffrey Jenkins (Dr) +61414 939523 [EMAIL PROTECTED] thestrix.net - 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: java startup option trouble
Howdy, If you define JAVA_OPTS in $CATALINA_HOME/bin/catalina.sh they'll always be used. Yoav Shapira Millennium ChemInformatics -Original Message- From: John-Paul Delaney [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 2:24 AM To: Tomcat Users List Subject: java startup option trouble Hello List... I have a requirement to startup java with a -noverify option. I've put this is /etc/profile as a JAVA_OPTS value. My probem is on system startup, Tomcat starts ok but the classes that need the -noverify parameter don't work until I login as root, shutdown Tomcat then start it up again. It seems that the profile is not read until I've logged in (as root). If that's the case, how can I set it up so the -noverify parameter is the default when java loads? Tomcat 4.1.27 on Redhat 8.0 Thanks for any assistance. /j-p. 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: TC 5 production use
Howdy, I see. Do you have a large internal user base then? It doesn't sound like a classic production use server if you're not even using the standard ports. Other people have already replied as to why the above assumption is invalid. We have other things (portals mostly, but also some hardware) that do things in front of our app servers. Our users do not type in port numbers, from the browser's URL it all appears as port 80. Because of the reasons others mentioned (server admin security concerns mostly, however unjustified), I think this is a fairly common scenario. 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: root context loaded again under its docbase name
Howdy, and this is my context (which is found in META-INF/context.xml): Context path= docBase=gargantus.war cachingAllowed=false reloadable=false Anybody else with the same setup see this? Bug or not bug? snip/ Seems like a bug. What happens if you don't have context.xml at all in your WAR, and simply drop the WAR in the webapps directory? 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: [Repost] Tomcat logging
On 02/09/2004 10:07 AM Marcel Stor wrote: What are you using to log? The java.utils.logging framework will log to anywhere you define in its configuration. By default, as a file java0.log in the tomcat user's home directory. I know. And if the app is started one would have to a runtime parameter to define the corresponding properties file with all the logging configuration... However, if the Sun framework is used withing a webapp that uses a FileLogger (as defined in the context) I would expect that logging messages end up in the context's log and not in catalina.out??? I'm afraid it's a black hole for me too as far as info is concerned. I know how to set up and run log4j or java.util.logging so I can write log statements, control the logging levels etc. I also know how to configure log4j, java.util.logging and tomcat5 to create log files, rotatable or not or max size etc. I just don't know how the input and output are linked by tomcat. If at all. It just hasn't climbed far enough up my list of priorities to warrant looking into it further. I suspect that it's got something to do with org.apache.commons.logging, but that is just a wild hunch. Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Logs Missing
Guys, my Tomcat 5.0.18 does not create either of the following catalina.out stdout.txt stderr.txt It does create localhost_webapp_date logs which are specified in my Context My own log4j logging is fine also. Any ideas why Tomcat is not logging the others? I remember 5.0.16 was ok 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 w Java1.5 beta problem
Howdy, Under Tomcat 5.0.18 with servlets compiled with 1.5 beta, I get an odd message, and the servlet won't load. When the same servlet is compiled with 1.4.2 it runs fine. I suggest rebuilding tomcat with 1.5 beta if you want to run servlets compiled using 1.5 beta. I'm not even sure my suggestion will work, as I haven't tried it myself. There has not been a tomcat release declared to support JDK 1.5 yet, although you're welcome to do building and testing for us ;) 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 Loads Deleted Context?
Howdy, Is META-INF/context.xml a standard way to provide a default context in a war? Or is it tomcat specific? It is tomcat-specific. 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 Logs Missing
Allistair Crossley wrote: Guys, my Tomcat 5.0.18 does not create either of the following catalina.out stdout.txt stderr.txt It does create localhost_webapp_date logs which are specified in my Context My own log4j logging is fine also. Any ideas why Tomcat is not logging the others? I remember 5.0.16 was ok Is this supposed to mean: the .exe wrapper does not create the files mentioned above (those are not generated by Tomcat, since this is merely redirected shell output and looging statements ending up there in the default configuration) ? -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat w Java1.5 beta problem
Shapira, Yoav wrote: Howdy, Under Tomcat 5.0.18 with servlets compiled with 1.5 beta, I get an odd message, and the servlet won't load. When the same servlet is compiled with 1.4.2 it runs fine. I suggest rebuilding tomcat with 1.5 beta if you want to run servlets compiled using 1.5 beta. I'm not even sure my suggestion will work, as I haven't tried it myself. There has not been a tomcat release declared to support JDK 1.5 yet, although you're welcome to do building and testing for us ;) There's a small glitch: j-t-c/util wants to be compiled JDK 1.1 compatible, which apparently the new compiler cannot do anymore. So you'll have to hack the build script a bit for now. Tomcat runs very well on JDK 1.5 (and you should be able to enable all the fancy JMX remote features). Testing has shown it was about 10% faster, and used a little less memory (5% less) for the out of the box Tomcat. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CLASSPATH
I still can't figure this out: when I run TC from startup.bat, the app picks up licenses.txt which is in the CLASSPATH. When I run the service, it ignores it. I have added -Djava.class.path=c:\jakarta-tomcat-5.0.18\common\classes to the service installer but no luck. (BTW, butting it into /WEB-INF/classes doesn't work either). Thanks, Andi OH, PS, When I run the app using SimpleAxisServer everything works fine because the PATH and CLASSPATH are in tact. Thanks, Andi ** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat w Java1.5 beta problem
Howdy, Testing has shown it was about 10% faster, and used a little less memory (5% less) for the out of the box Tomcat. Cool ;) Can't wait to test it myself, but (actual, $$$) work will be very busy this week ;) 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 Logs Missing
No, my 5.0.18 installation is not using the Windows .exe wrapper I use startup.bat. In previous versions of Tomcat these logs have always been generated in {tomcathome}/logs. I was just wondering where they had gone - i don't especially need them. thanks -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED] Sent: 09 February 2004 14:12 To: Tomcat Users List Subject: Re: Tomcat Logs Missing Allistair Crossley wrote: Guys, my Tomcat 5.0.18 does not create either of the following catalina.out stdout.txt stderr.txt It does create localhost_webapp_date logs which are specified in my Context My own log4j logging is fine also. Any ideas why Tomcat is not logging the others? I remember 5.0.16 was ok Is this supposed to mean: the .exe wrapper does not create the files mentioned above (those are not generated by Tomcat, since this is merely redirected shell output and looging statements ending up there in the default configuration) ? -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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]
Stealing the Writer (Was: Re: Configuring a Default Servlet)
Dear Tim, Thanks!, Filters works great to solve this problem. Here's another stupid thing I want to do. I want to measure the performance, by wrapping every request buy another filter (or similiar): public void doFilter(ServletRequest request, ServletResponse, response, FilterChain chain) throws IOException, ServletException { ServletOutputStream out=response.getOutputStream(); out.println(!-- request started --) chain.doFilter(request,response); out.println(!-- This is the end of the request, it took foo seconds--); } The page is delivered properly, but the debug output is not returned. If i remove chain.doFitlter, the text is printed properly. Anyone who has an idea on how to Steal a working writer to add some debug data at the end (start is not really necessary)? /Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stealing the Writer (Was: Re: Configuring a Default Servlet)
Howdy, Why pollute the response with data about its performance? I think that data is better placed in a log file (and then you filter approach will work fine). For example, http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html. But if you really want to put it in the response itself, I'm not sure why you're not seeing your output, unless somewhere down the chain an error occurs or something closes the output stream. Yoav Shapira Millennium ChemInformatics -Original Message- From: Stefan Görling [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 9:46 AM To: Tomcat Users List Subject: Stealing the Writer (Was: Re: Configuring a Default Servlet) Dear Tim, Thanks!, Filters works great to solve this problem. Here's another stupid thing I want to do. I want to measure the performance, by wrapping every request buy another filter (or similiar): public void doFilter(ServletRequest request, ServletResponse, response, FilterChain chain) throws IOException, ServletException { ServletOutputStream out=response.getOutputStream(); out.println(!-- request started --) chain.doFilter(request,response); out.println(!-- This is the end of the request, it took foo seconds--); } The page is delivered properly, but the debug output is not returned. If i remove chain.doFitlter, the text is printed properly. Anyone who has an idea on how to Steal a working writer to add some debug data at the end (start is not really necessary)? /Stefan - 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: Stealing the Writer (Was: Re: Configuring a Default Servlet)
-Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 8:56 AM To: Tomcat Users List Subject: RE: Stealing the Writer (Was: Re: Configuring a Default Servlet) Howdy, Why pollute the response with data about its performance? I think that data is better placed in a log file (and then you filter approach will work fine). I've seen lots of php-based sites that have a footer This page took 0.5 seconds to build. It always occurs to me: Why would anyone except a geek care about this? :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: TC 5 production use
Only for port redirection you don't need to buy any hardware. If you are running tomcat inside a linux box, you can configure iptables to do the port redirection. Everything via software, no hardware. Vitor David Wall wrote: We run Tomcat on 8080 using Cisco Routers for port redirection. Nobody has to type in a port number. Well, I agree that would work for everyone who just buys some hardware to give the illusion of using port 80. Of course, running tomcat on port 80 itself would be nice if anybody knows if/whether JSVC can mimick the -security argument of catalina.sh. And the best part is that we're happy to know that some more heavily used production sites are using TC 5, which was the original question and interest! David - 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: Stealing the Writer (Was: Re: Configuring a Default Servlet)
Marketing cares about that kinds of stuff too. ;) -Tim Mike Curwen wrote: -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 8:56 AM To: Tomcat Users List Subject: RE: Stealing the Writer (Was: Re: Configuring a Default Servlet) Howdy, Why pollute the response with data about its performance? I think that data is better placed in a log file (and then you filter approach will work fine). I've seen lots of php-based sites that have a footer This page took 0.5 seconds to build. It always occurs to me: Why would anyone except a geek care about this? :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: TC 5 production use -- iptables to make it work without root
Only for port redirection you don't need to buy any hardware. If you are running tomcat inside a linux box, you can configure iptables to do the port redirection. Everything via software, no hardware. Vitor You are absolutely correct. In fact, I've abandoned JSVC precisely because I can do this. This is great because not only do you need the extra JSVC, but you don't need to start as root at all. For example, here are the iptables rules I use under RH 9 to effect what Vitor is saying: (If you're using the /etc/rc.d/init.d/iptables script, this is the control file for it -- of course, you could do this manually by simply putting the command 'iptables' in front of these lines and assuming that your INPUT chain jumps to the YOZONS-BPN-INPUT ) -A YOZONS-BPN-INPUT -p tcp -m tcp --dport 80 --tcp-flags SYN,RST,ACK SYN -j ACCEPT -A YOZONS-BPN-INPUT -p tcp -m tcp --dport 443 --tcp-flags SYN,RST,ACK SYN -j ACCEPT -A YOZONS-BPN-INPUT -p tcp -m tcp --dport 8080 --tcp-flags SYN,RST,ACK SYN -j ACCEPT -A YOZONS-BPN-INPUT -p tcp -m tcp --dport 8443 --tcp-flags SYN,RST,ACK SYN -j ACCEPT The above lines are assuming you block all access to your system except for what you let in. This allows the INPUT packets to come in on the standard ports of 80 and 443 (only 443 if you need HTTPS) as well as the tomcat ports of 8080 and 8443. Then, using the NAT commands (on iptables table -t nat) to do port redirecting: -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443 -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 This maps the production ports to the tomcat listening ports. In your tomcat server.xml file, continue to use the 8080/8443 Connector ports, and if you need 8080 to redirect to SSL, I'd suggest you redirect to 443 (the standard port). You could have it redirect to 8443, but then the 8443 will appear in all your URLs and if your visitors have an egress firewall, they likely won't be able to reach your system, so it looks like: Connector port=8080 maxThreads=20 minSpareThreads=10 maxSpareThreads=10 enableLookups=false redirectPort=443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true maxPostSize=1 / Good luck, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Loads Deleted Context?
Shapira, Yoav ha scritto: Howdy, Is META-INF/context.xml a standard way to provide a default context in a war? Or is it tomcat specific? It is tomcat-specific. 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] But where is documented? How it run? How is possible change a context during the life of Tomcat? Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Loads Deleted Context?
Hi, But where is documented? How it run? How is possible change a context during the life of Tomcat? http://jakarta.apache.org/tomcat/tomcat-5.0-doc/deployer-howto.html http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/host.html#Automat ic%20Application%20Deployment http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/context.html http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html#Deplo y%20A%20New%20Application%20Remotely http://jakarta.apache.org/tomcat/faq/deployment.html 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]
Couldn't find private key in this file
Hi, everyone: Greetings! I have a problem in configure SSL in tomcat 4.1. I generated the private key by type: keytool -genkey -alias devglobustomcat -keyalg RSA -validity 800 -keystore cacerts The keystore - cacerts is in /usr/java/j2sdk1.4.1_01/jre/lib/security. I type keytool -list -keystore cacerts and see the entry: devglobustomcat, Feb 6, 2004, keyEntry, Certificate fingerprint (MD5): 87:C7:A6:A6:FA:F1:15:14:56:60:1A:C7:90:CA:B0:17 It seems the private key is in the keystore. I use the default password for keystore. Then I configured the server.xml like: Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8443 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 clientAuth=false keystoreFile=/usr/java/j2sdk1.4.1_01/jre/lib/security/cacerts protocol=TLS / /Connector But when I started tomcat by type ./startup.sh and got an error: [main] ERROR http11.Http11Protocol - Error initializing endpoint java.io.IOException: Couldn't find private key in this file at org.apache.tomcat.util.net.puretls.PureTLSSocketFactory.init(PureTLSSocketFactory.java:175) at org.apache.tomcat.util.net.puretls.PureTLSSocketFactory.createSocket(PureTLSSocketFactory.java:104) at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:275) at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:150) at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.java:1117) at org.apache.catalina.core.StandardService.initialize(StandardService.java:579) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:2246) at org.apache.catalina.startup.Catalina.start(Catalina.java:511) at org.apache.catalina.startup.Catalina.execute(Catalina.java:400) at org.apache.catalina.startup.Catalina.process(Catalina.java:180) 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) I am confused because the key is there! If I comment the port 8443 in server.xml, everything will be fine. Did I miss something to config ssl? I read the doc and didn't find it. By the way, the key was generated as root. Starting tomcat is as another user. The permission for carcerts is -r--r--r--. Thanks in advance! Jing -- Jing Tao National Center for Ecological Analysis and Synthesis (NCEAS) 735 State St. Suite 204 Santa Barbara, CA 93101 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: TC 5 production use -- iptables to make it work without root
I'm curious, why don't you use Apache and JK connector? Evgeny Gesin --- David Wall [EMAIL PROTECTED] wrote: You are absolutely correct. In fact, I've abandoned JSVC precisely because I can do this. This is great because not only do you need the extra JSVC, but you don't need to start as root at all. For example, here are the iptables rules I use under RH 9 to effect what Vitor is saying: (If you're using the /etc/rc.d/init.d/iptables script, this is the control file for it -- of course, you could do this manually by simply putting the command 'iptables' in front of these lines and assuming that your INPUT chain jumps to the YOZONS-BPN-INPUT ) -A YOZONS-BPN-INPUT -p tcp -m tcp --dport 80 --tcp-flags SYN,RST,ACK SYN -j ACCEPT -A YOZONS-BPN-INPUT -p tcp -m tcp --dport 443 --tcp-flags SYN,RST,ACK SYN -j ACCEPT -A YOZONS-BPN-INPUT -p tcp -m tcp --dport 8080 --tcp-flags SYN,RST,ACK SYN -j ACCEPT -A YOZONS-BPN-INPUT -p tcp -m tcp --dport 8443 --tcp-flags SYN,RST,ACK SYN -j ACCEPT The above lines are assuming you block all access to your system except for what you let in. This allows the INPUT packets to come in on the standard ports of 80 and 443 (only 443 if you need HTTPS) as well as the tomcat ports of 8080 and 8443. Then, using the NAT commands (on iptables table -t nat) to do port redirecting: -A PREROUTING -p tcp -m tcp --dport 443 -j REDIRECT --to-ports 8443 -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080 This maps the production ports to the tomcat listening ports. In your tomcat server.xml file, continue to use the 8080/8443 Connector ports, and if you need 8080 to redirect to SSL, I'd suggest you redirect to 443 (the standard port). You could have it redirect to 8443, but then the 8443 will appear in all your URLs and if your visitors have an egress firewall, they likely won't be able to reach your system, so it looks like: Connector port=8080 maxThreads=20 minSpareThreads=10 maxSpareThreads=10 enableLookups=false redirectPort=443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true maxPostSize=1 / Good luck, David __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Servlet thread safety in omcat
Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Servlet thread safety in Tomcat
Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Install Tomcat without (most of) the JSDK ?
I have seen it implied that Tomcat really only needs tools.jar from the J-SDK to be able to compile JSP's. However, if you try to run the Tomcat installer without having the J-SDK installed, it complains and exits. I've also found that if you just use the .zip install, the Tomcat startup script still looks for the J-SDK. Is it possible somehow to install Tomcat without the J-SDK present and then drop in tools.jar? I am looking for the minimum I need to install on a fresh Windows PC to be able to run Tomcat and my webapps (which have JSP's) (Not counting pre-compiling the JSP's) Thanks, Mike Kellstrand
Re: TC 5 production use -- iptables to make it work without root
I'm curious, why don't you use Apache and JK connector? Evgeny Gesin We currently do, but we're creating a new simpler version for smaller offices and corporate departmental computing. The fewer running parts the better, and the fewer things that need to be patched going forward, the easier to troubleshoot, etc.. Apache has lots of capabilities that are not in Tomcat, and some believe that doing SSL in Apache, even with the added overhead of the JK, is more efficient. It's even nice when Apache runs on a front-end web server connected to the Internet and Tomcat runs on a backend app server that's not directly connected to the Internet. However, if Tomcat does everything you need, it's a good platform. By running it as a normal user, the idea of starting/stopping as 'root' and having to deal with Apache's security issues (nothing bad, but every component connected is another component that can be exploited) makes things simpler for our end customers. There's nothing wrong with Apache+JK in my opinion. David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet thread safety in Tomcat
Howdy, State your specific requirements and we can help you design servlets/objects that will meet those requirements. Your original post is too broad to solicit a detailed response. Yoav Shapira Millennium ChemInformatics -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - 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: Servlet thread safety in Tomcat
The app is simply meant to grab some mails from a pop server and simply display it using Java Mail. I realise part of my mistake is using global variables ,unsynchronized collections and unsynchronized code blocks.I am not using the single thread model. My initial thought ( :-) forgive me its some time since I have coded servlets) was that Tomcat will create a new servlet instance that is totally independed of the other, for each request.On testing the app on two client machines I have realized that the data is corrupted all mixed up and my velocity template is throwing an error caused by concurrent modification. My question is there some way of making this app thread safe and also how does Tomcat actually many requests , in terms of the threading method used?I am using Tomcat 4.1 Shapira, Yoav wrote: Howdy, State your specific requirements and we can help you design servlets/objects that will meet those requirements. Your original post is too broad to solicit a detailed response. Yoav Shapira Millennium ChemInformatics -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - 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: Servlet thread safety in Tomcat
The one thing that could be said (so far), is to ensure you are using properly scoped variables. Generally speaking, for servlets, that means don't use something like the following: public class myservlet extends HttpServlet { private String MyBadlyPlacedVariable = null; public void doGet() { // exceptions and parameters snipped for brevity MyBadlyPlacedVariable = request.getParameter(some_variable_used_later); // later on in the code, use MyBadlyPlacedVariable... // it probably contains a value you're not expecting! } } You'll for sure experince threading problems, and this is the most likely cause of any class of problems that's generically described as: the data is actualy mixing up. -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - 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: Servlet thread safety in Tomcat
Howdy, My initial thought ( :-) forgive me its some time since I have coded servlets) was that Tomcat will create a new servlet instance that is totally independed of the other, for each request. Tomcat will not create a new instance of a servlet for every request to that servlet. Tomcat will create one instance on startup if the servlet is defined in web.xml as such (a load-on-startup tag present). Tomcat may create more instances as needed to serve the request load. 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: [Fwd: Catalina suspends for no reason?!?]
Hey, Catalina.sh shutdown connects to the shutdown port (8005 by default) and tells the server to shut down. Tomcat shuts down all its parts, and that includes destroying servlets, filters, listeners as mandated by the servlet specification. But tomcat does not call, for example, System.exit(), as that would break applications that embed tomcat. The JVM automatically shuts down daemon threads. Catalina hung again this morning, but specifically, after I shut down my netscape browser, with the Java Console open, with Ctrl-C. Im starting to realise that this is probably what is going on, the JVM is struggling to handle different threads, especially non-daemon threads, am I right? So basically, I iknow this is off-topic for a tomcat-users page, but if I wanted to track down all the threads that are opened within the JVM at any one time, and the nature of the threads (ie Daemon etc.) and where they come from etc. can I do this? I can then find out which are the threads that could be causing Catalina to hang...possibly.. Cheers S My second question as follows, what exactly do you mean by 'my application or 3rd party libraries it uses'? Are you saying that if I use some external jars in my web applications WEB-INF/lib/ directory, then I have to make sure their use is discontinued, seperately from catalina.sh?? IF they create non-daemon threads, and they provide shutdown methods, you have to call these methods. If they create daemon threads, or call their own shutdown methods (via finalizers for example), you don't need to worry about it. Same goes for your own code. Lastly, it seems as if making sure all threads are started as daemons is the best way to go but I dont know how to do that? If you're starting the thread yourself, call setDaemon(true) on it. If it's a 3rd party library, see above. 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet thread safety in Tomcat
My initial thought ( :-) forgive me its some time since I have coded servlets) was that Tomcat will create a new servlet instance that is totally independed of the other, for each request. Tomcat will not create a new instance of a servlet for every request to that servlet. Tomcat will create one instance on startup if the servlet is defined in web.xml as such (a load-on-startup tag present). Tomcat may create more instances as needed to serve the request load. But how does Tomcat log the sessions variables PER request then? Is the session object independent of the servlet object, and is there one session object PER request? Cheers S 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet thread safety in Tomcat
Your primary mistake seems to be in assuming that Tomcat will create a new instance of a servlet for every thread started. This is not what happens, therefore servlet instance variables are not thread safe unless you take additional actions to make them safe. Likewise, application global entities, such as singletons, won't be thread safe without taking additional actions on your part. The short rule is simply if two threads might access this data concurrently, then you need to protect yourself from such a collision. About the only thing that is mostly thread safe are objects whose scope is limited to a single method, but even these can get you in trouble if you put references to those objects in global locations (such as an application wide cache). --- kwirirai [EMAIL PROTECTED] wrote: The app is simply meant to grab some mails from a pop server and simply display it using Java Mail. I realise part of my mistake is using global variables ,unsynchronized collections and unsynchronized code blocks.I am not using the single thread model. My initial thought ( :-) forgive me its some time since I have coded servlets) was that Tomcat will create a new servlet instance that is totally independed of the other, for each request.On testing the app on two client machines I have realized that the data is corrupted all mixed up and my velocity template is throwing an error caused by concurrent modification. My question is there some way of making this app thread safe and also how does Tomcat actually many requests , in terms of the threading method used?I am using Tomcat 4.1 Shapira, Yoav wrote: Howdy, State your specific requirements and we can help you design servlets/objects that will meet those requirements. Your original post is too broad to solicit a detailed response. Yoav Shapira Millennium ChemInformatics -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - 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] __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Fwd: Catalina suspends for no reason?!?]
Howdy, So basically, I iknow this is off-topic for a tomcat-users page, but if I wanted to track down all the threads that are opened within the JVM at any one time, and the nature of the threads (ie Daemon etc.) and where they come from etc. can I do this? Sure. If you send a SIGQUIT to the JVM at any point, including when it appears hung, you will get a listing on your screen (or wherever you have stdout directed) of all the currently running JVM threads and what they're doing. I don't think that screen tells you if a given thread is a daemon. Alternatively, you can produce this information programmatically. I've posted code to the list in the past that does this (I think it was called SystemThreadList or something like that). It's a simple recursive approach: // Find root threadgroup Thread thisThread = Thread.currentThread(); ThreadGroup tg = thisThread.getThreadGroup(); while(tg.getParent() != null) { tg = tg.getParent(); } // Get all threads int estimate = 2 * tg.activeCount(); Thread[] allThreads = new Thread[estimate]; tg.enumerate(allThreads); Now you list all threads, check daemon status, check the class (in case it's a specific subclass extending Thread that you're looking for), etc. 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: Servlet thread safety in Tomcat
Thanks ,It realy means I have to redesign the whole app ,but there is the issue of networking and Java Mail, it seems the other servlet has to wait for a very long time for the other servlet to get all the mail.My question is can Tomcat process two sessions of a servlet downloading mail at the same time sopposing the other session is slow.Will the one with a faster connection finish first or will have to wait for the one with slow connection...? Mike Curwen wrote: The one thing that could be said (so far), is to ensure you are using properly scoped variables. Generally speaking, for servlets, that means don't use something like the following: public class myservlet extends HttpServlet { private String MyBadlyPlacedVariable = null; public void doGet() { // exceptions and parameters snipped for brevity MyBadlyPlacedVariable = request.getParameter(some_variable_used_later); // later on in the code, use MyBadlyPlacedVariable... // it probably contains a value you're not expecting! } } You'll for sure experince threading problems, and this is the most likely cause of any class of problems that's generically described as: the data is actualy mixing up. -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - 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: Servlet thread safety in Tomcat
Howdy, But how does Tomcat log the sessions variables PER request then? Is the session object independent of the servlet object, and is there one session object PER request? The session object is independent of the servlet object. There is NOT one session per request (unless the user's session happens to consist of a single request, but that's an unusual border case). I suggest you read the Servlet Specification to see how sessions are defined and managed by the container. If you feel like looking at the relevant tomcat source, ManagerBase is a decent place to start, here: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/s hare/org/apache/catalina/session/ and look for classes in the code that use the Manager interface, call createSession(), etc. 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: Servlet thread safety in Tomcat
Howdy, Thanks ,It realy means I have to redesign the whole app ,but there is the issue of networking and Java Mail, it seems the other servlet has to wait for a very long time for the other servlet to get all the mail.My question is can Tomcat process two sessions of a servlet downloading mail at the same time sopposing the other session is slow.Will the one with a faster connection finish first or will have to wait for the one with slow connection...? This is specific to your app. What code are you executing to download mail? Please also be sure you're not confusion a JavaMail session with a Servlet session. The two are entirely different, despite sharing the name session. In general, it is undesirable for one servlet to wait for another. That's too high a degree of coupling. 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: Servlet thread safety in Tomcat
snipet for (int i = msgCount; i =stopPoint; i--) { m = folder.getMessage(i); //get the message } This actually hapening when one session is downloading suppose 300 emails, and the other lets say 50.This suppose ,what I am actually doing is I have two machines , I first logon one machine and immediatly i log on to the other.( to simulate simultanous process). I do understand about Servlet sessions and Javamail sessions. I was actualy thinking ,somehow there should be better way.. Shapira, Yoav wrote: Howdy, Thanks ,It realy means I have to redesign the whole app ,but there is the issue of networking and Java Mail, it seems the other servlet has to wait for a very long time for the other servlet to get all the mail.My question is can Tomcat process two sessions of a servlet downloading mail at the same time sopposing the other session is slow.Will the one with a faster connection finish first or will have to wait for the one with slow connection...? This is specific to your app. What code are you executing to download mail? Please also be sure you're not confusion a JavaMail session with a Servlet session. The two are entirely different, despite sharing the name session. In general, it is undesirable for one servlet to wait for another. That's too high a degree of coupling. 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: Servlet thread safety in Tomcat
But if I am to synchronise my code blocks won't that slow done the application, or is there a mode that you can put Tomcat into so that it will create a new instance servlet thread with its own variables and execution space and stuff like that .Because I was thinking putting all those synchronized blocks will slow down the app. David Ramsey wrote: Your primary mistake seems to be in assuming that Tomcat will create a new instance of a servlet for every thread started. This is not what happens, therefore servlet instance variables are not thread safe unless you take additional actions to make them safe. Likewise, application global entities, such as singletons, won't be thread safe without taking additional actions on your part. The short rule is simply if two threads might access this data concurrently, then you need to protect yourself from such a collision. About the only thing that is mostly thread safe are objects whose scope is limited to a single method, but even these can get you in trouble if you put references to those objects in global locations (such as an application wide cache). --- kwirirai [EMAIL PROTECTED] wrote: The app is simply meant to grab some mails from a pop server and simply display it using Java Mail. I realise part of my mistake is using global variables ,unsynchronized collections and unsynchronized code blocks.I am not using the single thread model. My initial thought ( :-) forgive me its some time since I have coded servlets) was that Tomcat will create a new servlet instance that is totally independed of the other, for each request.On testing the app on two client machines I have realized that the data is corrupted all mixed up and my velocity template is throwing an error caused by concurrent modification. My question is there some way of making this app thread safe and also how does Tomcat actually many requests , in terms of the threading method used?I am using Tomcat 4.1 Shapira, Yoav wrote: Howdy, State your specific requirements and we can help you design servlets/objects that will meet those requirements. Your original post is too broad to solicit a detailed response. Yoav Shapira Millennium ChemInformatics -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - 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] __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet thread safety in Tomcat
Howdy, But if I am to synchronise my code blocks won't that slow done the application, or is there a mode that you can put Tomcat into so that it will create a new instance servlet thread with its own variables and execution space and stuff like that .Because I was thinking putting all those synchronized blocks will slow down the app. Seeing as how adding a synchronized block is easy, why don't you test it? You might find that the performance is satisfactory ;) 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: Servlet thread safety in Tomcat
If you implement the SingleThreadModel interface for your Servlet class, TomCat will create a new instance for each request. Albert -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 2:12 PM To: Tomcat Users List Subject: Re: Servlet thread safety in Tomcat But if I am to synchronise my code blocks won't that slow done the application, or is there a mode that you can put Tomcat into so that it will create a new instance servlet thread with its own variables and execution space and stuff like that .Because I was thinking putting all those synchronized blocks will slow down the app. David Ramsey wrote: Your primary mistake seems to be in assuming that Tomcat will create a new instance of a servlet for every thread started. This is not what happens, therefore servlet instance variables are not thread safe unless you take additional actions to make them safe. Likewise, application global entities, such as singletons, won't be thread safe without taking additional actions on your part. The short rule is simply if two threads might access this data concurrently, then you need to protect yourself from such a collision. About the only thing that is mostly thread safe are objects whose scope is limited to a single method, but even these can get you in trouble if you put references to those objects in global locations (such as an application wide cache). --- kwirirai [EMAIL PROTECTED] wrote: The app is simply meant to grab some mails from a pop server and simply display it using Java Mail. I realise part of my mistake is using global variables ,unsynchronized collections and unsynchronized code blocks.I am not using the single thread model. My initial thought ( :-) forgive me its some time since I have coded servlets) was that Tomcat will create a new servlet instance that is totally independed of the other, for each request.On testing the app on two client machines I have realized that the data is corrupted all mixed up and my velocity template is throwing an error caused by concurrent modification. My question is there some way of making this app thread safe and also how does Tomcat actually many requests , in terms of the threading method used?I am using Tomcat 4.1 Shapira, Yoav wrote: Howdy, State your specific requirements and we can help you design servlets/objects that will meet those requirements. Your original post is too broad to solicit a detailed response. Yoav Shapira Millennium ChemInformatics -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - 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] __ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html - 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 w Java1.5 beta problem
I get the complaint from both IDEs I use because of the fact that the collections have changed, in order to support generics. I haven't tried running my JDK1.5 classes under jdk1.4.2 yet, as I am still trying to get all of my unit tests to pass. g Oh, I thought you had run it under Tomcat. Use ant to run your unit tests. g That is what I am doing. Also, Netbeans doesn't seem to have a problem with compiling and running the tests, if you have the external program set to jdk1.5.0. For my jdk1.4.2 unit testing I use ant though and that works fine. I have given up trying to get Netbeans or Eclipse to stop complaining about the new features I am using. -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Servlet thread safety in Tomcat
Synchronization does produce overhead, but it's what you *must* do if you will not re-write your servlets to no longer contain instance fields, *and* you wish to provide thread safety. There is a mode, and you have mentioned it before.. It's not a Tomcat mode, it's that Single threaded thing. (see, I can't even write it correctly, I don't even know what the exact name is). However, the decision to go with 'single threaded' will mostly be met with howls of derision and scorn... many people (correctly) believe this to be a poor idea. However, since you're already done a lot of work, and you're not willing to re-write.. it's the option that you're left with. Another topic you seem worried about is that one user requesting his 300 emails will cause other people (perhaps with only 10 or 20 emails) to wait. I'm perhaps completely off my rocker, but I think this is handled by having servlet multi-threaded in the first place. If the request that wants the 300 emails is taking too long (as decided by the container), then that user's request thread is suspended, while the other user's requests are handled. That's the whole point of multi-threading the servlet... (so that requests don't pile up)? Yoav.. is that completely wrong? -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 1:12 PM To: Tomcat Users List Subject: Re: Servlet thread safety in Tomcat But if I am to synchronise my code blocks won't that slow done the application, or is there a mode that you can put Tomcat into so that it will create a new instance servlet thread with its own variables and execution space and stuff like that .Because I was thinking putting all those synchronized blocks will slow down the app. David Ramsey wrote: Your primary mistake seems to be in assuming that Tomcat will create a new instance of a servlet for every thread started. This is not what happens, therefore servlet instance variables are not thread safe unless you take additional actions to make them safe. Likewise, application global entities, such as singletons, won't be thread safe without taking additional actions on your part. The short rule is simply if two threads might access this data concurrently, then you need to protect yourself from such a collision. About the only thing that is mostly thread safe are objects whose scope is limited to a single method, but even these can get you in trouble if you put references to those objects in global locations (such as an application wide cache). --- kwirirai [EMAIL PROTECTED] wrote: The app is simply meant to grab some mails from a pop server and simply display it using Java Mail. I realise part of my mistake is using global variables ,unsynchronized collections and unsynchronized code blocks.I am not using the single thread model. My initial thought ( :-) forgive me its some time since I have coded servlets) was that Tomcat will create a new servlet instance that is totally independed of the other, for each request.On testing the app on two client machines I have realized that the data is corrupted all mixed up and my velocity template is throwing an error caused by concurrent modification. My question is there some way of making this app thread safe and also how does Tomcat actually many requests , in terms of the threading method used?I am using Tomcat 4.1 Shapira, Yoav wrote: Howdy, State your specific requirements and we can help you design servlets/objects that will meet those requirements. Your original post is too broad to solicit a detailed response. Yoav Shapira Millennium ChemInformatics -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any
Re: Tomcat w Java1.5 beta problem
Shapira, Yoav wrote: I suggest rebuilding tomcat with 1.5 beta if you want to run servlets compiled using 1.5 beta. I'm not even sure my suggestion will work, as I haven't tried it myself. There has not been a tomcat release declared to support JDK 1.5 yet, although you're welcome to do building and testing for us ;) I wrote a jsp page that uses some of the management api stuff for monitoring threads, garbage collection, etc, and that works great under Tomcat 5, using jdk1.5.0. I didn't have to recompile anything. Once I get my unit tests to pass I will see how my webservices run under jdk1.5. -- Love is mutual self-giving that ends in self-recovery. Fulton Sheen James Black[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
done did not found a worker
I'm hoping someone can give me a bit of insight as to what I might be doing wrong with connecting Apache V.2 w/ Tomcat V.4 using mod_jk v1.2.5. It looks like apache is trying to talk to tomcat when is sees that /examples/ is supposed to be handled by tomcat via mod_jk but when mod_jk tries to use ajp13 to talk to tomcat, it gets confused, and addition, so do I. :) Instead of putting a boat-load of logs and config files in this email, I've put them on the web @: http://nicholasbernstein.com/tomcat/ Hopefully, that will be more convenient for anyone who is willing to take a look. The mod_jk.log error is: [Fri Feb 06 17:18:20 2004] [jk_worker.c (136)]: wc_get_worker_for_name, done did not found a worker [Fri Feb 06 17:21:02 2004] [jk_uri_worker_map.c (486)]: Into jk_uri_worker_map_t::map_uri_to_worker [Fri Feb 06 17:21:02 2004] [jk_uri_worker_map.c (500)]: Attempting to map URI '/examples/' [Fri Feb 06 17:21:02 2004] [jk_uri_worker_map.c (514)]: jk_uri_worker_map_t::map_uri_to_worker, Found an exact match ajp13 - /examples/ [Fri Feb 06 17:21:02 2004] [mod_jk.c (1709)]: Into handler r-proxyreq=0 r-handler=jakarta-servlet r-notes=136692072 worker=ajp13 [Fri Feb 06 17:21:02 2004] [jk_worker.c (132)]: Into wc_get_worker_for_name ajp13 [Fri Feb 06 17:21:02 2004] [jk_worker.c (136)]: wc_get_worker_for_name, done did not found a worker Any help would be appreciated; I've gone through a decent portion of the mailing list archives, as well as google, but the only thing I could find was making workers.properties be a minimal: worker.list=ajp13 worker.ajp13.type=ajp13 worker.ajp13.host=localhost worker.ajp13.port=8009 unfortunately making that change did not modify the error in any way. -- +---+ | Nicholas Bernstein| [EMAIL PROTECTED] | | UNIX Systems Administrator| http://www.docmagic.com | | Document Systems Inc. | | | gpg: F706 8C4E 78FA 53A0 019F D983 FE28 2002 D1F3| +---+ signature.asc Description: This is a digitally signed message part
RE: Servlet thread safety in Tomcat
Howdy, Synchronization does produce overhead, but it's what you *must* do if you will not re-write your servlets to no longer contain instance fields, *and* you wish to provide thread safety. Well-put. And you might be pleasantly surprised at how small the overhead is. Which is why I always suggest testing/benchmarking ;) There is a mode, and you have mentioned it before.. It's not a Tomcat mode, it's that Single threaded thing. (see, I can't even write it correctly, I don't even know what the exact name is). It's SingleThreadModel, which is deprecated (with no replacement) in the latest version of the servlet specification. So even if you're not using it already, don't start now. If the request that wants the 300 emails is taking too long (as decided by the container), then that user's request thread is suspended, while the other user's requests are handled. That's the whole point of multi-threading the servlet... (so that requests don't pile up)? That's not done by tomcat: all requests have equal priority from the Tomcat point of view. But the OS and JVM implement preemptive multitasking, and will split CPU time between the threads. So you're right Mike, if request A takes a very long time, and request B starts after request A, request B does NOT have to wait until request A is done to get CPU time. 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: manager app No context exists for path /
Anthony Gray wrote: Hi All, I'm trying to use the manager app (via /manager/html) so that I can restart/stop/start apps, however I'm getting the message No context exists for path / when I try to stop/restart the app. I'm using linux, tomcat 5.0.16, apache 2.0.47 and jk2 2.0.2, and My directory structure is like the following : jsp files : /home/user/www/ classes : /home/user/www/WEB-INF/classes/myjsp/ The web.xml in /home/user/www/WEB-INF/ doesn't have anything defined within the web-app directives, the app does not seem to require it for running. I have tried inserting the class names in here but it didn't seem to help (also I'm a newbie and I didn't really know what I was doing). The app runs fine and the jakarta help for the error message is There is no deployed application on the context path that you specified.. How can I make the manager app see my application ? I've not seen this exact error, but I have seen some no contexts exist messages (and general broken-ness) after mucking about with server.xml. I would suggest deploying with the manager, to make sure the app config is correct, and trying again. -- Josh Rehman citysearch.com 213.739.3559 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Fwd: Catalina suspends for no reason?!?]
Shapira, Yoav wrote: Howdy, So basically, I iknow this is off-topic for a tomcat-users page, but if I wanted to track down all the threads that are opened within the JVM at any one time, and the nature of the threads (ie Daemon etc.) and where they come from etc. can I do this? Sure. If you send a SIGQUIT to the JVM at any point, including when it appears hung, you will get a listing on your screen (or wherever you have stdout directed) of all the currently running JVM threads and what they're doing. I don't think that screen tells you if a given thread is a daemon. My first problem is the definition of the JVM, i cant find it as a process in its own right, I can only find the process for catalina, sending a SIGQUIT to: /usr/local/j2sdk_nb/j2sdk1.4.2/bin/java -Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed -classpath /usr/local/j2sdk_nb/j2sdk1.4.2/lib/tools.jar:/usr/local/tomcat/bin/bootstrap.jar -Djava.security.manager -Djava.security.policy==/usr/local/tomcat/conf/catalina.policy -Dcatalina.base=/us isn't doing anything, but I cant seem to find the JVM process?? so i tried your alternative.. Alternatively, you can produce this information programmatically. I've posted code to the list in the past that does this (I think it was called SystemThreadList or something like that). It's a simple recursive approach: // Find root threadgroup Thread thisThread = Thread.currentThread(); ThreadGroup tg = thisThread.getThreadGroup(); while(tg.getParent() != null) { tg = tg.getParent(); } // Get all threads int estimate = 2 * tg.activeCount(); Thread[] allThreads = new Thread[estimate]; tg.enumerate(allThreads); Sure enough, in its own little progam it prints out all the threads. But I obviously need to embed it in Catalina somewhere, should I create a bean that does this?? Thanks Sam Now you list all threads, check daemon status, check the class (in case it's a specific subclass extending Thread that you're looking for), etc. 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Fwd: Catalina suspends for no reason?!?]
Howdy, My first problem is the definition of the JVM, i cant find it as a process in its own right, I can only find the process for catalina, sending a SIGQUIT to: /usr/local/j2sdk_nb/j2sdk1.4.2/bin/java -Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed -classpath /usr/local/j2sdk_nb/j2sdk1.4.2/lib/tools.jar:/usr/local/tomcat/bin/boot stra p.jar -Djava.security.manager -Djava.security.policy==/usr/local/tomcat/conf/catalina.policy -Dcatalina.base=/us This IS the JVM process, you've found it. Look in catalina.out for the thread dump. Sure enough, in its own little progam it prints out all the threads. But I obviously need to embed it in Catalina somewhere, should I create a bean that does this?? Wherever you want, e.g. a servlet you can invoke from a browser. 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: Servlet thread safety in Tomcat
Another approach is to have your application create an instance for each session that will retrieve the mail for that session. Just ensure that the resource you are accessing can handle it, or you will have problems either way. (Note I am approaching this from a programming view. I am not familar with JavaMail yet.) Not much different than what Albert proposes, just changes where you split the tree in the process. Doug Parsons www.parsonstechnical.com - Original Message - From: Yu, Albert [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Monday, February 09, 2004 2:23 PM Subject: RE: Servlet thread safety in Tomcat If you implement the SingleThreadModel interface for your Servlet class, TomCat will create a new instance for each request. Albert -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 2:12 PM To: Tomcat Users List Subject: Re: Servlet thread safety in Tomcat But if I am to synchronise my code blocks won't that slow done the application, or is there a mode that you can put Tomcat into so that it will create a new instance servlet thread with its own variables and execution space and stuff like that .Because I was thinking putting all those synchronized blocks will slow down the app. David Ramsey wrote: Your primary mistake seems to be in assuming that Tomcat will create a new instance of a servlet for every thread started. This is not what happens, therefore servlet instance variables are not thread safe unless you take additional actions to make them safe. Likewise, application global entities, such as singletons, won't be thread safe without taking additional actions on your part. The short rule is simply if two threads might access this data concurrently, then you need to protect yourself from such a collision. About the only thing that is mostly thread safe are objects whose scope is limited to a single method, but even these can get you in trouble if you put references to those objects in global locations (such as an application wide cache). --- kwirirai [EMAIL PROTECTED] wrote: The app is simply meant to grab some mails from a pop server and simply display it using Java Mail. I realise part of my mistake is using global variables ,unsynchronized collections and unsynchronized code blocks.I am not using the single thread model. My initial thought ( :-) forgive me its some time since I have coded servlets) was that Tomcat will create a new servlet instance that is totally independed of the other, for each request.On testing the app on two client machines I have realized that the data is corrupted all mixed up and my velocity template is throwing an error caused by concurrent modification. My question is there some way of making this app thread safe and also how does Tomcat actually many requests , in terms of the threading method used?I am using Tomcat 4.1 Shapira, Yoav wrote: Howdy, State your specific requirements and we can help you design servlets/objects that will meet those requirements. Your original post is too broad to solicit a detailed response. Yoav Shapira Millennium ChemInformatics -Original Message- From: kwirirai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 12:48 PM To: [EMAIL PROTECTED] Subject: Servlet thread safety in Tomcat Hi All I am developing an application that uses JavaMail.What I am concered is the issue of thread safety,and efficiency.My question is do I need to employ synchronized blocks in my Servlet code or is there another way to implement thread safety.I have been experimenting with the application and I have seen that the data is actualy mixing up.I realy need to now how Tomcat handles request and issues those request ,this is in connection with threading. I have thought about the single thread model in my servlets but I think this is an inefficient method to use. Thanks Kwiri - 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: [Fwd: Catalina suspends for no reason?!?]
Howdy, My first problem is the definition of the JVM, i cant find it as a process in its own right, I can only find the process for catalina, sending a SIGQUIT to: /usr/local/j2sdk_nb/j2sdk1.4.2/bin/java -Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed -classpath /usr/local/j2sdk_nb/j2sdk1.4.2/lib/tools.jar:/usr/local/tomcat/bin/boot stra p.jar -Djava.security.manager -Djava.security.policy==/usr/local/tomcat/conf/catalina.policy -Dcatalina.base=/us This IS the JVM process, you've found it. Look in catalina.out for the thread dump. And there it is! Thanks Yoav, I'll check back next time Catalina hangs. If I shut down Catalina and the process persists, then can I assume that all the Catalina-associated threads have been shut down and what I'm looking at are the persistent threads? Thanks mucho S Sure enough, in its own little progam it prints out all the threads. But I obviously need to embed it in Catalina somewhere, should I create a bean that does this?? Wherever you want, e.g. a servlet you can invoke from a browser. 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
WARNING: Duplicate name in Manifest: Class-Path
Hi, I am getting a lot of this WARNING lately in my console. Did a search online and found a really good explaination on this page: http://www.deftcode.com/archives/duplicate_class_path_entries.html. I recently upgraded both JDK/JRE and Tomcat. So I am not sure which upgrade is responsible for bring out this warning. Anyone knows? The more specific the answer, the better. I want to get rid of it for now! Thanks. -Yan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Alias in tomcat
Hello, In apache there is a directive Alias Alias /users/ c:/somedirectory/ Directory c:/somedirectory/ Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all /Directory which basically says that any requests that start with /users/ are based out of that directory. now, my workers.properties for mod_jk2 has a mapping [uri:/*] worker=ajp13:localhost:8009 it HAS to be this way. So, in tomcat, can i do the same thing as Alias in apache? alex k. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Fwd: Catalina suspends for no reason?!?]
Howdy, If I shut down Catalina and the process persists, then can I assume that all the Catalina-associated threads have been shut down and what I'm looking at are the persistent threads? Yeah, plus the JVM root threads (main, Finalizer, Event) that cannot shut down before your threads do. These are easily identified by name in the thread dump. 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 question
Hello, I have setup Tomcat 4.12 in conjunction with Apache 2.0.43 on a Solaris UNIX box. My question is specific to Tomcat. I know that I can modify the server.xml to include individual logfiles under the webapps directory, both Local logs and (I believe) Catalina logfiles. However, these logfiles are all inclusive of everything that goes on in Tomcat. Is there a way where I could set up individual logs for my developers that are their own personal logfiles. Does Tomcat allow for that? Thanks. Chris Bliesner Lead Oracle DBA El Paso Boeing IDS e-mail: [EMAIL PROTECTED] 915-834-1757 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat question
Howdy, I have setup Tomcat 4.12 in conjunction with Apache 2.0.43 on a Solaris UNIX box. My question is specific to Tomcat. I know that I can modify the server.xml to include individual logfiles under the webapps directory, both Local logs and (I believe) Catalina logfiles. However, these logfiles are all inclusive of everything that goes on in Tomcat. Is there a way where I could set up individual logs for my developers that are their own personal logfiles. Does Tomcat allow for that? Thanks. You can nest a Logger element inside a Host, Engine, or Context. If you configure your server such that each developer has his own Host, Context(s), or Engine, then each can have their own Logger. Alternatively, and many people do this for convenience, each developer can have his/her own Tomcat instance. 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 question
Bliesner, Christopher P wrote: Hello, I have setup Tomcat 4.12 in conjunction with Apache 2.0.43 on a Solaris UNIX box. My question is specific to Tomcat. I know that I can modify the server.xml to include individual logfiles under the webapps directory, both Local logs and (I believe) Catalina logfiles. However, these logfiles are all inclusive of everything that goes on in Tomcat. Is there a way where I could set up individual logs for my developers that are their own personal logfiles. Does Tomcat allow for that? Thanks. You can certianly set a log file per Context. If you can live with a Context per developer, then your problem is solved. It is odd that your specific logs are getting extraneous (global tomcat) bits - normally that stuff is consumed by the top level logger and doesn't pass down to the overriding loggers. -- Josh Rehman citysearch.com 213.739.3559 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: root context loaded again under its docbase name
On 02/09/2004 02:58 PM Shapira, Yoav wrote: and this is my context (which is found in META-INF/context.xml): Context path= docBase=gargantus.war cachingAllowed=false reloadable=false Anybody else with the same setup see this? Bug or not bug? snip/ Seems like a bug. What happens if you don't have context.xml at all in your WAR, and simply drop the WAR in the webapps directory? If there's no context.xml, then I don't get a root context - no _, no nada - and no errors. Just the context with the same name as the war file. Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: root context loaded again under its docbase name
Howdy, If there's no context.xml, then I don't get a root context - no _, no nada - and no errors. Just the context with the same name as the war file. So if there's no context.xml, the behavior is correct (with all default values, e.g. reloadable). If you add a context.xml, you get the context twice, once as root and once appropriately. Seems like a bug, no? 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 question
thanks. Unfortunately, if I setup each developer a different log, they still get the whole logfile from Tomcat. I believe that I would have to setup several virtual hosts in Apache and then setup Tomcat versions for each one. However, I'm going to have one of the developer's try to route their servlet to a separate output.log file in their code. I'll let you know if it works. -Original Message- From: Josh Rehman [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 2:59 PM To: Tomcat Users List Subject: Re: Tomcat question Bliesner, Christopher P wrote: Hello, I have setup Tomcat 4.12 in conjunction with Apache 2.0.43 on a Solaris UNIX box. My question is specific to Tomcat. I know that I can modify the server.xml to include individual logfiles under the webapps directory, both Local logs and (I believe) Catalina logfiles. However, these logfiles are all inclusive of everything that goes on in Tomcat. Is there a way where I could set up individual logs for my developers that are their own personal logfiles. Does Tomcat allow for that? Thanks. You can certianly set a log file per Context. If you can live with a Context per developer, then your problem is solved. It is odd that your specific logs are getting extraneous (global tomcat) bits - normally that stuff is consumed by the top level logger and doesn't pass down to the overriding loggers. -- Josh Rehman citysearch.com 213.739.3559 - 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 question
Thanks for your help :) -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 2:55 PM To: Tomcat Users List Subject: RE: Tomcat question Howdy, I have setup Tomcat 4.12 in conjunction with Apache 2.0.43 on a Solaris UNIX box. My question is specific to Tomcat. I know that I can modify the server.xml to include individual logfiles under the webapps directory, both Local logs and (I believe) Catalina logfiles. However, these logfiles are all inclusive of everything that goes on in Tomcat. Is there a way where I could set up individual logs for my developers that are their own personal logfiles. Does Tomcat allow for that? Thanks. You can nest a Logger element inside a Host, Engine, or Context. If you configure your server such that each developer has his own Host, Context(s), or Engine, then each can have their own Logger. Alternatively, and many people do this for convenience, each developer can have his/her own Tomcat instance. 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: done did not found a worker
On Mon, 2004-02-09 at 11:33, Nicholas Bernstein wrote: ::SNIP:: I was wondering if perhaps this message was received by the list earlier and responded to, but I missed it. I tried to send it twice on friday, but got a bounce and did not see it appear in the messages from the list. Then again, I didn't start getting any messages until sunday, as either the subscribe took a long time, or the list was slow. Anyway, the original question, along with configs are at: http://www.nicholasbernstein.com/tomcat/ if anyone wants to take a shot at it. Thanks again, Nick -- +---+ | Nicholas Bernstein| [EMAIL PROTECTED] | | UNIX Systems Administrator| http://www.docmagic.com | | Document Systems Inc. | | | gpg: F706 8C4E 78FA 53A0 019F D983 FE28 2002 D1F3| +---+ signature.asc Description: This is a digitally signed message part
URL Rewrite Issue Help
Hi, I am Using HTTPSession to store the user_id and session_id to validate the session. I want to make web site should work even if client browser disables the cookies (Does not allow the cookies). For this I am using URLRewrite i.e.. appending jsessionid in to the URL in the form tag. This is showing the jsessionid in Browser URL (Browser Address bar) Is there any way to Hide jsessionid in the URL (Browser Address bar) ? Using Apache2, mod_jk2 and Tomcat4.1.24. If you have any better way of doing this, please advise me. Your help is greatly appreciated. Thanks, Rama - Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online
Weird Problems
I have these two wired problems on TC for some time. I need to resolve them now with some helps. The first problem is the session counter. It is implemented with the HttpSessionListener. It works fine until recently. Under the TC5.0.X, the counter can be a negative figure. The second is a quite severe problem. I configure the welcome file to map a JSP file. Sometimes, an incoming URL of the default domain leads to the 404 error. After I click the reload button on my browser, the JSP file shows up. Do someone know the solution of these two problems? Thanks, v. Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.asp?SRC=lycos10 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: root context loaded again under its docbase name
On 02/09/2004 11:01 PM Shapira, Yoav wrote: If there's no context.xml, then I don't get a root context - no _, no nada - and no errors. Just the context with the same name as the war file. So if there's no context.xml, the behavior is correct (with all default values, e.g. reloadable). If you add a context.xml, you get the context twice, once as root and once appropriately. Seems like a bug, no? Just tried that with a simple test.war file and a mickey mouse context.xml. It seems that it will not occur when the war has never been deployed before. But after the first deploy, once the war-file-name.xml exists in conf/Catalina/localhost/ and then when tomcat is restarted, tc then deploys the unwanted second context. I'll log it as a bug. Adam -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: System.out.println, Where art thou?
Sometimes it is threaputic to face one's stupidity... Anyway, it was pilot error... I use JBuilder (which has an embedded Tomcat) for my development and in versions prior to the latest (JB9 and before) the url pattern was http://localhost:8080/servercontext/servletname ..in JB10 this changed to ... http://localhost:8080/servletname .. I had gotten use to this pattern and my servlet context and name were very nearly identical.. so I had entered what amounted to http://serverhere/servercontext ..instead of getting a resource not found or somesuch... it loaded because Tomcat loaded http://serverhere/servercontext/index.jsp ...which in my application was NEVER loaded by itself and only should be loaded by the controller servlet after extensive setup and configuration.. The error was just enough legitimate looking that it did not flag what was really happening.. and I never clued in on what was really happening until I had gutted my controller to load a simple html form and instead the index.jsp still loaded... sign John.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Image download?
Hi, I have a servlet that's trying to send image files instead of a html response that doesn't seem to be working. Here's the code in question: //Set content-type ServletContext context = getServletContext(); response.setContentType(context.getMimeType(media.getLocation())); //Open file try { FileReader in = new FileReader(new File(media.getLocation())); char[] buffer = new char[4096]; int rc; PrintWriter out = response.getWriter(); //dump contents for (rc=in.read(buffer,0,buffer.length);rc0;rc=in.read(buffer,0,buffer.length)) out.write(buffer,0,rc); //Close file, and finish. in.close(); return; } catch (IOException e) { Logger.debug(this,IOException on media read/dump :(); e.printStackTrace(); return; } Anybody out there know where I'm going wrong? Is it some sort of text-binary thing in the java.io functions I didn't take into account? Any help much appreciated! Cheers, -Josh He likes to run, And then the thing with the.. person.. ... Oh boy, that monkey is going to pay. [ Josh 'G' McDonald ] -- [ Pirion Systems, Brisbane] [ 07 3257 0490 ] -- [ 0415 784 825 ] -- [ http://www.gfunk007.com/ ] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: done did not found a worker
Nicholas: Give up trying to use Apache2 with mod_jk. After spending days on the message boards trying to solve this one, I was ultimately told by the so-called experts that I had a network configuration problem and that some process was likely to be either already using or blocking port 8009. Poppy-Cock! Boulder Dash! I decided to attempt installing JK2 on the same server just to see if it would work. Guess what? JK2 and Apache2 worked on my first attempt. So much for getting advice from the EXPERTS! JK2 is not recommended if you are in a production environment however. JK2 is too young and untested for production environments and exploitable bugs and stability problems may arise. If you are building a production system -or- you just insist on using mod_jk then revert back to Apache 1.x. w/ mod_jk. Otherwise you may never get your server working. That's just the opinion of one who has suffered long enough with the Apache2 mod_jk SNAFFU. IMHO that combo just doesn't work together inspite of what Apache says. And if anybody thinks I'm wrong then they had ample time to help me when I was posting help requests concerning this issue all over the www. As it stands few would touch it with a ten foot pole. And the few who did were wrong. Osensei [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] - Original Message - From: Nicholas Bernsteinmailto:[EMAIL PROTECTED] To: [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 1:33 PM Subject: done did not found a worker
Re: done did not found a worker
On Mon, 2004-02-09 at 16:41, Charles Daniel wrote: Nicholas: Give up trying to use Apache2 with mod_jk. After spending days on the message boards trying to solve this one, I was ultimately told by the so-called experts that I had a network configuration problem and that some process was likely to be either already using or blocking port 8009. Poppy-Cock! Boulder Dash! I decided to attempt installing JK2 on the same server just to see if it would work. Guess what? JK2 and Apache2 worked on my first attempt. So much for getting advice from the EXPERTS! JK2 is not recommended if you are in a production environment however. JK2 is too young and untested for production environments and exploitable bugs and stability problems may arise. If you are building a production system -or- you just insist on using mod_jk then revert back to Apache 1.x. w/ mod_jk. Otherwise you may never get your server working. That's just the opinion of one who has suffered long enough with the Apache2 mod_jk SNAFFU. IMHO that combo just doesn't work together inspite of what Apache says. And if anybody thinks I'm wrong then they had ample time to help me when I was posting help requests concerning this issue all over the www. As it stands few would touch it with a ten foot pole. And the few who did were wrong. Osensei [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] Daniel: Thanks for your reply. Honestly, I was getting to the point where I was going to give it one more day and then try using apache 1.x instead. Thanks for taking the time. I appreciate it. -Nick -- +---+ | Nicholas Bernstein| [EMAIL PROTECTED] | | UNIX Systems Administrator| http://www.docmagic.com | | Document Systems Inc. | | | gpg: F706 8C4E 78FA 53A0 019F D983 FE28 2002 D1F3| +---+ signature.asc Description: This is a digitally signed message part
Re: Tomcat w Java1.5 beta problem
I suggest rebuilding tomcat with 1.5 beta if you want to run servlets compiled using 1.5 beta. I'm not even sure my suggestion will work, as I haven't tried it myself. There has not been a tomcat release declared to support JDK 1.5 yet, although you're welcome to do building and testing for us ;) The problem I had, I think, is that my method used an Enumeration and under 1.5 enum is a new keyword but jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper used enum many places as an identifier, as do some classes in org.apache.tomcat.util.compat -- Shawn Happily using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: done did not found a worker
On Mon, February 9, 2004 at 4:41 pm, Charles Daniel wrote: Give up trying to use Apache2 with mod_jk. After spending days on the message boards trying to solve this one, I was ultimately told by the so-called experts that I had a network configuration problem and that some process was likely to be either already using or blocking port 8009. Hmm, I've had no problems at all using mod_jk with Apache2 on both various Linux and SGI Irix machines. I must be a so-called expert. ;-) -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help regarding running a simple JSP page in Tomcat 5.0.16
Hi, This question may be addressed many many times,but do reply. I have a Win xp operating system Installed Tomcat 5.0.16 in it. Next the directory structure PS : The sampleapp directory is outside the tomcat installation directory. E:/sampleapp | | ROOT WEB-INF | classes | package1 dirs structure dirs .class files (for servlet works fine) in the WEB-INF,there is the web.xml,then sourcefilesdir and the lib directory which is empty. Now the servlet files work fine. I have placed my MyJsp.jsp file in the above mentioned sampleapp/ROOT directory. I have not done any thing with the TOMCAT_HOME/conf/server.xml file and the web.xml which I have written. When I give the following URI http://localhost:8080/sampleapp/MyJsp.jsp, I get the HTTP status 404- /MyJsp.jsp description: The requested resource (/MyJsp.jsp) is not available. Hoping that I have defined the problem specifically.Kindly show some light on this. Thanks AS
Re: Image download? - FIX
At 09:58 AM 10/02/2004, you wrote: Fix0r3d. For the archives, here's the fix: //Set content-type ServletContext context = getServletContext(); response.setContentType(context.getMimeType(media.getLocation())); //Open file try { FileInputStream in = new FileInputStream(media.getLocation()); byte[] buffer = new byte[4096]; int rc; ServletOutputStream out = response.getOutputStream(); //dump contents for (rc=in.read(buffer,0,buffer.length);rc0;rc=in.read(buffer,0,buffer.length)) out.write(buffer,0,rc); //Close file, and fuck off. in.close(); return; } catch (IOException e) { Logger.debug(this,IOException on media read/dump :(); e.printStackTrace(); return; } God I loathe java's IO He likes to run, And then the thing with the.. person.. ... Oh boy, that monkey is going to pay. [ Josh 'G' McDonald ] -- [ Pirion Systems, Brisbane] [ 07 3257 0490 ] -- [ 0415 784 825 ] -- [ http://www.gfunk007.com/ ] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help regarding a simple .jsp file
Hi, I have a directory by name sampleapp The sample app is not in the TOMCAT_HOME directory,now I have made a directory named ROOT inside the sampleapp directory. I have written a simple MyJsp.jsp jsp file and placed it in the above mentioned ROOT ,now my question is How does one write the Context /Context for this JSP page in the TOMCAT_HOME/conf/server.xml. Context path=/sampleapp docBase=e:/sampleapp/ROOT debug=0 reloadable=true /Context Is this the right way? Kindly let me know Thanking you AS
Re: done did not found a worker
On Mon, 2004-02-09 at 17:37, David Rees wrote: On Mon, February 9, 2004 at 4:41 pm, Charles Daniel wrote: Give up trying to use Apache2 with mod_jk. After spending days on the message boards trying to solve this one, I was ultimately told by the so-called experts that I had a network configuration problem and that some process was likely to be either already using or blocking port 8009. Hmm, I've had no problems at all using mod_jk with Apache2 on both various Linux and SGI Irix machines. I must be a so-called expert. ;-) -Dave if you've got a minute, take a look @ the configs I posted http://nicholasbernstein.com/tomcat/ and let me know if you see anything wrong with the setup. I'd rather stick to apache2; i'm using redhat ES and it looks like they've made a lot of RH specific patches to httpd source, so it probably performs a lot better that compiling 1.x from source. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- +---+ | Nicholas Bernstein| [EMAIL PROTECTED] | | UNIX Systems Administrator| http://www.docmagic.com | | Document Systems Inc. | | | gpg: F706 8C4E 78FA 53A0 019F D983 FE28 2002 D1F3| +---+ signature.asc Description: This is a digitally signed message part