Re: Another JSP precompile question (KMM140684V88743L0KM)
Hallo, unter Ihrer E-Mail-Absenderadresse tomcat-user@jakarta.apache.org liegt uns leider keine Anmeldung vor. Ich bitte Sie, uns Ihre Anfrage noch einmal von der E-Mail-Adresse zu senden, die bei uns registriert ist. Aus datenschutzrechtlichen Gruenden duerfen wir nur dann persoenliche Informationen weitergeben, wenn uns von der bei eBay registrierten E-Mail-Adresse geschrieben wurde. Die Nennung des eBay-Mitgliedsnamens oder der registrierten E-Mail-Adresse allein ist nicht ausreichend. Diese Massnahme dient Ihrem Schutz. Sind Sie nicht sicher, welche E-Mail-Adresse Sie bei uns hinterlegt haben? Ich erklaere Ihnen gerne, wie Sie dies am schnellsten pruefen und gegebenenfalls Ihre E-Mail-Adresse aktualisieren koennen. 1. Rufen Sie auf der eBay-Startseite Ihr Mein eBay auf und loggen Sie sich ein. 2. Klicken Sie danach in der linken Spalte ganz unten unter Meine Mitgliedschaft auf Persoenliche Daten. 3. Unter der Ueberschrift Persoenliche Daten sehen Sie in der Spalte E-Mail-Adresse Ihre bei uns hinterlegte E-Mail-Adresse. Anschliessend koennen Sie Ihre aktuellen Mitgliedsdaten einsehen und gegebenenfalls aktualisieren. Ich danke Ihnen fuer Ihr Verstaendnis und freue mich, dass wir Ihnen zu Ihrem Anliegen eine Antwort geben koennen. Mit freundlichen Gruessen Todd Dunker eBay Customer Support eBay - Der weltweite Online-Marktplatz! ** ** Bei Fragen per E-Mail nutzen Sie bitte unser Kontaktformular: http://pages.ebay.de/help/contact_inline/index.html Bitte nennen Sie uns bei Ihren Anfragen auch immer Ihren Mitgliedsnamen und die der Beteiligten, oder die Artikelnummer, zu der Sie eine Frage haben. Vielen Dank. ** Nutzen Sie die Moeglichkeit, mit anderen Mitgliedern in den eBay-Diskussionsforen in Kontakt zu treten! Teilen Sie Ihre Erkenntnisse und Erfahrungen! http://pages.ebay.de/community/chat/index.html ** 60924 9/5/05 Original Message Follows: - Hi! I just read about your Jasper2 precompiling... Do you do it via ant? I tried tomcat's JspC task (tomcat 5.5.9), but jasper generates rubbish wherever a character reference like #160; is encountered. Compile errors follow. A bug, isn't it? Is there a solution/upgrade/fix available? How comes that this problem is only with that precompile (and only as ant task??) - I would have guessed that the same procedures take place as when tomcat compiles at runtime? Thank you! sonja - 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]
Tomcat DB Connection Pooling
Hi I'm having a problem reclaiming connections in my database connection pool. I'm using the standard db conn pooling with Tomcat 5.5.9 with MySQL. I release the connection as well as close the PreparedStatement in the code after use. However, I still get errors with logEnabled set to true saying that the connection was not released. I tried the same code using a simple Statement object instead of a PreparedStatement and DID NOT see the errors. The SQL I'm running in an update, i.e. Insert statement. Are there any issues reclaiming connections from a PreparedStatement? Thanks, Dhiren
out of the office
I will be out of the office starting 06/09/2005 and will not return until 07/09/2005. Please call me on my mobile in case of urgency: +33 6 84 75 80 58 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how tomcat not run .EXE as CGI
gjl wrote: Thanks very much to read my question. I have tomcat5.0 for Win32 installed locally on Windows 2k, SP4. I'm trying to run a namazu.cgi.exe (a Full-Text Search Engine. that's not Perl scripts ,but a binary file) . the file is in Tomcat 5.0\webapps\XXX\WEB-INF\cgi ,and I set the web.xml file as followservlet servlet-namecgi/servlet-name servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class init-param param-nameclientInputTimeout/param-name param-value100/param-value /init-param init-param param-namedebug/param-name param-value6/param-value /init-param init-param param-namecgiPathPrefix/param-name param-valueWEB-INF/cgi/param-value /init-param load-on-startup5/load-on-startup /servlet servlet-mapping servlet-namecgi/servlet-name url-pattern/cgi-bin/*/url-pattern /servlet-mapping However, any reference to one of the .EXE in the http://localhost:8080/jsp-examples/cgi-bin/namazu.cgi.exe directory results in the browser trying to download the EXE. and I got the message 2005-09-06 10:07:25 StandardContext[/jsp-examples]cgi: runCGI (stderr):Unrecognized character \x90 at \Tomcat 5.0\webapps\jsp-examples\WEB-INF\cgi\namazu.cgi.exe line 1. in logs. how can I set the tomcat to run the .exe? With 5.0.x: You can't use the CGI servlet. You would need to write your own servlet that wraps the .exe using java.lang.Runtime.exec() http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java?view=markup should provide some pointers on how to wrap exec() (search the source for exec and remember that most of the CGIServlet is unnecessary for what you want to do. With 5.5.x: You *might* have some luck setting the new executable init parameter. I would try or cmd. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HttpServletResponse's getOutputStream() methtod.
Hi all, I'm using tomcat 5.0.28 in Linux environment. In doPost(...) method i'm asking HttpServletResponse's output stream. Tomcat provide me with *org.apache.coyote.tomcat5.CoyoteResponseFacade *getOutputStream(), which gives me a chunked output stream. Providing a chunked output stream limited the flexibility of interoperability with other systems, which would not support chunked stream. Could someone pls sujest me a work around to get through with it. To get a standard outputStream out of prior rather a chunked output stream. Thanks Saminda Abeyruwan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
use php in servlet engine.
Hello, We are facing a question here. How to integrate an old existing php site inside a tomcat container. I think about 2 possible solutions: 1) run apache+php on a specific port and have tomcat do some proxying on a url. (like http://server/php/* - apache-php) 2) create a webapplication supporting php using instruction provided on wiki: http://wiki.apache.org/jakarta-tomcat/UsingPhp The second one is more interesting (no need to run an additionnal apache process) However, am a bit worried about this comment on php documentation: http://be.php.net/manual/en/print/ref.java.php PHP has a habit of changing the working directory. sapi/servlet will eventually change it back, but while PHP is running the servlet engine may not be able to load any classes from the CLASSPATH which are specified using a relative directory syntax, or find the work directory used for administration and JSP compilation tasks. Has anyone here already tried this and experiences issue with this servlet? Thanks for sharing your experience. -- David Delbecq Royal Meteorological Institute of Belgium - Is there life after /sbin/halt -p? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getRealPath() returns real path plus context path
servletContext.getRealPath() is real path to the context path + the argument ... So if you say servletContext.getRealPath(hithere) .. It will return C:\path\to\tomcat\webapps\tool\hithere Regards Guru -Original Message- From: Franz-Josef Herpers [mailto:[EMAIL PROTECTED] Sent: 05 September 2005 20:40 To: Tomcat Users List Subject: getRealPath() returns real path plus context path Hi, I've a problem when using ServletContext#getRealPath() with Tomcat 5.5.9. My web application resides under the name tool in the webapps directory. When I call servletContext.getRealPath(request.getContextPath() I get the real path but always with the context path added at the end. That means a path like C:\path\to\tomcat\webapps\tool\tool. Is there any explanation for this behaviour? Or am I doing something wrong? Thanks for any hints in advance Regards Franz -- Franz-Josef Herpers Puschkinallee 9A 12435 Berlin 030/53 21 33 02 0173/54 23 666 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: use php in servlet engine.
Choose 1. But with some modifications apache + php + mod_jk - tomcat Viorel Dragomir . .. --- - Original Message - From: David Delbecq To: Tomcat Users List Sent: Tuesday, September 06, 2005 10:00 Subject: use php in servlet engine. Hello, We are facing a question here. How to integrate an old existing php site inside a tomcat container. I think about 2 possible solutions: 1) run apache+php on a specific port and have tomcat do some proxying on a url. (like http://server/php/* - apache-php) 2) create a webapplication supporting php using instruction provided on wiki: http://wiki.apache.org/jakarta-tomcat/UsingPhp The second one is more interesting (no need to run an additionnal apache process) However, am a bit worried about this comment on php documentation: http://be.php.net/manual/en/print/ref.java.php PHP has a habit of changing the working directory. sapi/servlet will eventually change it back, but while PHP is running the servlet engine may not be able to load any classes from the CLASSPATH which are specified using a relative directory syntax, or find the work directory used for administration and JSP compilation tasks. Has anyone here already tried this and experiences issue with this servlet? Thanks for sharing your experience. -- David Delbecq Royal Meteorological Institute of Belgium - Is there life after /sbin/halt -p? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getRealPath() returns real path plus context path
Franz-Josef Herpers wrote: Hi, I've a problem when using ServletContext#getRealPath() with Tomcat 5.5.9. My web application resides under the name tool in the webapps directory. When I call servletContext.getRealPath(request.getContextPath() I get the real path but always with the context path added at the end. That means a path like C:\path\to\tomcat\webapps\tool\tool. Is there any explanation for this behaviour? Or am I doing something wrong? Thanks for any hints in advance Regards Franz the getRealPath method simply returns a path inside the webapp's directory. eg. you can do getRealPath(images/someimg.jpg) and get the actual filesystem path for that file, so you can access it using java.io.File and do something with it. getRealPath(/) should give you the webapp directory itself. note that you probably should not use this method, if you ever want to be able to run your webapp directly from a .war file. Edmund - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: use php in servlet engine.
Le Mardi 6 Septembre 2005 11:07, Viorel Dragomir a écrit : Choose 1. But with some modifications apache + php + mod_jk - tomcat am not used to apache configuration, and have read several mails related to mod_jk problem since am watching this mailing list (well , so guess what, am a bit worried about it :) moreover if the pirinciple of mod_jk is to have apache dispatch servlet related thingie to tomcat, that is not the best solution imho (we have running java application now on a specific port and moving it away to give place for an apache proxy is a bit lot of work, and maybe a bit of downtime too). Anyway, I'll check. Thanks. Viorel Dragomir . .. --- - Original Message - From: David Delbecq To: Tomcat Users List Sent: Tuesday, September 06, 2005 10:00 Subject: use php in servlet engine. Hello, We are facing a question here. How to integrate an old existing php site inside a tomcat container. I think about 2 possible solutions: 1) run apache+php on a specific port and have tomcat do some proxying on a url. (like http://server/php/* - apache-php) 2) create a webapplication supporting php using instruction provided on wiki: http://wiki.apache.org/jakarta-tomcat/UsingPhp The second one is more interesting (no need to run an additionnal apache process) However, am a bit worried about this comment on php documentation: http://be.php.net/manual/en/print/ref.java.php PHP has a habit of changing the working directory. sapi/servlet will eventually change it back, but while PHP is running the servlet engine may not be able to load any classes from the CLASSPATH which are specified using a relative directory syntax, or find the work directory used for administration and JSP compilation tasks. Has anyone here already tried this and experiences issue with this servlet? Thanks for sharing your experience. -- David Delbecq Royal Meteorological Institute of Belgium - Is there life after /sbin/halt -p? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Do URL query strings with semi-colons work with TC ?
http://www.faqs.org/rfcs/rfc2396.html section 3.3 seems to be the best reference so far. This RFC only specifies correct URI syntax, it does not mandate how that URI is used under any scheme (like http:) is to be used. Darryl L. Miles wrote: The reference you cite http://www.faqs.org/rfcs/rfc2616.html (el al) maybe you could also cite the section I should look at. A simple search for param or semi yeilds no related results. I have spent an hour looking into the issue over the weekend and found the specification that covers the URI scheme for http: from this angle it seems to leave the part after the ? to denote the start of a query string vague. Which lead me to a presumption that it was HTTP server dependant on its interpretation, since for example the CGI.pm modules changed over from to ; as the standard param delimiter with generated URLs, providing the resulting URL talks back to itself (the CGI.pm module) all will be well in the world but if it links to a TC server then there would appear to be a problem. -- Darryl L. Miles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getRealPath() returns real path plus context path
Hi, Edmund Urbani wrote: the getRealPath method simply returns a path inside the webapp's directory. eg. you can do getRealPath(images/someimg.jpg) and get the actual filesystem path for that file, so you can access it using java.io.File and do something with it. getRealPath(/) should give you the webapp directory itself. note that you probably should not use this method, if you ever want to be able to run your webapp directly from a .war file. I know about the problem with the war file. That's the reason why I until today never used this method and apparently never read the Javadocs Thanks for the helpful answer. Regards Franz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AllowSymlink not working
Hi all, Using tomcat 5.0.28 embedded in an application server. In this tomcat, I have an application in which classes and libs are symlinks to other parts of the FileSystem. I tried several AllowSymlink configurations (inside contetx, outside context, etc.) and several catalina.policy permissions configuration and nothing work. Could anyone provide a simple and clear example of a configuration set that allows classes and libs to be located outside the webapps directory? I know it is a tomcat 4.1+ feature to check for symlink, I understood AllowSymlink should disable the check but... Thank you for your help, François. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Do URL query strings with semi-colons work with TC ?
Aye. It just states for that, amongst others, amphersand and semi-colon are reserved characters within the query string. This got me looking coz I assumed that the structure of the http get query string was defined somewhere in rfc rather than just a convention. I found a few resources saying it was recommended to support ; as a delimiter; http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2 But I also found the likely candidate in TC that does the parsing of the query string: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/Parameters.java?rev=1.15view=markup Just for my peace of mind does anyone know where the standard use of amphersand to delimit name-value pairs in a http get query string is defined? Jon Darryl L. Miles wrote: http://www.faqs.org/rfcs/rfc2396.html section 3.3 seems to be the best reference so far. This RFC only specifies correct URI syntax, it does not mandate how that URI is used under any scheme (like http:) is to be used. Darryl L. Miles wrote: The reference you cite http://www.faqs.org/rfcs/rfc2616.html (el al) maybe you could also cite the section I should look at. A simple search for param or semi yeilds no related results. I have spent an hour looking into the issue over the weekend and found the specification that covers the URI scheme for http: from this angle it seems to leave the part after the ? to denote the start of a query string vague. Which lead me to a presumption that it was HTTP server dependant on its interpretation, since for example the CGI.pm modules changed over from to ; as the standard param delimiter with generated URLs, providing the resulting URL talks back to itself (the CGI.pm module) all will be well in the world but if it links to a TC server then there would appear to be a problem. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AllowSymlink not working
On 06/09/2005 11:12, Francois JEANMOUGIN wrote: Hi all, Using tomcat 5.0.28 embedded in an application server. In this tomcat, I have an application in which classes and libs are symlinks to other parts of the FileSystem. I tried several AllowSymlink configurations (inside contetx, outside context, etc.) and several catalina.policy permissions configuration and nothing work. Hi! I simple add this lines (in bold) to server.xml Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false *Context docBase=YOUR_PATH path=/YOUR_PATH allowLinking=true* *Resources className=org.apache.naming.resources.FileDirContext* *allowLinking=true/* */Context* bye Mino - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: AllowSymlink not working
Hi! I simple add this lines (in bold) to server.xml Ok, as ususal, the problem was that the application server used an API that do not restart tomcat but simply restart the Catalina Engine, so it was not reading the conf files. Your hellp helped me to search somewhere else for the problem. Thank you. François. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What's better, having one large servlet or many small ones?
Hello Should I have one handler with many methods or more handlers with less methods (1-2)? Thanks! ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: What's better, having one large servlet or many small ones?
Many small ones. -Original Message- From: Raueber Hotzenplotz [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 10:50 To: tomcat-user@jakarta.apache.org Subject: What's better, having one large servlet or many small ones? Hello Should I have one handler with many methods or more handlers with less methods (1-2)? Thanks! ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how tomcat not run .EXE as CGI (KMM147972V1081L0KM)
Hallo, leider koennen wir den genauen Sachverhalt Ihres Anliegens nicht nachvollziehen. Bitte schildern Sie uns Ihr Anliegen noch etwas ausfuehrlicher, damit wir Ihnen weiterhelfen koennen. Unser Tipp: Nennen Sie bei Ihren Anfragen auch immer Ihren Mitgliedsnamen, die der Beteiligten und die Artikelnummer, zu der Sie eine Frage haben. Fuer Ihre Bemuehungen bedanken wir uns recht herzlich. Mit freundlichen Gruessen Anton Kaiser eBay Customer Support eBay - Der weltweite Online-Marktplatz! ** ** Bei Fragen per E-Mail nutzen Sie bitte unser Kontaktformular: http://pages.ebay.de/help/contact_inline/index.html Bitte nennen Sie uns bei Ihren Anfragen auch immer Ihren Mitgliedsnamen und die der Beteiligten, oder die Artikelnummer, zu der Sie eine Frage haben. Vielen Dank. ** Nutzen Sie die Moeglichkeit, mit anderen Mitgliedern in den eBay-Diskussionsforen in Kontakt zu treten! Teilen Sie Ihre Erkenntnisse und Erfahrungen! http://pages.ebay.de/community/chat/index.html ** Original Message Follows: - gjl wrote: Thanks very much to read my question. I have tomcat5.0 for Win32 installed locally on Windows 2k, SP4. I'm trying to run a namazu.cgi.exe (a Full-Text Search Engine. that's not Perl scripts ,but a binary file) . the file is in Tomcat 5.0\webapps\XXX\WEB-INF\cgi ,and I set the web.xml file as followservlet servlet-namecgi/servlet-name servlet-classorg.apache.catalina.servlets.CGIServlet/servlet-class init-param param-nameclientInputTimeout/param-name param-value100/param-value /init-param init-param param-namedebug/param-name param-value6/param-value /init-param init-param param-namecgiPathPrefix/param-name param-valueWEB-INF/cgi/param-value /init-param load-on-startup5/load-on-startup /servlet servlet-mapping servlet-namecgi/servlet-name url-pattern/cgi-bin/*/url-pattern /servlet-mapping However, any reference to one of the .EXE in the http://localhost:8080/jsp-examples/cgi-bin/namazu.cgi.exe directory results in the browser trying to download the EXE. and I got the message 2005-09-06 10:07:25 StandardContext[/jsp-examples]cgi: runCGI (stderr):Unrecognized character \x90 at \Tomcat 5.0\webapps\jsp-examples\WEB-INF\cgi\namazu.cgi.exe line 1. in logs. how can I set the tomcat to run the .exe? With 5.0.x: You can't use the CGI servlet. You would need to write your own servlet that wraps the .exe using java.lang.Runtime.exec() http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/catalina/src/s hare/org/apache/catalina/servlets/CGIServlet.java?view=markup should provide some pointers on how to wrap exec() (search the source for exec and remember that most of the CGIServlet is unnecessary for what you want to do. With 5.5.x: You *might* have some luck setting the new executable init parameter. I would try or cmd. - 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: Do URL query strings with semi-colons work with TC ?
http://ppewww.ph.gla.ac.uk/~flavell/www/formgetbyurl.html Not sure what authorative basis this has, but it did turn up from NCSA based CGI specifications of yesteryear. Maybe the MIME specification for application/x-www-form-urlencoded wherever that is (cant find it either). It must be noted that a URL like this is valid syntax: http://www.mydomain.com/pathseg1;foo=bar/pathseg2;foo=bar2/pathseg3;foo=bar3;foo=bar33?query=value How the receiving HTTP server interprets the path is unspecified, and I don't think its mandatory for a HTTP server to support path params at any level. Since JSESSIONID is being used I would say that only the last path parameters should be picked up and made available to the target servlet and an error given out to path params no part of the last segment (so no one tries to use them, leaving the door open for their implementation later in a server that would support some usage), that make these path params eligable for pickup: foo=bar3 foo=bar33 As for precedence / override with tranditional query strings, i.e. should the namespaces be collsapse. sigh another issue to head scratch. Darryl Jon Wingfield wrote: Aye. It just states for that, amongst others, amphersand and semi-colon are reserved characters within the query string. This got me looking coz I assumed that the structure of the http get query string was defined somewhere in rfc rather than just a convention. I found a few resources saying it was recommended to support ; as a delimiter; http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2 But I also found the likely candidate in TC that does the parsing of the query string: http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/Parameters.java?rev=1.15view=markup Just for my peace of mind does anyone know where the standard use of amphersand to delimit name-value pairs in a http get query string is defined? Jon Darryl L. Miles wrote: http://www.faqs.org/rfcs/rfc2396.html section 3.3 seems to be the best reference so far. This RFC only specifies correct URI syntax, it does not mandate how that URI is used under any scheme (like http:) is to be used. Darryl L. Miles wrote: The reference you cite http://www.faqs.org/rfcs/rfc2616.html (el al) maybe you could also cite the section I should look at. A simple search for param or semi yeilds no related results. I have spent an hour looking into the issue over the weekend and found the specification that covers the URI scheme for http: from this angle it seems to leave the part after the ? to denote the start of a query string vague. Which lead me to a presumption that it was HTTP server dependant on its interpretation, since for example the CGI.pm modules changed over from to ; as the standard param delimiter with generated URLs, providing the resulting URL talks back to itself (the CGI.pm module) all will be well in the world but if it links to a TC server then there would appear to be a problem. -- Darryl L. Miles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pre-compiled JSPs?
Hi Nicolas, Thanks for your reply, I really appreciate your help. I'm not sure I fully understand your solution. I see now that the webXmlFragment provides a convenient way to generate the XML needed for the Servlets but that have bizarre names. Let's say I have a jsp: /RichardsApp/DoSomething.jsp Running Jasper at it provides a java file: /RichardsApp/DoSomething_jsp.java Then the Servlet definition would be: servlet servlet-nameRichardsApp.DoSomething_jsp/servlet-name servlet-classRichardsApp.DoSomething_jsp/servlet-class /servlet The way to reference my JSP used to be: http://myserver:8080/RichardsApp/DoSomething.jsp What would the new reference be? http://myserver:8080/RichardsApp/DoSomething_jsp or http://myserver:8080/RichardsApp/DoSomething Have I missed something obvious? Thanks for your help! Richard. -Original Message- From: Karasek-XID, Nicolas [mailto:[EMAIL PROTECTED] Sent: 05 September 2005 12:04 To: Tomcat Users List Subject: RE: Pre-compiled JSPs? Hi, You need to insert in your web.xml the reference to the precompiled servlets. Jasper can generate a web.xml fragment when turning JSP into servlets. You can then insert the fragment into your web.xml Something like this with ant: !-- turn jsp into servlets -- jasper2 verbose=0 package=your.package validateXml=false uriroot=${webapp.path} webXmlFragment=generated-web.xml outputDir=${webapp.path}/WEB-INF/src / !-- Load the precompiled snippet into a property -- loadfile property=precompiled srcFile= generated-web.xml encoding=ISO-8859-1 / !-- Now replace the web.xml with a predefined snippet -- !-- copy web.xml -- replace file=web.xml value=${precompiled} replacetokenlt;!-- jsp-servlets will be inserted here - do not remove this line --gt;/replacetoken /replace -Original Message- From: Richard Burman [mailto:[EMAIL PROTECTED] Sent: lundi 5 septembre 2005 12:44 To: Tomcat Users List Subject: Pre-compiled JSPs? Hi everyone, I have a fairly elaborate problem but hope that some people out there can help with it. I am trying to take a large webapp and create pre-compiled JSPs. We already compile the java into class files, then package in JARs, then finally a WAR, but we would like to be able to package the JSPs into a neat package, too. The first hurdle was trying to circumvent the issue of when JSPs include each other and a bean is used in both JSPs but can only be declared once when the JSPs are combined. Thus, you have to leave out the bean declaration in the second JSP but then it will not compile on it's own because it has no knowledge of the bean. Fortunately, in the recent Tomcat releases, it's possible to use the flag 'errorOnUseBeanInvalidClassAttribute' to ignore this problem. Once the JSPs have been turned into Java classes by Jasper2, it's not too hard to compile them into class files. But how do you deploy these compiled classes so that Tomcat knows to use them? If the Whatever.jsp file doesn't exist, how does Tomcat know where or how to find the compiled JSP file? Should I put them in a JAR and deploy somewhere? Do I need to change the web.xml or similar to inform Tomcat about this? If anyone has any suggestions, advice or solutions to this, I would be eternally grateful! :) Thanks, Richard. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpServletResponse's getOutputStream() methtod.
If you want to disable chunked encoding - you need to determine how much data you will send so setContentLength can be called. -Tim Saminda Abeyruwan wrote: Hi all, I'm using tomcat 5.0.28 in Linux environment. In doPost(...) method i'm asking HttpServletResponse's output stream. Tomcat provide me with *org.apache.coyote.tomcat5.CoyoteResponseFacade *getOutputStream(), which gives me a chunked output stream. Providing a chunked output stream limited the flexibility of interoperability with other systems, which would not support chunked stream. Could someone pls sujest me a work around to get through with it. To get a standard outputStream out of prior rather a chunked output stream. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pre-compiled JSPs?
What you see looks like normal jasper name mangling of generated pages. You use: http://myserver:8080/RichardsApp/DoSomething.jsp I presume there is also a generated mapping entry, that you may have overlooked: servlet-mapping servlet-nameRichardsApp.DoSomething_jsp/servlet-name url-pattern/DoSomething.jsp/url-pattern /servlet-mapping Richard Burman wrote: Hi Nicolas, Thanks for your reply, I really appreciate your help. I'm not sure I fully understand your solution. I see now that the webXmlFragment provides a convenient way to generate the XML needed for the Servlets but that have bizarre names. Let's say I have a jsp: /RichardsApp/DoSomething.jsp Running Jasper at it provides a java file: /RichardsApp/DoSomething_jsp.java Then the Servlet definition would be: servlet servlet-nameRichardsApp.DoSomething_jsp/servlet-name servlet-classRichardsApp.DoSomething_jsp/servlet-class /servlet The way to reference my JSP used to be: http://myserver:8080/RichardsApp/DoSomething.jsp What would the new reference be? http://myserver:8080/RichardsApp/DoSomething_jsp or http://myserver:8080/RichardsApp/DoSomething Have I missed something obvious? Thanks for your help! Richard. -- Darryl L. Miles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpServletResponse's getOutputStream() methtod.
Tim Funk wrote: If you want to disable chunked encoding - you need to determine how much data you will send so setContentLength can be called. -Tim Hi Tim, Thanks for the reply, Is it something like, response.setContentLength(1000); OutputStream out = response.getOutputStream(); Yet, i would like to have a outputsteam without any chunking at all. Saminda Saminda Abeyruwan wrote: Hi all, I'm using tomcat 5.0.28 in Linux environment. In doPost(...) method i'm asking HttpServletResponse's output stream. Tomcat provide me with *org.apache.coyote.tomcat5.CoyoteResponseFacade *getOutputStream(), which gives me a chunked output stream. Providing a chunked output stream limited the flexibility of interoperability with other systems, which would not support chunked stream. Could someone pls sujest me a work around to get through with it. To get a standard outputStream out of prior rather a chunked output stream. - 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: HttpServletResponse's getOutputStream() methtod.
I thought if setContentLength() is used, then chunked encoding is not used. Is that not the case? -Tim Saminda Abeyruwan wrote: Tim Funk wrote: If you want to disable chunked encoding - you need to determine how much data you will send so setContentLength can be called. -Tim Hi Tim, Thanks for the reply, Is it something like, response.setContentLength(1000); OutputStream out = response.getOutputStream(); Yet, i would like to have a outputsteam without any chunking at all. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Loss of Subject/AccessControlContext in JSTL
We've been tracking a nasty issue in our web application when using Tomcat 5.0.28 and JSTL. If we call a method from JSTL, any code that tries to access the AccessControlContext behaves differently than it would if called directly in a JSP using plain java. e.g. If we have a utility method in our dataBean that returns the (JAAS) Subject using Subject.getSubject(AccessController.getContext()), the syntax: %= dataBean.getSubjectFromContext() % returns the Subject whereas: ${dataBean.subjectFromContext} returns null This is quite unexpected behaviour and seems to be caused by the call to: org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:880) which uses AccessController.doPrivileged(PrivilegedExceptionAction) rather than AccessController.doPrivileged(PrivilegedExceptionAction, AccessControlContext) to evaluate the EL syntax. I think that changing: retValue = AccessController.doPrivileged( new PrivilegedExceptionAction(){ . } ); To: retValue = AccessController.doPrivileged( new PrivilegedExceptionAction(){ . }, AccessController.getContext() ); should solve this. Can someone please have a look at this? Cheers, Michiel -- Michiel Toneman Software Engineer Bibit Global Payment Services Regulierenring 10 3981 LB Bunnik [EMAIL PROTECTED] Tel. +31-30-6595168 Fax +31-30-6564464 http://www.bibit.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat/JVM hangs in session.getAttribute / HashMap.get()
Hi, This is quite ugly but we are running out of ideas. We are currently experiencing stange behaviour of tomcat (or the VM). Our tomcat hangs (not reproduceable, but probably on parallel requests to similar methods) in session.getAttibute(): We checked the source code of the HashMap, StandardSession and StandardSessionFacade but couldn't find any synchronized methods. The manager shows the 4 threads hanging since 400 millis (more than an hour). we created a stacktrace with kill - QUIT, here the threads are: http-8580-Processor3 daemon prio=1 tid=0x7cdf11d0 nid=0x3269 runnable [7d7fe000..7d7ff8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.action.BaseAction.getUserId(BaseAction.java:653) at de.friendscout.datingr4.onlinearea.presentation.action.BaseOnlineAreaAction.getSettings(BaseOnlineAreaAction.java:89) at de.friendscout.datingr4.onlinearea.presentation.action.GetOnlineUsersAction.doExecute(GetOnlineUsersAction.java:49) http-8580-Processor1 daemon prio=1 tid=0x7d3fa078 nid=0x3269 runnable [7ce7f000..7ce7f8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.action.BaseAction.getUserId(BaseAction.java:653) at de.friendscout.datingr4.onlinearea.presentation.action.ShowFiltersAction.doExecute(ShowFiltersAction.java:42) at de.friendscout.datingr4.shared.presentation.action.BaseAction.execute(BaseAction.java:316) http-8580-Processor24 daemon prio=1 tid=0x7d430200 nid=0x3269 runnable [7e77f000..7e77f8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.util.RealmUtility.initRealm(RealmUtility.java:66) at de.friendscout.datingr4.shared.presentation.util.RealmUtility.initRealm(RealmUtility.java:61) at de.friendscout.datingr4.shared.presentation.controller.ControllerServlet.doGet(ControllerServlet.java:139) My Java knowledge isn't sufficent to explain how something can hang in HashMap.get() since its not synchronized. Neither are the .getAttribute() methods of the StandardSession or StandardSessionFacade. We are using jdk 1.4.2_08-b03, tomcat 5.0.25, struts 1.1, jacorb 2.2 (night build) on linux/debian/sarge - 3.1 stable. any ideas? anybody? regards Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
I have seen instances of a HashMap whose entries got circularly linked, I assume, due to updates which where not thread safe. Any thread using a get() on such a HashMap will spin forever chasing its tail. Cheers, Larry -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 8:31 AM To: tomcat-user@jakarta.apache.org Subject: Tomcat/JVM hangs in session.getAttribute / HashMap.get() Hi, This is quite ugly but we are running out of ideas. We are currently experiencing stange behaviour of tomcat (or the VM). Our tomcat hangs (not reproduceable, but probably on parallel requests to similar methods) in session.getAttibute(): We checked the source code of the HashMap, StandardSession and StandardSessionFacade but couldn't find any synchronized methods. The manager shows the 4 threads hanging since 400 millis (more than an hour). we created a stacktrace with kill - QUIT, here the threads are: http-8580-Processor3 daemon prio=1 tid=0x7cdf11d0 nid=0x3269 runnable [7d7fe000..7d7ff8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(Stand ardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute (StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.action.BaseAction. getUserId(BaseAction.java:653) at de.friendscout.datingr4.onlinearea.presentation.action.BaseOnl ineAreaAction.getSettings(BaseOnlineAreaAction.java:89) at de.friendscout.datingr4.onlinearea.presentation.action.GetOnli neUsersAction.doExecute(GetOnlineUsersAction.java:49) http-8580-Processor1 daemon prio=1 tid=0x7d3fa078 nid=0x3269 runnable [7ce7f000..7ce7f8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(Stand ardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute (StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.action.BaseAction. getUserId(BaseAction.java:653) at de.friendscout.datingr4.onlinearea.presentation.action.ShowFil tersAction.doExecute(ShowFiltersAction.java:42) at de.friendscout.datingr4.shared.presentation.action.BaseAction. execute(BaseAction.java:316) http-8580-Processor24 daemon prio=1 tid=0x7d430200 nid=0x3269 runnable [7e77f000..7e77f8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(Stand ardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute (StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.util.RealmUtility. initRealm(RealmUtility.java:66) at de.friendscout.datingr4.shared.presentation.util.RealmUtility. initRealm(RealmUtility.java:61) at de.friendscout.datingr4.shared.presentation.controller.Control lerServlet.doGet(ControllerServlet.java:139) My Java knowledge isn't sufficent to explain how something can hang in HashMap.get() since its not synchronized. Neither are the .getAttribute() methods of the StandardSession or StandardSessionFacade. We are using jdk 1.4.2_08-b03, tomcat 5.0.25, struts 1.1, jacorb 2.2 (night build) on linux/debian/sarge - 3.1 stable. any ideas? anybody? regards Leon - 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: Pre-compiled JSPs?
Eureka! I get it now. :) Indeed, I hadn't noticed the servlet-mapping section down the bottom. I looked at the xml and foolishly assumed that it merely repeated all the way to the bottom. Now that you've pointed out that, it all makes sense. Thanks for all your help, I shall have a play and hopefully have new, sparkly, compiled JSPs soon! Richard. -Original Message- From: Darryl L. Miles [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 12:33 To: Tomcat Users List Subject: Re: Pre-compiled JSPs? What you see looks like normal jasper name mangling of generated pages. You use: http://myserver:8080/RichardsApp/DoSomething.jsp I presume there is also a generated mapping entry, that you may have overlooked: servlet-mapping servlet-nameRichardsApp.DoSomething_jsp/servlet-name url-pattern/DoSomething.jsp/url-pattern /servlet-mapping Richard Burman wrote: Hi Nicolas, Thanks for your reply, I really appreciate your help. I'm not sure I fully understand your solution. I see now that the webXmlFragment provides a convenient way to generate the XML needed for the Servlets but that have bizarre names. Let's say I have a jsp: /RichardsApp/DoSomething.jsp Running Jasper at it provides a java file: /RichardsApp/DoSomething_jsp.java Then the Servlet definition would be: servlet servlet-nameRichardsApp.DoSomething_jsp/servlet-name servlet-classRichardsApp.DoSomething_jsp/servlet-class /servlet The way to reference my JSP used to be: http://myserver:8080/RichardsApp/DoSomething.jsp What would the new reference be? http://myserver:8080/RichardsApp/DoSomething_jsp or http://myserver:8080/RichardsApp/DoSomething Have I missed something obvious? Thanks for your help! Richard. -- Darryl L. Miles - 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/JVM hangs in session.getAttribute / HashMap.get()
On Tue, 2005-09-06 at 08:47 -0400, Larry Isaacs wrote: I have seen instances of a HashMap whose entries got circularly linked, I assume, due to updates which where not thread safe. Any thread using a get() on such a HashMap will spin forever chasing its tail. Cheers, Larry Could be possible since we also have increasing load (until idle time goes to zero) on those machines but... we are putting only pretty simple objects like Locale or an userId object. If I understand you correctly your scenario is: HashMap Entry has a linked list of X entries at one position and entry[Y] is poiting to the first entry instead of next or null? But how can that happen? a JVM / Core Api bug? public abstract class UserId implements Serializable{ public abstract String getPlainPresentation(); public boolean equals(Object anotherObject){ return anotherObject instanceof UserId ? ((UserId)anotherObject).getPlainPresentation().equals(getPlainPresentation()): false; } public abstract String[] getFragmentation(int fragementationDepth, int fragmentLength); public String toString(){ return getPlainPresentation(); } } public class LongUserId extends UserId implements Serializable{ private long value; private transient String cachedStringPresentation; private static final long serialVersionUID = 451670268366493765L; public LongUserId(long aValue){ this.value = aValue; } public int hashCode(){ return (int)value; } public boolean equals(Object o){ return (o instanceof LongUserId) ? ((LongUserId)o).value == value : false; } public String[] getFragmentation(int fragmentationDepth, int fragmentLength) { String s = getPlainPresentation(); //first ensure our string is long enough. while (s.length()fragmentationDepth*fragmentLength) s = 0+s; int singleLength = fragmentLength; String ret[] = new String[fragmentationDepth]; for (int i=0; ifragmentationDepth; i++){ String fragment = s.substring(i*singleLength, i*singleLength +singleLength); ret[i] = fragment; } return ret; } public String getPlainPresentation() { if (cachedStringPresentation==null) cachedStringPresentation = +value; return cachedStringPresentation; } thanx Leon -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 8:31 AM To: tomcat-user@jakarta.apache.org Subject: Tomcat/JVM hangs in session.getAttribute / HashMap.get() Hi, This is quite ugly but we are running out of ideas. We are currently experiencing stange behaviour of tomcat (or the VM). Our tomcat hangs (not reproduceable, but probably on parallel requests to similar methods) in session.getAttibute(): We checked the source code of the HashMap, StandardSession and StandardSessionFacade but couldn't find any synchronized methods. The manager shows the 4 threads hanging since 400 millis (more than an hour). we created a stacktrace with kill - QUIT, here the threads are: http-8580-Processor3 daemon prio=1 tid=0x7cdf11d0 nid=0x3269 runnable [7d7fe000..7d7ff8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(Stand ardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute (StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.action.BaseAction. getUserId(BaseAction.java:653) at de.friendscout.datingr4.onlinearea.presentation.action.BaseOnl ineAreaAction.getSettings(BaseOnlineAreaAction.java:89) at de.friendscout.datingr4.onlinearea.presentation.action.GetOnli neUsersAction.doExecute(GetOnlineUsersAction.java:49) http-8580-Processor1 daemon prio=1 tid=0x7d3fa078 nid=0x3269 runnable [7ce7f000..7ce7f8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(Stand ardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute (StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.action.BaseAction. getUserId(BaseAction.java:653) at de.friendscout.datingr4.onlinearea.presentation.action.ShowFil tersAction.doExecute(ShowFiltersAction.java:42) at
RE: JK-1.2.14 for Apache WebServer 2.0.x
It might be because 1.2.14 crashes on Apache 2 + Solaris? (from my observations and tests) See my thread which, so far, has no responses outside of my own: JK 1.2.14.1 SIG BUS Error on Solaris 9 Byron -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 05, 2005 8:06 AM To: tomcat-user@jakarta.apache.org Subject: JK-1.2.14 for Apache WebServer 2.0.x On the download page for latest JK 1.2 connector: http://www.apache.org/dist/jakarta/tomcat-connectors/jk/binaries/solaris /jk-1.2.14 / I don't see a JK connector for Apache 2.0 only for 1.3.x. In addition I'm unable to locate previous versions 1.2.13, 1.2.12 etc. The download page has 1.2.6 alongside 1.2.14. Anyone have an update on this? Thanks. Mervyn Sands Global Technology Infrastructure - Application Server Engineering : http://emis.chase.com/groups/appServer/ JPMorganChase Co., 1 Chaseside Solent Building, Mail Point 511B, Bournemouth, BH7 7DA ( desk: 44-(0)1202 342426 GDP 731 2426 ( mob: 44-(0)77 141 00764 * email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: What's better, having one large servlet or many small ones?
Raueber Keep in mind that one day it could be many people reading your code, so I would suggest you have many servlets doing specific things. Regardless of whether it's a servlet, jsp or Java application think of future prospects of your code. Ideally you could hand it to anyone and they understand what is going on with the minimum of comments. Regards Jason Bell Should I have one handler with many methods or more handlers with less methods (1-2)? -- Jason Bell Lead Architect, SpikeSource Europe e: [EMAIL PROTECTED] w: http://www.spikesource.com b: http://jasonbell.blog-city.com m: +44 (0)787 529 2693 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IIS with tomcat
Hi I am using IIS 5.0 with Tomcat 4.0.6 My web application is working fine except at one place I have a single page, and within this page there is an IFRAME which source referring to another page. And somehow the session in the IFRAME is never the same than in the main page. I am using the same host name info to build the source url of the IFRAME and I tried to use jsessionid param in the url, and I am still not in the same session. Anyone have an idea about this strange problem?
RE: What's better, having one large servlet or many small ones?
Solely my opinion based on experience with 100's of servlets- it doesn't matter. If the application is complex enough to worry about this, get a MVC framework like struts for better organization inside the servlet and let it draw the distinctions between pieces of the application. Byron -Original Message- From: Raueber Hotzenplotz [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 5:50 AM To: tomcat-user@jakarta.apache.org Subject: What's better, having one large servlet or many small ones? Hello Should I have one handler with many methods or more handlers with less methods (1-2)? Thanks! ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - 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/JVM hangs in session.getAttribute / HashMap.get()
-Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 9:03 AM To: Tomcat Users List Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get() On Tue, 2005-09-06 at 08:47 -0400, Larry Isaacs wrote: I have seen instances of a HashMap whose entries got circularly linked, I assume, due to updates which where not thread safe. Any thread using a get() on such a HashMap will spin forever chasing its tail. Cheers, Larry Could be possible since we also have increasing load (until idle time goes to zero) on those machines but... we are putting only pretty simple objects like Locale or an userId object. I don't think it is a matter of how simple the object, but how it is being stored in the session. If I understand you correctly your scenario is: HashMap Entry has a linked list of X entries at one position and entry[Y] is poiting to the first entry instead of next or null? Correct. But how can that happen? a JVM / Core Api bug? The error is likely in webapp code, since the Servlet spec leaves it up to the webapp to implement thread safe setting and update of session objects. I haven't researched the HashMap source code to see exactly how this situation can come about, so I can't say exactly what to look for. Thus, the not terribly helpful advice is to examine for thread safety each location where the session is written. Cheers, Larry public abstract class UserId implements Serializable{ public abstract String getPlainPresentation(); public boolean equals(Object anotherObject){ return anotherObject instanceof UserId ? ((UserId)anotherObject).getPlainPresentation().equals(getPlain Presentation()): false; } public abstract String[] getFragmentation(int fragementationDepth, int fragmentLength); public String toString(){ return getPlainPresentation(); } } public class LongUserId extends UserId implements Serializable{ private long value; private transient String cachedStringPresentation; private static final long serialVersionUID = 451670268366493765L; public LongUserId(long aValue){ this.value = aValue; } public int hashCode(){ return (int)value; } public boolean equals(Object o){ return (o instanceof LongUserId) ? ((LongUserId)o).value == value : false; } public String[] getFragmentation(int fragmentationDepth, int fragmentLength) { String s = getPlainPresentation(); //first ensure our string is long enough. while (s.length()fragmentationDepth*fragmentLength) s = 0+s; int singleLength = fragmentLength; String ret[] = new String[fragmentationDepth]; for (int i=0; ifragmentationDepth; i++){ String fragment = s.substring(i*singleLength, i*singleLength +singleLength); ret[i] = fragment; } return ret; } public String getPlainPresentation() { if (cachedStringPresentation==null) cachedStringPresentation = +value; return cachedStringPresentation; } thanx Leon -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 8:31 AM To: tomcat-user@jakarta.apache.org Subject: Tomcat/JVM hangs in session.getAttribute / HashMap.get() Hi, This is quite ugly but we are running out of ideas. We are currently experiencing stange behaviour of tomcat (or the VM). Our tomcat hangs (not reproduceable, but probably on parallel requests to similar methods) in session.getAttibute(): We checked the source code of the HashMap, StandardSession and StandardSessionFacade but couldn't find any synchronized methods. The manager shows the 4 threads hanging since 400 millis (more than an hour). we created a stacktrace with kill - QUIT, here the threads are: http-8580-Processor3 daemon prio=1 tid=0x7cdf11d0 nid=0x3269 runnable [7d7fe000..7d7ff8bc] at java.util.HashMap.get(HashMap.java:325) at org.apache.catalina.session.StandardSession.getAttribute(Stand ardSession.java:975) at org.apache.catalina.session.StandardSessionFacade.getAttribute (StandardSessionFacade.java:109) at de.friendscout.datingr4.shared.presentation.action.BaseAction. getUserId(BaseAction.java:653) at de.friendscout.datingr4.onlinearea.presentation.action.BaseOnl ineAreaAction.getSettings(BaseOnlineAreaAction.java:89)
RE: Pre-compiled JSPs?
Ah, I thought it was all too good to be true. Now that I have an understanding of how to put it all together, I have given it a go but hit another snag. Remember the use of the 'errorOnUseBeanInvalidClassAttribute' flag? Well, of course, that means that when the JSPs were turned into Java classes, they ignored the fact that the bean wasn't declared in that JSP and generated the classes regardless. What about when you try to compile the Java into a .class file? Suddenly, the Java is missing a variable declaration and cannot compile the class. Is there a way round this? If not, what's the point in including the flag?! Yours, Confused of UK. ;o) -Original Message- From: Richard Burman [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 13:50 To: Tomcat Users List Subject: RE: Pre-compiled JSPs? Eureka! I get it now. :) Indeed, I hadn't noticed the servlet-mapping section down the bottom. I looked at the xml and foolishly assumed that it merely repeated all the way to the bottom. Now that you've pointed out that, it all makes sense. Thanks for all your help, I shall have a play and hopefully have new, sparkly, compiled JSPs soon! Richard. -Original Message- From: Darryl L. Miles [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 12:33 To: Tomcat Users List Subject: Re: Pre-compiled JSPs? What you see looks like normal jasper name mangling of generated pages. You use: http://myserver:8080/RichardsApp/DoSomething.jsp I presume there is also a generated mapping entry, that you may have overlooked: servlet-mapping servlet-nameRichardsApp.DoSomething_jsp/servlet-name url-pattern/DoSomething.jsp/url-pattern /servlet-mapping Richard Burman wrote: Hi Nicolas, Thanks for your reply, I really appreciate your help. I'm not sure I fully understand your solution. I see now that the webXmlFragment provides a convenient way to generate the XML needed for the Servlets but that have bizarre names. Let's say I have a jsp: /RichardsApp/DoSomething.jsp Running Jasper at it provides a java file: /RichardsApp/DoSomething_jsp.java Then the Servlet definition would be: servlet servlet-nameRichardsApp.DoSomething_jsp/servlet-name servlet-classRichardsApp.DoSomething_jsp/servlet-class /servlet The way to reference my JSP used to be: http://myserver:8080/RichardsApp/DoSomething.jsp What would the new reference be? http://myserver:8080/RichardsApp/DoSomething_jsp or http://myserver:8080/RichardsApp/DoSomething Have I missed something obvious? Thanks for your help! Richard. -- Darryl L. Miles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Get user name from request.something()
When JDBCRealm is implemented, 1. after login, can the HttpServletRequest of Struts Action get the username? 2. after login, if user ever bookmarked a page or something, can Tomcat force the user go back to the beginning page? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why does tomcat redirect to welcome files
Thanks Mark, found some good info. Another question: Is is possible to force a forwards for welcome pages with Tomcat. Is there an engine setting for that? Or would I be forced to change the Tomcat source. I notice with other web servers (i.e. IIS) I can specify a default page which returns HTTP 200 code instead of redirect codes. Thanks -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Sunday, September 04, 2005 3:19 PM To: Tomcat Users List Subject: Re: Why does tomcat redirect to welcome files Jim Kennedy wrote: I have setup Tomcat to use index.html as the only welcome file. I noticed that the engine redirects to index.html. I'm wondering why that is the case. I would prefer Status: HTTP/1.1 200 OK Not: Status: HTTP/1.1 302 Moved Temporarily spec quote section=SRV.9.10 The container may send the request to the welcome resource with a forward, a redirect, or a container specific mechanism that is indistinguishable from a direct request. /spec-quote There is also the issue of security constraints. See http://marc.theaimsgroup.com/?l=tomcat-devm=110980317127394w=2 for a discussion. - 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]
How to stop Tomcat supplying HTML for statues
I have a server which is being used only for XML servlets. I would like to send back error responses either as an XML error or, in the case of a non-200 status code just to send back the status code and a single line text message. I set the status (which seems to work) and the text, which again seems to be sent back on the response header, but I also get a bunch of HTML text which gets in the way of processing the error text which I want to do using XmlHttpRequest. I have not included any ErrorPage tags in my web.xml nor are there any in the global web.xml. I am running Tomcat 5.5 Thanks in advance David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pre-compiled JSPs?
errorOnUseBeanInvalidClassAttribute (IIRC) is a test when jsp:useBean is used without a default constructor being available. If you are using include files which were as meant as compile time include fragments, rename them (the include files) to jspf and they will be ignored by the jsp compiler. -Tim Richard Burman wrote: Ah, I thought it was all too good to be true. Now that I have an understanding of how to put it all together, I have given it a go but hit another snag. Remember the use of the 'errorOnUseBeanInvalidClassAttribute' flag? Well, of course, that means that when the JSPs were turned into Java classes, they ignored the fact that the bean wasn't declared in that JSP and generated the classes regardless. What about when you try to compile the Java into a .class file? Suddenly, the Java is missing a variable declaration and cannot compile the class. Is there a way round this? If not, what's the point in including the flag?! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to stop Tomcat supplying HTML for statues
http://jakarta.apache.org/tomcat/faq/misc.html#error -Tim David Goodenough wrote: I have a server which is being used only for XML servlets. I would like to send back error responses either as an XML error or, in the case of a non-200 status code just to send back the status code and a single line text message. I set the status (which seems to work) and the text, which again seems to be sent back on the response header, but I also get a bunch of HTML text which gets in the way of processing the error text which I want to do using XmlHttpRequest. I have not included any ErrorPage tags in my web.xml nor are there any in the global web.xml. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
If I understand you correctly your scenario is: HashMap Entry has a linked list of X entries at one position and entry[Y] is poiting to the first entry instead of next or null? Correct. But how can that happen? a JVM / Core Api bug? The error is likely in webapp code, since the Servlet spec leaves it up to the webapp to implement thread safe setting and update of session objects. I haven't researched the HashMap source code to see exactly how this situation can come about, so I can't say exactly what to look for. Thus, the not terribly helpful advice is to examine for thread safety each location where the session is written. Ok understood, just to be sure. In a util class I do following: public void addBeanToSession(HttpServletRequest req, String beanName, Object beanValue){ HttpSession session = req.getSession(); synchronized(session){ session.setAttribute(beanName, beanValue); } } and replace all req.getSession().setAttribute(beanName, beanValue) in code with the call to this method (same for remove) and I've solved my problem? thanx for your help regards Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: With tomcat 5 redirects to a secure port the connection fails
Does anyone have a site that is running through a proxy? Could there be something I am missing because of that? -Original Message- From: Julie Moore [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 1:50 PM To: tomcat-user@jakarta.apache.org Subject: With tomcat 5 redirects to a secure port the connection fails I have updated a site from tomcat 4 to tomcat 5 and my link that used to redirect to a secure site now fails. I see the webpage tying to connect with my internal IP address instead of the external URL that the request came in one. If I connect to https://www.x.com and hit the link to the secure page my page displays correctly. But if I hit it from http://www.x.com http://www.x.com/ the secure page does not display. The page that displays has not changed. It has a relative link to the webapp that I want to have as secure. I have the server.xml connectors defined: Connector port=80 minThreads=150 maxSpareThreads=75 minSpareThreads=25 enableLookups=true redirectPort=443 acceptCount=100 debug=0 connectionTimeout=2 disableUploadTimeout=true / !-- Define a SSL Coyote HTTP/1.1 Connector on port 443 -- Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=c:\tomcat\conf\keystore.ks / and the following in the web.xml of my application I wish to have available only as secure: security-constraint web-resource-collection web-resource-nameEntire Application/web-resource-name url-pattern/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint What have I missed? Jmoore - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pre-compiled JSPs?
Sorry, I don't understand. How will my JSP compile at all if a section (fragment) is ignored and, presumably, omitted from the resulting java file? -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 15:05 To: Tomcat Users List Subject: Re: Pre-compiled JSPs? errorOnUseBeanInvalidClassAttribute (IIRC) is a test when jsp:useBean is used without a default constructor being available. If you are using include files which were as meant as compile time include fragments, rename them (the include files) to jspf and they will be ignored by the jsp compiler. -Tim Richard Burman wrote: Ah, I thought it was all too good to be true. Now that I have an understanding of how to put it all together, I have given it a go but hit another snag. Remember the use of the 'errorOnUseBeanInvalidClassAttribute' flag? Well, of course, that means that when the JSPs were turned into Java classes, they ignored the fact that the bean wasn't declared in that JSP and generated the classes regardless. What about when you try to compile the Java into a .class file? Suddenly, the Java is missing a variable declaration and cannot compile the class. Is there a way round this? If not, what's the point in including the flag?! - 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]
compile precompile jsps at runtime
Hi all, Is there a way to compile precompiled jsp at runtime? i.e., I want to precompiled my jsp before deployment, but after they are deployed I still want to make changes to the jsps that will take effect immediately. I want to be able to change jsp and see the changes immediately although they are precompiled Does anyone knows how to do it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get() and replace all req.getSession().setAttribute(beanName, beanValue) in code with the call to this method (same for remove) and I've solved my problem? Unfortunately, you also need to change the places that retrieve attributes from the Session, since the hash map is in a state of flux during the setAttribute() invocations. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat war expansion fails on .cvsignore file
Hi, I have a .cvsignore file at the top level of my war file. does anyone has any idea what this error message is about? This errors occurs when Tomcat is started up, expanding the war file under webapps. Thanks! Sep 6, 2005 5:09:30 AM org.apache.catalina.startup.HostConfig deployWARs WARNING: Exception while expanding web application archive magicbillboard.war Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location - find_vma failed Catalina.start using conf/server.xml: java.io.FileNotFoundException: /opt/lampp/webapps/magicbillboard/.cvsignore (No such file or directory) java.io.FileNotFoundException: /opt/lampp/webapps/magicbillboard/.cvsignore (No such file or directory) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566) at org.apache.commons.digester.Digester.startElement(Digester.java:1276)
Re: Pre-compiled JSPs?
For example: File a.jsp % String worldVar = null; % [EMAIL PROTECTED] file='b.jsp'% Hello %=worldVar% File b.jsp %worldVar = world% Notice b.jsp will not precompile. But then again - no one should be calling b.jsp since its not a jsp - its a jsp fragment. It should be calld b.jspf. I am guessing - your pages have a similar issue. -Tim Richard Burman wrote: Sorry, I don't understand. How will my JSP compile at all if a section (fragment) is ignored and, presumably, omitted from the resulting java file? -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 15:05 To: Tomcat Users List Subject: Re: Pre-compiled JSPs? errorOnUseBeanInvalidClassAttribute (IIRC) is a test when jsp:useBean is used without a default constructor being available. If you are using include files which were as meant as compile time include fragments, rename them (the include files) to jspf and they will be ignored by the jsp compiler. -Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: compile precompile jsps at runtime
Can't with tomcat out of the box. -Tim Zachi Hazan wrote: Hi all, Is there a way to compile precompiled jsp at runtime? i.e., I want to precompiled my jsp before deployment, but after they are deployed I still want to make changes to the jsps that will take effect immediately. I want to be able to change jsp and see the changes immediately although they are precompiled Does anyone knows how to do it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat war expansion fails on .cvsignore file
I think you can't have that file there as the war files have to follow a certain structure. -Original Message- From: Ben Wong [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 15:56 To: tomcat-user@jakarta.apache.org Subject: tomcat war expansion fails on .cvsignore file Hi, I have a .cvsignore file at the top level of my war file. does anyone has any idea what this error message is about? This errors occurs when Tomcat is started up, expanding the war file under webapps. Thanks! Sep 6, 2005 5:09:30 AM org.apache.catalina.startup.HostConfig deployWARs WARNING: Exception while expanding web application archive magicbillboard.war Java HotSpot(TM) Client VM warning: Can't detect initial thread stack location - find_vma failed Catalina.start using conf/server.xml: java.io.FileNotFoundException: /opt/lampp/webapps/magicbillboard/.cvsignore (No such file or directory) java.io.FileNotFoundException: /opt/lampp/webapps/magicbillboard/.cvsignore (No such file or directory) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540) at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566) at org.apache.commons.digester.Digester.startElement(Digester.java:1276) ___ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pre-compiled JSPs?
Hi Tim, Yeah, that's my exact issue, except the pages somewhat more complicated than your example. ;o) I've tried renaming one of them to jspf and, unsurprisingly, it has been ignored by the JSP compiler. I'll have to take your word that it would still work in the parent (once the reference had been changed to point to jspf, not jsp) as I don't have a test bed up and running at the moment. Okay, so we've ascertained how to avoid the 'fragments' being compiled because they're effectively not valid JSP pages because they use beans that are never declared within themselves. The 'parent' page will compile because it has all it needs to be compiled but the fragment cannot be compiled without the presence of the parent. Does this mean that I can only include the 'parent' JSPs in my JAR file and included in my web.xml? Do I have to keep the fragments as raw JSPs in my webapp, then? I'd really rather get them all together in a JAR, if possible, which is why I'm on this voyage of discovery! :o) I really appreciate your help with this. Regards, Richard. -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 15:57 To: Tomcat Users List Subject: Re: Pre-compiled JSPs? For example: File a.jsp % String worldVar = null; % [EMAIL PROTECTED] file='b.jsp'% Hello %=worldVar% File b.jsp %worldVar = world% Notice b.jsp will not precompile. But then again - no one should be calling b.jsp since its not a jsp - its a jsp fragment. It should be calld b.jspf. I am guessing - your pages have a similar issue. -Tim Richard Burman wrote: Sorry, I don't understand. How will my JSP compile at all if a section (fragment) is ignored and, presumably, omitted from the resulting java file? -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 15:05 To: Tomcat Users List Subject: Re: Pre-compiled JSPs? errorOnUseBeanInvalidClassAttribute (IIRC) is a test when jsp:useBean is used without a default constructor being available. If you are using include files which were as meant as compile time include fragments, rename them (the include files) to jspf and they will be ignored by the jsp compiler. -Tim - 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: compile precompile jsps at runtime
So, how can I do it with tomcat not out of the box? Tim Funk wrote: Can't with tomcat out of the box. -Tim Zachi Hazan wrote: Hi all, Is there a way to compile precompiled jsp at runtime? i.e., I want to precompiled my jsp before deployment, but after they are deployed I still want to make changes to the jsps that will take effect immediately. I want to be able to change jsp and see the changes immediately although they are precompiled Does anyone knows how to do it? - 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: Pre-compiled JSPs?
From the jasper task all the [valid] jsp's are turned into java files and compiled into class files. Those class files need to be a jar file in WEB-INF/lib or inside WEB-INF/classes. The jasper task can also rewrite web.xml so that all the mappings from the JSP -- class file are taken care of. Once all the jsp's are compiled and mapped in web.xml. They can be deleted from the deployment war file (or dir). -Tim Richard Burman wrote: Hi Tim, Yeah, that's my exact issue, except the pages somewhat more complicated than your example. ;o) I've tried renaming one of them to jspf and, unsurprisingly, it has been ignored by the JSP compiler. I'll have to take your word that it would still work in the parent (once the reference had been changed to point to jspf, not jsp) as I don't have a test bed up and running at the moment. Okay, so we've ascertained how to avoid the 'fragments' being compiled because they're effectively not valid JSP pages because they use beans that are never declared within themselves. The 'parent' page will compile because it has all it needs to be compiled but the fragment cannot be compiled without the presence of the parent. Does this mean that I can only include the 'parent' JSPs in my JAR file and included in my web.xml? Do I have to keep the fragments as raw JSPs in my webapp, then? I'd really rather get them all together in a JAR, if possible, which is why I'm on this voyage of discovery! :o) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: compile precompile jsps at runtime
A lot of custom coding on your own. You'd need a filter which traps all your precompiled servlet mappings and then checks to see of the jsp the file was mapped to has changed. Then you'd need to somehow manage compiling the JSP and loading the class file while ignoring the existing mapping. In a nutshell ... not pretty. Or you can have tomcat run in production mode (for the jsp servlet) and all the jsp's get compiled in the background when they are changed. But this relies on jsps NOT being precompiled. -Tim Zachi Hazan wrote: So, how can I do it with tomcat not out of the box? Tim Funk wrote: Can't with tomcat out of the box. -Tim Zachi Hazan wrote: Hi all, Is there a way to compile precompiled jsp at runtime? i.e., I want to precompiled my jsp before deployment, but after they are deployed I still want to make changes to the jsps that will take effect immediately. I want to be able to change jsp and see the changes immediately although they are precompiled Does anyone knows how to do it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Source code for naming-factory-dbcp.jar ?
Where is the source code that makes up the JAR naming-factory-dbcp.jar it does not appear to be inside: jakarta-tomcat-5.5.9-src.tar.gz -- Darryl L. Miles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[SOLVED] Tomcat/JVM hangs in session.getAttribute / HashMap.get()
Chuck, Larry thanx. regards Leon On Tue, 2005-09-06 at 09:53 -0500, Caldarale, Charles R wrote: From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get() and replace all req.getSession().setAttribute(beanName, beanValue) in code with the call to this method (same for remove) and I've solved my problem? Unfortunately, you also need to change the places that retrieve attributes from the Session, since the hash map is in a state of flux during the setAttribute() invocations. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - 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: compile precompile jsps at runtime
From: Zachi Hazan [mailto:[EMAIL PROTECTED] Subject: Re: compile precompile jsps at runtime So, how can I do it with tomcat not out of the box? One approach would be to cheat! Tomcat compiles the page when the page is first invoked. So, you could for example define a special parameter as part of the query string (such as 'precompile=true') and modify the code for each page so that if the parameter is found, the page does nothing. However, Tomcat has still compiled it. Then all you need is some kind of script (using cURL or a similar tool) that fetches each page and adds a '?precompile=true' suffix. Deploy, run the script, and all your pages are precompiled. Low-tech, I agree, and I suspect others on the list will be able to come up with a better approach. - Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
Guys, I have been watching this thread with interest. Does this mean that all session.setAttribute() and session.getAttribute() should always be synchronised (for instance, inside a servlet or struts action) provided the same hashmap is accessed by say more than one servlet/struts action? Kind regards... Arup Vidyerthy. -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 15:54 To: Tomcat Users List Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get() From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get() and replace all req.getSession().setAttribute(beanName, beanValue) in code with the call to this method (same for remove) and I've solved my problem? Unfortunately, you also need to change the places that retrieve attributes from the Session, since the hash map is in a state of flux during the setAttribute() invocations. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pre-compiled JSPs?
Tim, Is there no way of turning the fragment (jspf) file into .class files or do they need to remain as JSPs? Cheers, Richard. -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 16:14 To: Tomcat Users List Subject: Re: Pre-compiled JSPs? From the jasper task all the [valid] jsp's are turned into java files and compiled into class files. Those class files need to be a jar file in WEB-INF/lib or inside WEB-INF/classes. The jasper task can also rewrite web.xml so that all the mappings from the JSP -- class file are taken care of. Once all the jsp's are compiled and mapped in web.xml. They can be deleted from the deployment war file (or dir). -Tim Richard Burman wrote: Hi Tim, Yeah, that's my exact issue, except the pages somewhat more complicated than your example. ;o) I've tried renaming one of them to jspf and, unsurprisingly, it has been ignored by the JSP compiler. I'll have to take your word that it would still work in the parent (once the reference had been changed to point to jspf, not jsp) as I don't have a test bed up and running at the moment. Okay, so we've ascertained how to avoid the 'fragments' being compiled because they're effectively not valid JSP pages because they use beans that are never declared within themselves. The 'parent' page will compile because it has all it needs to be compiled but the fragment cannot be compiled without the presence of the parent. Does this mean that I can only include the 'parent' JSPs in my JAR file and included in my web.xml? Do I have to keep the fragments as raw JSPs in my webapp, then? I'd really rather get them all together in a JAR, if possible, which is why I'm on this voyage of discovery! :o) - 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.5 classloader log4j vs JCL issue
hihi Paul, i tried your suggestion but it still did not work. however, i finally found out why. the problem web application had the following code: try { System.setProperty(org.apache.commons.logging.Log, org.apache.commons.logging.impl.Log4JCategoryLog); } catch (java.security.AccessControlException e) { logCat.warn(Unable map commons-logging to Log4j, due to SecurityManager, e); } this piece of code seems like the ultimate way of setting the logging system. at least this was the effect it had in my case. (perhaps it was executed last... definitely after your listener code) in any case, once i commented out this bit of code everything was fine again, and i did not have to put the combination log4j.jar and commons-logging.jar into the ${Tomcat}/common/lib folder. i was able to place them in the relevant web app's WEB-INF/lib folder and my other web apps were undisturbed! yay! :) thanks again for your help, Paul! woodchuck --- Paul Austin [EMAIL PROTECTED] wrote: Woodchuck, The following web page describes this situation and a solution to the problem. http://www.qos.ch/logging/sc.jsp I have attached the solution that I created this week based on the information above. To compile you will need servlet-api.jar and log4j.jar to compile. Include the jar you create from these files in your web application and then in your web.xml include the following sections. This section can be used if your log4j.xml is not under /WEB-INF/log4j.xml context-param param-namelog4jXmlLocation/param-name param-value/WEB-INF/log4j.xml/param-value /context-param The following calls invokes the listerner when the web app starts up to create a separate logging context for the web application. listener listener-classcom.revolsys.logging.log4j.Log4jServletContextListener/listener-class /listener Also make sure you have a listener that does the following when the context is destroyed otherwise you'll get a log of PermGen out of memory errors after a number of redeploys Introspector.flushCaches(); LogFactory.getFactory().release(); Good luck, Paul On Wed, 2005-08-31 at 13:03 -0700, Woodchuck wrote: hihi all, on my TC 5.5.9 installation i deployed several web applications that uses the default JCL logging. that is, i placed a simple logging.properties file into each web app's WEB-INF/classes folder and i have per web app logging. everything works beautifully. then i installed a new web app that forced me to place commons-logging.jar and log4j.jar into the ${Tomcat}/common/lib folder. as a result, all my previous per web app logging no longer works. i believe this is because log4j was discovered in the ${Tomcat}/common/lib first, and therefore it has superceeded any other logging system at the (lower) web app level. this is due to Tomcat's classloading process. the reason this new web app required commons-logging.jar and log4j.jar to be placed specifically into the ${Tomcat}/commons/lib folder is because it instantiates a log4j logger object in it's start-up servlet which extends HttpServlet which is found in the servlet-api.jar which is also in the ${Tomcat}/commons/lib folder. this is because Tomcat's classloading hierarchy dictates that classes in the common/lib cannot see web app classes 'downstream'. does anyone have any suggestions on how i can have per web app logging again? i would like to keep my deployment process as web app isolated as possible (ie. each web app deployed by WAR, drop it in and that's it, no further steps necessary). thanks in advance, woodchuck Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] /* * Copyright 2005 Revolution Systems Inc. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.revolsys.logging.log4j; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Hierarchy; import org.apache.log4j.Level; import org.apache.log4j.LogManager; import org.apache.log4j.spi.LoggerRepository; import
RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
seems so:-) I just wrote an util class, you may use it if you need :-) HTH Leon package xxx-omitted-xxx; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.jsp.PageContext; import org.apache.log4j.Logger; public class BeanUtil { private static Logger logger; public static void setLogger(Logger aLogger){ logger = aLogger; } public static Logger getLogger(){ return logger; } public static void addBeanToSessionUnsafe( HttpServletRequest request, String key, Object value) { addBean(request, PageContext.SESSION_SCOPE, key, value); } public static void addBeanToApplication( HttpServletRequest request, String key, Object value) { addBean(request, PageContext.APPLICATION_SCOPE, key, value); } public static void addBeanToRequest( HttpServletRequest request, String key, Object value) { addBean(request, PageContext.REQUEST_SCOPE, key, value); } public static Object getBeanFromSessionUnsafe( HttpServletRequest request, String key) { return getBean(request, PageContext.SESSION_SCOPE, key); } public static Object getBeanFromApplication( HttpServletRequest request, String key) { return getBean(request, PageContext.APPLICATION_SCOPE, key); } public static Object getBeanFromRequest( HttpServletRequest request, String key) { return getBean(request, PageContext.REQUEST_SCOPE, key); } public static void removeBeanFromSessionUnsafe( HttpServletRequest request, String key) { removeBean(request, PageContext.SESSION_SCOPE, key); } public static void removeBeanFromApplication( HttpServletRequest request, String key) { removeBean(request, PageContext.APPLICATION_SCOPE, key); } public static void removeBeanFromRequest( HttpServletRequest request, String key) { removeBean(request, PageContext.REQUEST_SCOPE, key); } public static void addBean( HttpServletRequest request, int scope, String key, Object value) { switch (scope) { case PageContext.APPLICATION_SCOPE : if (logger!=null) logger.debug(addBean + key + to APPLICATION_SCOPE, value= + value); request.getSession().getServletContext().setAttribute(key, value); break; case PageContext.SESSION_SCOPE : if (logger!=null) logger.debug(addBean + key + to SESSION_SCOPE, value= + value); request.getSession().setAttribute(key, value); break; case PageContext.REQUEST_SCOPE : if (logger!=null) logger.debug(addBean + key + to REQUEST_SCOPE, value= + value); request.setAttribute(key, value); break; default : throw new RuntimeException(Unknown scope: + scope); } } public static Object getBean(HttpServletRequest request,int scope, String key) { switch (scope) { case PageContext.APPLICATION_SCOPE : return request.getSession().getServletContext().getAttribute(key); case PageContext.SESSION_SCOPE : return request.getSession().getAttribute(key); case PageContext.REQUEST_SCOPE : return request.getAttribute(key); default : throw new RuntimeException(Unknown scope: + scope); } } public static void removeBean(HttpServletRequest request, int scope, String key) { switch (scope) { case PageContext.APPLICATION_SCOPE : request.getSession().getServletContext().removeAttribute(key); break; case PageContext.SESSION_SCOPE :
RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
From: Arup Vidyerthy [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get() Does this mean that all session.setAttribute() and session.getAttribute() should always be synchronised That's the conclusion I'm reluctantly coming to, if there is the possibility of multiple threads updating the same session simultaneously. Luckily, you would think that most operations would really be request, not session, related. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pre-compiled JSPs?
There is no need to turn jspf into classes. The jspf are included by real jsp files. Those jsp files are turned into the class files. -Tim Richard Burman wrote: Tim, Is there no way of turning the fragment (jspf) file into .class files or do they need to remain as JSPs? Cheers, Richard. -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 06 September 2005 16:14 To: Tomcat Users List Subject: Re: Pre-compiled JSPs? From the jasper task all the [valid] jsp's are turned into java files and compiled into class files. Those class files need to be a jar file in WEB-INF/lib or inside WEB-INF/classes. The jasper task can also rewrite web.xml so that all the mappings from the JSP -- class file are taken care of. Once all the jsp's are compiled and mapped in web.xml. They can be deleted from the deployment war file (or dir). -Tim Richard Burman wrote: Hi Tim, Yeah, that's my exact issue, except the pages somewhat more complicated than your example. ;o) I've tried renaming one of them to jspf and, unsurprisingly, it has been ignored by the JSP compiler. I'll have to take your word that it would still work in the parent (once the reference had been changed to point to jspf, not jsp) as I don't have a test bed up and running at the moment. Okay, so we've ascertained how to avoid the 'fragments' being compiled because they're effectively not valid JSP pages because they use beans that are never declared within themselves. The 'parent' page will compile because it has all it needs to be compiled but the fragment cannot be compiled without the presence of the parent. Does this mean that I can only include the 'parent' JSPs in my JAR file and included in my web.xml? Do I have to keep the fragments as raw JSPs in my webapp, then? I'd really rather get them all together in a JAR, if possible, which is why I'm on this voyage of discovery! :o) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get()
On Tue, 2005-09-06 at 11:00 -0500, Caldarale, Charles R wrote: From: Arup Vidyerthy [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat/JVM hangs in session.getAttribute / HashMap.get() Does this mean that all session.setAttribute() and session.getAttribute() should always be synchronised That's the conclusion I'm reluctantly coming to, if there is the possibility of multiple threads updating the same session simultaneously. Luckily, you would think that most operations would really be request, not session, related. clearly, 90% are in the request or even page scope, but 10% you have in session (like locale, user related info like authentification or granted permissions) are needed on each request (at least we do :-)) on the other hand it encourages me to work sessionless in the future... (*dreaming*) regards Leon - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - 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/JVM hangs in session.getAttribute / HashMap.get()
It seems possible to be that one user simply pressing the reload button a few times quickly while the same page is not yet loaded can cause sync problems to his own session; and you can't control the user. Err... does anybody have a replacement class for HttpServlet ? A simple access wrapper class would only protect co-operative users of it, a replacement for HttpServlet would protect all users and persist across requests. It seems like the general case needs to use one, while only performance optimized case would be able to make do with the current one. While I agree developers should have access to low level classes to get raw performance, I don't agree that the normal case should expose such a basic design error. HTTP is designed to specifically allow simultaneous requests to be processed at the same time. With a replacement class for HttpServlet you'd be better of using a ReadWriteLock to protect access, which allows for threading of the common read access case. Tut, tut. Arup Vidyerthy wrote: I have been watching this thread with interest. Does this mean that all session.setAttribute() and session.getAttribute() should always be synchronised (for instance, inside a servlet or struts action) provided the same hashmap is accessed by say more than one servlet/struts action? -- Darryl L. Miles - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: isapi_redirect dll location
Yes, the install creates the folders, copies the configuration files and the dll, modifies the registry and adds the isapi filter to IIS. It does NOT add the dll to the Windows 2003 / IIS6 Web Extensions, though. I am not sure whether this is necessary. Tracy -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Saturday, September 03, 2005 7:47 PM To: 'Tomcat Users List'; [EMAIL PROTECTED] Subject: RE: isapi_redirect dll location First off - thank you. Second there is a isapi_redirect-1.2.14.exe file also - does this do a complete install of the dll? Thanks - dave David Thielen 303-499-2544 www.windwardreports.com -Original Message- From: Steve Ochani [mailto:[EMAIL PROTECTED] Sent: Saturday, September 03, 2005 4:12 PM To: tomcat-user@jakarta.apache.org Subject: isapi_redirect dll location To whomever was looking for isapi_redirect dll: As much as I hate to promote IIS: isapi_redirect dll can be found here http://apache.towardex.com/jakarta/tomcat-connectors/jk/binaries/win32/jk-1. 2.14 «¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤»§«¤»¥«¤» Education is what remains after one has forgotten everything he learned in school. -Albert Einstein Steve O. http://www.steveo.us New pics: B17G and B24 http://www.steveo.us/B17-B24/ B17G WWII Bomber Yankee Lady Flight I took http://www.steveo.us/b17ride SUNY NCC Physical Sciences Dept. Network Admin SUNY NCC MATH/COMPUTER Unix Admin http://www.matcmp.ncc.edu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JAAS Configuration Issue
Hi there! I'm using Tomcat 5.5.9 and JDK 1.5.0 and I was probbing to implement a JAAS Authentication mechanism for may webapps. I followed some tutorials and the Tomcat 5.5 JAASRealm configuration and I did it in that way. I updated the java.policy file with the next lines: grant codeBase file:/usr/local/java/server/tomcat/* { permission java.security.AllPermission; }; Now I try to start tomcat with the -security flag and I get long stack trace of exceptions, this is how it begins: WARN - MethodUtils.getMatchingAccessibleMethod(583) | Cannot use JVM pre-1.4access bug workaround die to restrictive security manager. Sep 6, 2005 7:16:55 PM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Sep 6, 2005 7:16:55 PM org.apache.catalina.core.StandardContext start SEVERE: Context [/balancer] startup failed due to previous errors Sep 6, 2005 7:16:56 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Sep 6, 2005 7:16:56 PM org.apache.catalina.core.StandardPipelineregisterValve INFO: Can't register valve [EMAIL PROTECTED] org.apache.commons.logging.LogConfigurationException: java.lang.ExceptionInInitializerError (Caused by java.lang.ExceptionInInitializerError) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance( LogFactoryImpl.java:538) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance( LogFactoryImpl.java:235) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:380) at org.apache.catalina.valves.ValveBase.createObjectName(ValveBase.java:242) at org.apache.catalina.core.StandardPipeline.registerValve( StandardPipeline.java:296) at org.apache.catalina.core.StandardPipeline.start(StandardPipeline.java :233) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4045) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:683) at org.apache.catalina.startup.Catalina.start(Catalina.java:537) 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:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) Caused by: java.lang.ExceptionInInitializerError at org.apache.log4j.Logger.getLogger(Logger.java:94) at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java :229) at org.apache.commons.logging.impl.Log4JLogger.init(Log4JLogger.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance( LogFactoryImpl.java:529) ... 20 more Caused by: java.security.AccessControlException: access denied ( java.io.FilePermission /var/log/tomcat/www.interlogical.com.log write) at java.security.AccessControlContext.checkPermission( AccessControlContext.java:264) at java.security.AccessController.checkPermission(AccessController.java:427) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkWrite(SecurityManager.java:962) at java.io.FileOutputStream.init(FileOutputStream.java:169) at java.io.FileOutputStream.init(FileOutputStream.java:102) at org.apache.log4j.FileAppender.setFile(FileAppender.java:273) at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:152) at org.apache.log4j.DailyRollingFileAppender.activateOptions( DailyRollingFileAppender.java:206) at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java :123) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java :87) at org.apache.log4j.PropertyConfigurator.parseAppender( PropertyConfigurator.java:645) at org.apache.log4j.PropertyConfigurator.parseCategory( PropertyConfigurator.java:603) at org.apache.log4j.PropertyConfigurator.configureRootCategory( PropertyConfigurator.java:500) at org.apache.log4j.PropertyConfigurator.doConfigure( PropertyConfigurator.java:406) at org.apache.log4j.PropertyConfigurator.doConfigure( PropertyConfigurator.java:432) at
Re: How to stop Tomcat supplying HTML for statues
No, this is the reverse of what I want. I want to STOP it sending an HTML page, rather than the error-page tag to set it. David On Tuesday 06 September 2005 15:06, Tim Funk wrote: http://jakarta.apache.org/tomcat/faq/misc.html#error -Tim David Goodenough wrote: I have a server which is being used only for XML servlets. I would like to send back error responses either as an XML error or, in the case of a non-200 status code just to send back the status code and a single line text message. I set the status (which seems to work) and the text, which again seems to be sent back on the response header, but I also get a bunch of HTML text which gets in the way of processing the error text which I want to do using XmlHttpRequest. I have not included any ErrorPage tags in my web.xml nor are there any in the global web.xml. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to stop Tomcat supplying HTML for statues
Then make the error page a jsp which clears the stream and prints what you want. If your servlet already prints what you need, then force the buffer to be flushed so that the response is committed and an error page is not shown. -Tim David Goodenough wrote: No, this is the reverse of what I want. I want to STOP it sending an HTML page, rather than the error-page tag to set it. David On Tuesday 06 September 2005 15:06, Tim Funk wrote: http://jakarta.apache.org/tomcat/faq/misc.html#error -Tim David Goodenough wrote: I have a server which is being used only for XML servlets. I would like to send back error responses either as an XML error or, in the case of a non-200 status code just to send back the status code and a single line text message. I set the status (which seems to work) and the text, which again seems to be sent back on the response header, but I also get a bunch of HTML text which gets in the way of processing the error text which I want to do using XmlHttpRequest. I have not included any ErrorPage tags in my web.xml nor are there any in the global web.xml. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.5 classloader log4j vs JCL issue
hihi Seva, yes, your suggestion also works. i tried it to confirm, and it was my backup plan to do in case i couldn't figure out how to *not* place log4j.jar and commons-logging.jar into the ${Tomcat}/common/lib folder. just fyi, it's also possible to centralize logging for the entire servlet container by having the log4j.properties file in ${Tomcat}/common/classes (and the log4j.jar in ${Tomcat}/common/lib). this way, it is not necessary to put log4j.jar in each web app's WEB-INF/lib folder, nor the log4j.properties file in each web app's WEB-INF/classes folder. centralize, as in one log4j.properties file and one log4j.jar file. yet, Tomcat and each web app can still maintain their own separate log files! i've tested this and it works as well. woodchuck --- Seva Popov [EMAIL PROTECTED] wrote: Woodchuck, I guess, the alternative solution is to have all your web apps use log4j as well. So, you have commons-logging.jar and log4j.jar in the ${Tomcat}/common/lib folder and log4j.properties in ${Tomcat}/common/classes folder. Just add into your each web app's WEB-INF/classes folder log4j.properties file and into WEB-INF/lib folder log4j.jar. This way both Tomcat and your web apps will use separate log4j configurations. Thanks, Seva From: Paul Austin [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 31, 2005 1:30 PM To: Tomcat Users List Subject: Re: Tomcat 5.5 classloader log4j vs JCL issue Woodchuck, The following web page describes this situation and a solution to the problem. http://www.qos.ch/logging/sc.jsp I have attached the solution that I created this week based on the information above. To compile you will need servlet-api.jar and log4j.jar to compile. Include the jar you create from these files in your web application and then in your web.xml include the following sections. This section can be used if your log4j.xml is not under /WEB-INF/log4j.xml context-param param-namelog4jXmlLocation/param-name param-value/WEB-INF/log4j.xml/param-value /context-param The following calls invokes the listerner when the web app starts up to create a separate logging context for the web application. listener listener-classcom.revolsys.logging.log4j.Log4jServletContextListener/ listener-class /listener Also make sure you have a listener that does the following when the context is destroyed otherwise you'll get a log of PermGen out of memory errors after a number of redeploys Introspector.flushCaches(); LogFactory.getFactory().release(); Good luck, Paul On Wed, 2005-08-31 at 13:03 -0700, Woodchuck wrote: hihi all, on my TC 5.5.9 installation i deployed several web applications that uses the default JCL logging. that is, i placed a simple logging.properties file into each web app's WEB-INF/classes folder and i have per web app logging. everything works beautifully. then i installed a new web app that forced me to place commons-logging.jar and log4j.jar into the ${Tomcat}/common/lib folder. as a result, all my previous per web app logging no longer works. i believe this is because log4j was discovered in the ${Tomcat}/common/lib first, and therefore it has superceeded any other logging system at the (lower) web app level. this is due to Tomcat's classloading process. the reason this new web app required commons-logging.jar and log4j.jar to be placed specifically into the ${Tomcat}/commons/lib folder is because it instantiates a log4j logger object in it's start-up servlet which extends HttpServlet which is found in the servlet-api.jar which is also in the ${Tomcat}/commons/lib folder. this is because Tomcat's classloading hierarchy dictates that classes in the common/lib cannot see web app classes 'downstream'. does anyone have any suggestions on how i can have per web app logging again? i would like to keep my deployment process as web app isolated as possible (ie. each web app deployed by WAR, drop it in and that's it, no further steps necessary). thanks in advance, woodchuck Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Click here to donate to the Hurricane Katrina relief effort. http://store.yahoo.com/redcross-donate3/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JK 1.2.14.1 SIG BUS Error on Solaris 9
On 9/2/05, Guernsey, Byron (GE Consumer Industrial) [EMAIL PROTECTED] wrote: I apoligize for adding to this, but I'm hoping to jar someones memory. I gdb'ed the process now and the BUS error occurs in: snip Program received signal SIGBUS, Bus error. 0xfdfb4208 in service (e=0xf7c90, s=0xfe501848, l=0x118b40, is_error=0xfe500840) at jk_lb_worker.c:605 jk_lb_worker.c:605: No such file or directory. (gdb) bt #0 0xfdfb4208 in service (e=0xf7c90, s=0xfe501848, l=0x118b40, is_error=0xfe500840) at jk_lb_worker.c:605 That is the exact same core dump and back trace that I reported a while back when running on SGI Irix. Could be a 64bit or big endian problem? http://marc.theaimsgroup.com/?l=tomcat-devm=112501659012202w=2 -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JK 1.2.14.1 SIG BUS Error on Solaris 9
On 9/6/05, David Rees [EMAIL PROTECTED] wrote: That is the exact same core dump and back trace that I reported a while back when running on SGI Irix. Could be a 64bit or big endian problem? http://marc.theaimsgroup.com/?l=tomcat-devm=112501659012202w=2 I've opened a bug for this issue: http://issues.apache.org/bugzilla/show_bug.cgi?id=36525 -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache httpd Tomcat 5 and SSL
I'm using mod_jk to connect httpd and two Tomcat servers running on different ports. Apache httpd is acting as the front end and mod_jk is setup to failover to the second tomcat instance in the event that the first one goes down. Tomcat is running our own application servlet. Before I post all my configurations and detailed explanation, I'll just ask are there any good How-Tos or examples of dealing with SSL in this situation. Should SSL even be turned on in Apache httpd? All I need Apache httpd to do is pass the client traffic to Tomcat and back. James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
list
list The information contained in this communication may be CONFIDENTIAL and is intended only for the use of the recipient(s) named above. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please notify the sender and delete/destroy the original message and any copy of it from your computer or paper files.
RE: Tomcat 5.5 classloader log4j vs JCL issue
Yes it it possible to centralize the logging for the entire container including all web apps. However, this seems to be a bad practice. The better approach is to separate the container internal logging and the web apps logging. But I guess you know this for yourself. -Original Message- From: Woodchuck [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 11:10 AM To: Tomcat Users List; Seva Popov Subject: RE: Tomcat 5.5 classloader log4j vs JCL issue hihi Seva, yes, your suggestion also works. i tried it to confirm, and it was my backup plan to do in case i couldn't figure out how to *not* place log4j.jar and commons-logging.jar into the ${Tomcat}/common/lib folder. just fyi, it's also possible to centralize logging for the entire servlet container by having the log4j.properties file in ${Tomcat}/common/classes (and the log4j.jar in ${Tomcat}/common/lib). this way, it is not necessary to put log4j.jar in each web app's WEB-INF/lib folder, nor the log4j.properties file in each web app's WEB-INF/classes folder. centralize, as in one log4j.properties file and one log4j.jar file. yet, Tomcat and each web app can still maintain their own separate log files! i've tested this and it works as well. woodchuck --- Seva Popov [EMAIL PROTECTED] wrote: Woodchuck, I guess, the alternative solution is to have all your web apps use log4j as well. So, you have commons-logging.jar and log4j.jar in the ${Tomcat}/common/lib folder and log4j.properties in ${Tomcat}/common/classes folder. Just add into your each web app's WEB-INF/classes folder log4j.properties file and into WEB-INF/lib folder log4j.jar. This way both Tomcat and your web apps will use separate log4j configurations. Thanks, Seva From: Paul Austin [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 31, 2005 1:30 PM To: Tomcat Users List Subject: Re: Tomcat 5.5 classloader log4j vs JCL issue Woodchuck, The following web page describes this situation and a solution to the problem. http://www.qos.ch/logging/sc.jsp I have attached the solution that I created this week based on the information above. To compile you will need servlet-api.jar and log4j.jar to compile. Include the jar you create from these files in your web application and then in your web.xml include the following sections. This section can be used if your log4j.xml is not under /WEB-INF/log4j.xml context-param param-namelog4jXmlLocation/param-name param-value/WEB-INF/log4j.xml/param-value /context-param The following calls invokes the listerner when the web app starts up to create a separate logging context for the web application. listener listener-classcom.revolsys.logging.log4j.Log4jServletContextListener/ listener-class /listener Also make sure you have a listener that does the following when the context is destroyed otherwise you'll get a log of PermGen out of memory errors after a number of redeploys Introspector.flushCaches(); LogFactory.getFactory().release(); Good luck, Paul On Wed, 2005-08-31 at 13:03 -0700, Woodchuck wrote: hihi all, on my TC 5.5.9 installation i deployed several web applications that uses the default JCL logging. that is, i placed a simple logging.properties file into each web app's WEB-INF/classes folder and i have per web app logging. everything works beautifully. then i installed a new web app that forced me to place commons-logging.jar and log4j.jar into the ${Tomcat}/common/lib folder. as a result, all my previous per web app logging no longer works. i believe this is because log4j was discovered in the ${Tomcat}/common/lib first, and therefore it has superceeded any other logging system at the (lower) web app level. this is due to Tomcat's classloading process. the reason this new web app required commons-logging.jar and log4j.jar to be placed specifically into the ${Tomcat}/commons/lib folder is because it instantiates a log4j logger object in it's start-up servlet which extends HttpServlet which is found in the servlet-api.jar which is also in the ${Tomcat}/commons/lib folder. this is because Tomcat's classloading hierarchy dictates that classes in the common/lib cannot see web app classes 'downstream'. does anyone have any suggestions on how i can have per web app logging again? i would like to keep my deployment process as web app isolated as possible (ie. each web app deployed by WAR, drop it in and that's it, no further steps necessary). thanks in advance, woodchuck Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connectiong tomcat to IIS - no luck and conflicting info
Hi; I am trying to connect Tomcat 5.5 to IIS 5.1 and having zero luck. Here is what I did: 1. Went to http://apache.towardex.com/jakarta/tomcat-connectors/jk/binaries/win32/jk-1. 2.14 2. Downloaded ran isapi_redirect-1.2.14.exe 3. Added isapi_redirect as an ISAPI filter to the default website. When I try to bring up the page http://localhost/jkstatus I get the following in my IIS log: 20:19:47 127.0.0.1 GET /jkstatus 404 So it's not even calling isapi_redirect.dll. The installer did create the jakarta virtual directory and some registry entries. (I believe that even if all of my tomcat settings are wrong - it should still be calling isapi_redirect.) I'm stuck now. The book Pro Jakarta Tomcat 5 discusses setting this up using isapi_redirect2.dll and using registry entries that have a 2.0 node in them. But I can't find any metion of this anywhere else. The isapi_redirect installer doesn't have any documentation. On the jakarta website I can't find any 5.x specific install instructions. I've done this successfully for Tomcat 4.x - see http://dave.thielen.com/articles/Configuring%20Tomcat%20to%20work%20with%20I IS.doc but these instructions don't match the contents of the config files for 5.5. So what should I try next? Thanks - dave
Tomcat Deploy issue with v 5.0.30
Hello - I'm running into an autodeploy issue with Tomcat 5.0.30. In our tomcat install we are running two applications both of which are .war archives and reside in $TOMCAT_HOME/webapps/. The issue I'm seeing is when I run a fresh install of tomcat and drop in our application .war files, on the initial startup and before Tomcat is fully up I try to access the url to either one of the applications, Tomcat seems to stop deploying the application files at random times (sometimes WEB-INF files, sometimes .css, or .js files). Even on a restart Tomcat does not redeploy the missing files. I've tried not unpacking the .war by setting unpackWARs=false, in my server.xml files. Under this condition, if I starting hitting an application URL before tomcat is fully started up, Tomcat seems not to register the welcome-file-list, in the application web.xml and is displaying the tomcat's directory structure. Setup: OS: Windows Version 5.0.30 Tomcat is installed at C://Program Files/Company/tomcat/ and is installed each time the our product is. Has anyone seen this issue and/or found a solution? Will adding a context.xml files to each of my META-INF solve the issue? Any help, suggestions would be much appreciated. Thanks, ~Aaron Pedersen
RE: Source code for naming-factory-dbcp.jar ?
naming-factory-dbcp.jar Have a look at Commons DBCP. http://jakarta.apache.org/commons/dbcp/ Hope this helps. Regards Jason -- Jason Bell Lead Architect, SpikeSource Europe e: [EMAIL PROTECTED] w: http://www.spikesource.com b: http://jasonbell.blog-city.com m: +44 (0)787 529 2693 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to stop Tomcat supplying HTML for statues
Maybe we are talking at cross purposes. I will try to explain what I am trying to achieve. When I have a non-200 response ALL I want to send back is the status code and the message inserted with the sendError. Nothing else. Currently I just do a sendError, should I also write a zero length buffer to the OutputStream and flush it? David On Tuesday 06 September 2005 18:55, Tim Funk wrote: Then make the error page a jsp which clears the stream and prints what you want. If your servlet already prints what you need, then force the buffer to be flushed so that the response is committed and an error page is not shown. -Tim David Goodenough wrote: No, this is the reverse of what I want. I want to STOP it sending an HTML page, rather than the error-page tag to set it. David On Tuesday 06 September 2005 15:06, Tim Funk wrote: http://jakarta.apache.org/tomcat/faq/misc.html#error -Tim David Goodenough wrote: I have a server which is being used only for XML servlets. I would like to send back error responses either as an XML error or, in the case of a non-200 status code just to send back the status code and a single line text message. I set the status (which seems to work) and the text, which again seems to be sent back on the response header, but I also get a bunch of HTML text which gets in the way of processing the error text which I want to do using XmlHttpRequest. I have not included any ErrorPage tags in my web.xml nor are there any in the global web.xml. - 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]
jasper jsp precompilation error
Hi I am trying to do JSP precompilation as described at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html. I can run the application fine if I do not precompile, but when I do attempt to precompile the JSP, I get the message: BUILD FAILED /home/aaron/projects/cdquery/build.xml:307: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getResourcePaths (Ljava/lang/String;)Ljava/util/Set; I am using Tomcat 5.0.30 Ant 1.6.2. Does anyone have an idea what I should do? Below is my ant target XML. Thanks, Aaron target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${catalina.home}/bin include name=*.jar/ /fileset fileset dir=${catalina.home}/server/lib include name=*.jar/ /fileset fileset dir=${catalina.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${web.home} webXmlFragment=${web.home}/WEB-INF/generated_web.xml outputDir=${web.home}/WEB-INF/src / /target
RE: Connectiong tomcat to IIS - no luck and conflicting info
I am exceedingly ignorant in the J2EE universe, but I did manage to get TC5.5 talking to IIS 6 effectively (3 times, so it wasn't a fluke!). Have you seen this doc: http://jakarta.apache.org/tomcat/connectors-doc/howto/iis.html It has some troubleshooting info. Be sure to at least restart the IIS service, probably even reboot entirely! Tracy -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 06, 2005 4:29 PM To: tomcat-user@jakarta.apache.org Subject: Connectiong tomcat to IIS - no luck and conflicting info Hi; I am trying to connect Tomcat 5.5 to IIS 5.1 and having zero luck. Here is what I did: 1. Went to http://apache.towardex.com/jakarta/tomcat-connectors/jk/binaries/win32/j k-1. 2.14 2. Downloaded ran isapi_redirect-1.2.14.exe 3. Added isapi_redirect as an ISAPI filter to the default website. When I try to bring up the page http://localhost/jkstatus I get the following in my IIS log: 20:19:47 127.0.0.1 GET /jkstatus 404 So it's not even calling isapi_redirect.dll. The installer did create the jakarta virtual directory and some registry entries. (I believe that even if all of my tomcat settings are wrong - it should still be calling isapi_redirect.) I'm stuck now. The book Pro Jakarta Tomcat 5 discusses setting this up using isapi_redirect2.dll and using registry entries that have a 2.0 node in them. But I can't find any metion of this anywhere else. The isapi_redirect installer doesn't have any documentation. On the jakarta website I can't find any 5.x specific install instructions. I've done this successfully for Tomcat 4.x - see http://dave.thielen.com/articles/Configuring%20Tomcat%20to%20work%20with %20I IS.doc but these instructions don't match the contents of the config files for 5.5. So what should I try next? Thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Java Web Parts .9 is out
I know there are a number of folks in both the Struts and Tomcat communities using Java Web Parts now, so it might not be all *that* off-topic... v.9 was just released. There is one new piece in the mix that, I think, might be of interest to some... it's called the DependencyFilter. It's billed as a hybrid IoC provider. Hybrid because it doesn't inject dependencies, but it tackles the creation part of it, and I believe it does so in an interesting and flexible way. For all the details, see http://javawebparts.sourceforge.net We now return to your regularly-scheduled topics... Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IIS6 - ASP.Net - JK - TC5 - tomcatAuthentication=false: user auth not getting passed?
I want to pass authorization from my dot.Net app to the Tomcat app. Unsecured, everything is working fine: IIS runs the asp.net app, which in turn loads the Tomcat app (a Macromedia Flex app to be specific). But the asp.net app is secured, and the JK - isapi_redirect allows users to directly access the Tomcat app, which is not desired. To start with, I have configured basic security, protected the application with a security-constraint, and tested it with direct calls to the TC server / app, and all worked as expected. However when I set the tomcatAuthentication=false, my Tomcat app does not run, and judging by the RequestDumperValve output, IIS is not passing the user name to Tomcat, and it also reports status 403. My long term goal is to use the asp.net authentication in the Tomcat app, but in the short run I would just like to get anything working, like the Windows user for example. Any suggestions will be appreciated. I have included a listing of the RequestDumperValve output below. Tracy Spratt Catalina_log: REQUEST URI =/flex/ltApplications/Clients/Patterson/FirePump.mxml.swf authType= characterEncoding=null contentLength=0 contentType=null contextPath=/flex cookie=ASP.NET_SessionId=hqoaxr45jokfpzabz4giluft cookie=Authenticate=7808CB3E915F5EBD2AC05801D91542013C4B04B39312E1B2335B 32395880A6C05638E108982CA4917853D032EC9EFD47EB20A56448A23EF3665B48F57F49 BD387D254B570373404A header=connection=Keep-Alive header=accept=*/* header=accept-encoding=gzip, deflate header=cookie=ASP.NET_SessionId=hqoaxr45jokfpzabz4giluft; Authenticate=7808CB3E915F5EBD2AC05801D91542013C4B04B39312E1B2335B3239588 0A6C05638E108982CA4917853D032EC9EFD47EB20A56448A23EF3665B48F57F49BD387D2 54B570373404A header=host=www.lariatinc.com header=if-modified-since=Thu, 01 Sep 2005 21:43:30 GMT header=user-agent=Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) header=x-flash-version=7,0,35,29 header=content-length=0 locale=en_US method=GET pathInfo=null protocol=HTTP/1.1 queryString=null remoteAddr=172.31.255.55 remoteHost=172.31.255.55 remoteUser= requestedSessionId=null scheme=http serverName=www.lariatinc.com serverPort=80 servletPath=/ltApplications/Clients/Patterson/FirePump.mxml.swf isSecure=false --- --- authType= contentLength=-1 contentType=null message=null remoteUser= status=403 === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question on cluster recognition
When our application starts up, it removes admin information about old user sessions from our database; We store information such as locks and session state in our DB. BUT, if we are running in a cluster and Tomcat stars up, we do NOT want this to occur EXCEPT for on the first server in the cluster that starts up. For example, we have a cluster with 2 nodes. We start A up and it removes session log info from the DB, it then potentially gets more sessions created and logged before node B is up and running (for example in a failover scenario, where we dynamically bring back up a failed server). When node B comes up, we do NOT want it to remove sessions that have been logged. Is there a way of recognizing that: 1) a node is a member in a cluster 2) whether it is the first node that comes up in the cluster, or whether other members in the cluster are up and running? So that we can execute something only in the first node that comes up? Are tehre any other ideas on how to handle this?? John McClain Senior Software Engineer TCS Healthcare [EMAIL PROTECTED] (530)886-1700x235 Skepticism is the first step toward truth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to stop Tomcat supplying HTML for statues
Don't use sendError. - Call response.setStatus(int). - Calculate the size of your body text - Call setContentLength(value from previous step) - Send the message in the output stream - Profit! ;) -Tim David Goodenough wrote: Maybe we are talking at cross purposes. I will try to explain what I am trying to achieve. When I have a non-200 response ALL I want to send back is the status code and the message inserted with the sendError. Nothing else. Currently I just do a sendError, should I also write a zero length buffer to the OutputStream and flush it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]