Re: Large HTML file not getting compressed despite compression enabled
Turned out it was the file size. If I arbitrarily trim the file to be just under 50 KB the compression will work. Looks like the Connector's compression facility is checking for an upper limit on stream length or something like that. Does anyone know of a way to disable this upper bound? Thanks, Alex Alex Epshteyn wrote: > > I finally had some time to try to track down this problem further. I set > the log levels to ALL, but still nothing useful showing up. However, I > found a curious thing in my access log. Consider this snippet: > > 76.19.64.19 - - [18/Apr/2008:04:29:37 +] "GET /theme.css HTTP/1.1" 200 > 6360 > 76.19.64.19 - - [18/Apr/2008:04:29:37 +] "GET > /B2200E18EF2035F53CA3D7E241122BB6.cache.html HTTP/1.1" 200 - > > The theme.css file is served up gzipped but > B2200E18EF2035F53CA3D7E241122BB6.cache.html is not! Notice the "-" printed > at the very end. The doc for the access log valve describes this field as > "Bytes sent, excluding HTTP headers, or '-' if zero". So the access log > thinks that zero bytes are being sent for this file. > > This is not true, as the file does get properly served, just not gzipped. > Seems like an indication of some other problem, though. > > Does anyone have any ideas? > > Here is the file itself if any of the contributors reading this would like > to try to debug. I'd try it myself, but I can't repro the problem in my > Windows dev environment - it only happens in my CentOS production > environment. (Hope the attachment worked - I'm writing this from Nabble). > > > http://www.nabble.com/file/p16760347/B2200E18EF2035F53CA3D7E241122BB6.cache.html > B2200E18EF2035F53CA3D7E241122BB6.cache.html > > Here are the possible causes I can think of right now: 1) the file is too > big, almost 200 KB 2) the dual-extension, .cache.html 3) filename too > long. That's pretty much it. I don't think it's the contents inside the > file - I've gone through several incarnations of these (they are generated > by my compiler), and not a single one has successfully gotten gzipped. > > Thanks again for your time, > Alex > > > Alex Epshteyn wrote: >> >> I have Tomcat's compression enabled: >> >> >maxThreads="200" minSpareThreads="25" maxSpareThreads="75" >>enableLookups="false" redirectPort="8443" >> acceptCount="100" >>connectionTimeout="2" disableUploadTimeout="true" >>compression="on" >>compressionMinSize="2048" >>noCompressionUserAgents="gozilla, traviata" >> >> compressableMimeType="text/html,text/xml,text/javascript,text/css"/> >> >> It works as expected for all my resources (stylesheets, scripts, etc) >> except for one static file, which has the extension .cache.html (in >> case you're wondering, it contains scripts generated by GWT). This >> file is pretty large - about 150K, but Tomcat doesn't compress it for >> some reason. >> >> Here are the response headers for this file (I have a custom filter >> that sets the cache headers prior to forwarding the request up the >> chain): >> >> Server Apache-Coyote/1.1 >> Cache-Controlpublic, max-age=31536 >> Expires Wed, 28 Mar 2018 18:58:38 GMT >> Etag W/"136900-1206809984000" >> Last-ModifiedSat, 29 Mar 2008 16:59:44 GMT >> Content-Type text/html >> Content-Length 136900 >> Date Sun, 30 Mar 2008 20:44:14 GMT >> >> Here are the response headers for a file that gets properly compressed >> (which also passes through the same filter): >> >> Server Apache-Coyote/1.1 >> Pragma no-cache >> Cache-Controlmax-age=0, no-store, no-cache, must-revalidate >> Expires Thu, 01 Jan 1970 00:00:00 GMT >> Etag W/"4869-1206809984000" >> Last-ModifiedSat, 29 Mar 2008 16:59:44 GMT >> Content-Type text/javascript >> Transfer-Encodingchunked >> Content-Encoding gzip >> Vary Accept-Encoding >> Date Sun, 30 Mar 2008 20:44:14 GMT >> >> I don't see any relevant errors in my log files. I'm using Tomcat >> 5.5.26 on Linux. As a strange twist, the file does get compressed >> properly with Tomcat 5.5.26 on Windows. >> >> Any ideas? >> >> Thanks in advance for your help! >> >> Alex >> > > -- View this message in context: http://www.nabble.com/Large-HTML-file-not-getting-compressed-despite-compression-enabled-tp16387385p16760366.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can we slow down the speed of servlet response ?
Hi all, Thanks for your interesting suggestion. I have tried Thread.sleep() in my servlet and it fails. My NM app throws exception and can't handle such response.. Will try he other 2 method and see what will happen. B.R Hanks On Thu, Apr 17, 2008 at 3:18 PM, Benjamin Lerman <[EMAIL PROTECTED]> wrote: > > To start with, I'd take the naive approach and see whether it worked > > well enough for the job. I'd use thread.sleep(), and make sure I had > > enough worker threads (configured in server/conf.xml) to handle the > > number of outstanding requests you want to generate. That could be > > many thousands (I don't know your requirements), and each one > > potentially consumes a thread on the host operating system, so make > > sure you're running on a system that has enough memory and enough > > threads configured in the OS. Sorry I can't be specific on what > > "enough" is, but I've never done this myself! > > > > A second - and completely different - approach would be to throttle the > > bandwidth out of the server in some way, such that the responses were > > buffered for the required time. I'm not sure this is feasible at the > > link layer, as I presume you're using HTTP, so the TCP acks would have > > to get back in a timely fashion. If you're able to manage that > > somehow, though, connecting the Tomcat server via the networking > > equivalent of two tin cans and a piece of string - possibly a serial > > lead? - might provide the slowdown you're looking for. > > A third solution: compute your result immediately, keep that in the > session as well as the time of the request, forward to a waiting view > that will wait client side and then ask the result on a specific URL, > then when asked for the result, check that 1) the result has been > computed, if this is not the case returns an error, 2) enough time has > passed, else re-forward to the waiting view. If all is correct, send the > result that lies in the session. > > Benjamin Lerman > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Large HTML file not getting compressed despite compression enabled
I finally had some time to try to track down this problem further. I set the log levels to ALL, but still nothing useful showing up. However, I found a curious thing in my access log. Consider this snippet: 76.19.64.19 - - [18/Apr/2008:04:29:37 +] "GET /theme.css HTTP/1.1" 200 6360 76.19.64.19 - - [18/Apr/2008:04:29:37 +] "GET /B2200E18EF2035F53CA3D7E241122BB6.cache.html HTTP/1.1" 200 - The theme.css file is served up gzipped but B2200E18EF2035F53CA3D7E241122BB6.cache.html is not! Notice the "-" printed at the very end. The doc for the access log valve describes this field as "Bytes sent, excluding HTTP headers, or '-' if zero". So the access log thinks that zero bytes are being sent for this file. This is not true, as the file does get properly served, just not gzipped. Seems like an indication of some other problem, though. Does anyone have any ideas? Here is the file itself if any of the contributors reading this would like to try to debug. I'd try it myself, but I can't repro the problem in my Windows dev environment - it only happens in my CentOS production environment. (Hope the attachment worked - I'm writing this from Nabble). http://www.nabble.com/file/p16760347/B2200E18EF2035F53CA3D7E241122BB6.cache.html B2200E18EF2035F53CA3D7E241122BB6.cache.html Here are the possible causes I can think of right now: 1) the file is too big, almost 200 KB 2) the dual-extension, .cache.html 3) filename too long. That's pretty much it. I don't think it's the contents inside the file - I've gone through several incarnations of these (they are generated by my compiler), and not a single one has successfully gotten gzipped. Thanks again for your time, Alex Alex Epshteyn wrote: > > I have Tomcat's compression enabled: > > maxThreads="200" minSpareThreads="25" maxSpareThreads="75" >enableLookups="false" redirectPort="8443" acceptCount="100" >connectionTimeout="2" disableUploadTimeout="true" >compression="on" >compressionMinSize="2048" >noCompressionUserAgents="gozilla, traviata" > > compressableMimeType="text/html,text/xml,text/javascript,text/css"/> > > It works as expected for all my resources (stylesheets, scripts, etc) > except for one static file, which has the extension .cache.html (in > case you're wondering, it contains scripts generated by GWT). This > file is pretty large - about 150K, but Tomcat doesn't compress it for > some reason. > > Here are the response headers for this file (I have a custom filter > that sets the cache headers prior to forwarding the request up the > chain): > > ServerApache-Coyote/1.1 > Cache-Control public, max-age=31536 > Expires Wed, 28 Mar 2018 18:58:38 GMT > Etag W/"136900-1206809984000" > Last-Modified Sat, 29 Mar 2008 16:59:44 GMT > Content-Type text/html > Content-Length136900 > Date Sun, 30 Mar 2008 20:44:14 GMT > > Here are the response headers for a file that gets properly compressed > (which also passes through the same filter): > > ServerApache-Coyote/1.1 > Pragmano-cache > Cache-Control max-age=0, no-store, no-cache, must-revalidate > Expires Thu, 01 Jan 1970 00:00:00 GMT > Etag W/"4869-1206809984000" > Last-Modified Sat, 29 Mar 2008 16:59:44 GMT > Content-Type text/javascript > Transfer-Encoding chunked > Content-Encoding gzip > Vary Accept-Encoding > Date Sun, 30 Mar 2008 20:44:14 GMT > > I don't see any relevant errors in my log files. I'm using Tomcat > 5.5.26 on Linux. As a strange twist, the file does get compressed > properly with Tomcat 5.5.26 on Windows. > > Any ideas? > > Thanks in advance for your help! > > Alex > -- View this message in context: http://www.nabble.com/Large-HTML-file-not-getting-compressed-despite-compression-enabled-tp16387385p16760347.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NotSerializableException: StandardSessionFacade
> From: MassimoH [mailto:[EMAIL PROTECTED] > Subject: NotSerializableException: StandardSessionFacade > > I've inherited an legacy Java application and I'm getting > this error on startup. > > - IOException while loading persisted sessions: > java.io.WriteAbortedException: writing aborted; > java.io.NotSerializableException: It seems odd to get a WriteAbortedException during startup, since the session is being read back in. Regardless, something stored in the session is not serializable, so it cannot be restored - which is also odd, since it must have been serializable in order to have been written out. Clearing out Tomcat's work directory to get rid of the persisted sessions should let you get through startup. If the webapp does actually store something non-serializable into the session, you can either fix the webapp, or turn off session persistence for that webapp. Nest a element inside the webapp's element, and set the pathname attribute for the manager to an empty string. The doc is here: http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NotSerializableException: StandardSessionFacade
I've inherited an legacy Java application and I'm getting this error on startup. - IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.catalina.session.StandardSessionFacade java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.catalina.session.StandardSessionFacade at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333) Apache Tomcat 5.5.25 Java 1.6_05 There is a significant chance something isn't configured correctly. -- View this message in context: http://www.nabble.com/NotSerializableException%3A-StandardSessionFacade-tp16758759p16758759.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk load balancing intelligence
Hi, We use a combination of Tomcat 5.5.25, mod_jk (v1.25) and sun one web server (v6.1).The Sun Java web server points to 5 instances of tomcat as specified in our obj.conf and worker.properties. I know that currently if the application is not in a started state and Tomcat is up and running, mod_jk will still send traffic to that instance. Is there any way to prevent sending traffic to an application in a stopped state, or is this behavior by design, or just bad configuration? Thanks, Eddie _ More immediate than e-mail? Get instant access with Windows Live Messenger. http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_instantaccess_042008
Re: Tomcat JSP issues
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Landon, Landon Fabbricino wrote: | We are using Apache Tomcat/6.0.16 and when we go to the sample JSP | pages or our own jsp application, it breaks with a servlet exception. [snip] | javax.servlet.ServletException: java.lang.AbstractMethodError: | javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext; This looks like you compiled your application against one version of the servlet specification and ran it against another. That seems odd, since the container usually compiles the JSPs on the fly in the currently-running container. Do you pre-compile your JSPs before deployment? If so, check to make sure you are using the same version of servlet-api.jar (or servlet.jar) as Tomcat 6.x does. If not, try stopping Tomcat completely, completely removing the "work" directory and re-starting. Post back and let us know how it goes. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHvOEACgkQ9CaO5/Lv0PBd7gCgoYsFrmkxRxMmJecOQCpJe3oi nmAAni7I6sDkjMsnY8iU88wpsNHrlIG/ =9RIO -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsessionId - is there a way to generate/set in the container
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Farhan, mfs wrote: | Actually they don't, its a non-java based framework. :( | But Christoper i would still be interested in knowing the approach you took, | sounds like an interesting deal to me, now when u say wrap the servlet's | container's framework, what extended functionality did you provide in that | case in your wrapper, since the container itself provides everything as far | as session tracking is concerned, used your sessionId generation mechanism ? No, we had our own framework for a long time, and I simply replaced the implementation with one that re-used everything coming from the container. Basically, our framework became a thin wrapper around the standard HttpSession stuff. Nothing fancy... we just didn't have to re-write a ton of existing application code. We let the container generate the session ids and everything. | or yet implemented your own mean of storing the session in the db for | example in contrast to in memory hashtable? I think it was a hashtable implementation, though it was designed to allow database persistence with a different "driver" (or whatever they called it at the time). | what was so unique about that | wrapper and how did it help inter-op.. It didn't help with interoperability. It helped with maintenance. I had identified a number of bugs in the implementation and persuaded the team managers that a re-implementation wrapping the standard container-managed classes was the best solution. We eliminated a bunch of bugs /and/ a bunch of code from our own class library, as well as all the applications based upon it. Everybody wins ;) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHu/gACgkQ9CaO5/Lv0PC7jgCghrC4dKxn2z0bhNxy6RwqU0yr N3YAoL2Hhm/TxYxjEjAmnZ305+Wm761G =SqfA -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] CLOBs, Connection Pooling, Help!
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, (Marking off-topic as this is a JDBC thang, not a Tomcat one). Brian Munroe wrote: | I | am using Tomcat container provided connection pooling; connecting to | an Oracle XE server and I need to insert a CLOB. It would appear that | doing this task is dependent upon which RDBMS vendor you're working | with? It shouldn't. | // This is where things fall apart (setStringForClob | // is a Oracle PreparedStatement method) - which | // is wrong, but still | | insertMsgBodyRecord.setStringForClob(2,message.toXML()); What's wrong with insertMsgBodyRecord.setString(2, message.toXML()); ?? If your "message" is too long to fit into a String object, how about: insertMsgBodyRecord.setCharacterStream(2, reader, length); ?? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHuQYACgkQ9CaO5/Lv0PBWkwCgmi0PjBhML2qVCIDl6hedjO99 ChEAnirZOMIVXoJ3RJ148NCFWxoEQdqQ =Aags -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Connection Pooling still necessary?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David kerber wrote: | David kerber wrote: | Looking at these other posts, and the reference Charles posted, it's | apparent that I've been getting away without using pooling, even though | I though I was using it... Some drivers actually do perform their own pooling (certain Oracle drivers IIRC), so you might be using pooling even though you have not explicitly had to do any explicit configuration. The JDBC API itself neither provides nor promises any pooling services, so it's up to the implementor of the driver to decide to add that capability. JDBC 2.0 added the javax.sql.DataSource interface, which is basically the basis for pooling (instead of using java.sql.DriverManager). If you are already using an instance of a DataSource in your own code, you are probably using pooled (or at least re-usable) JDBC connections whether you know it or not. Tomcat's configuration allows you to specify pool size, etc. in a standard way. It's unclear to me how to configure a connection pool for, say, MySQL's Connector/J directly, though MySQL provides a DataSource that claims to support connection pooling. The bottom line is that if you are calling DriverManager.getConnection, you are probably not maximizing the your use of database connections. Hope that helps, - -chris References: http://java.sun.com/products/jdbc/download.html#spec http://dev.mysql.com/tech-resources/articles/connection_pooling_with_connectorj.html (old but still relevant) http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHuAwACgkQ9CaO5/Lv0PDnEgCffLPfoSSsHej5H80OEyUTV7Hy VFUAn3A00oHCv29SSdLeHENqMF9+0zDt =AwL7 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with datasource connecting to postgresql
You must be careful to distinguish the two different users involved. The OS user would determine whether there is a permissions problem with the JAR containing the PostgreSQL JDBC driver, but be insignificant in actually connecting to the DBMS. Ensuring that the JAR is world-readable should eliminate this as a source of trouble. The PostgreSQL user (I think it was "testmanager") partially determines which entry in pg_hba is used to authorize the connection -- the other determinant is the type of connection (local or network socket, and (for network socket) the client host address). The OS user is not involved in this unless the DBMS is configured to pass credentials through to e.g. PAM. You might check the PostgreSQL monitor log for clues. You may have to adjust the logging configuration to be sure you get enough information to be useful. If you see no connection attempted, it wouldn't appear to be a problem with the database user. -- Mark H. Wood, Lead System Programmer [EMAIL PROTECTED] Typically when a software vendor says that a product is "intuitive" he means the exact opposite. pgpotqU5kaI4g.pgp Description: PGP signature
Tomcat JSP issues
Hello, We are using Apache Tomcat/6.0.16 and when we go to the sample JSP pages or our own jsp application, it breaks with a servlet exception. (BTW servlets are still working). When I first installed tomcat all of the example jsp loaded correctly, just recently (after added a new application war file) they stopped loading - not sure if it was from the application war file addition or not.. http://localhost:8080/examples/jsp/jsp2/simpletag/hello.jsp When we go to this page, here is the following error we see. — HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext; org.apache.jasper.servlet.JspServlet.service(JspServlet.java:274) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause java.lang.AbstractMethodError: javax.servlet.jsp.JspFactory.getJspApplicationContext(Ljavax/servlet/ServletContext;)Ljavax/servlet/jsp/JspApplicationContext; org.apache.jsp.jsp.jsp2.el.basic_002darithmetic_jsp._jspInit(basic_002darithmetic_jsp.java:22) org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.16 logs. — Any suggestions would be very much appreciated. Thanks in advanced. Landon Fabbricino IT Applications Phone: 403.225.7515 Fax: 403.225.7604 [EMAIL PROTECTED] IMPORTANT NOTICE ! This E-Mail transmission and any accompanying attachments may contain confidential information intended only for the use of the individual or entity named above. Any dissemination, distribution, copying or action taken in reliance on the contents of this E-Mail by anyone other than the intended recipient is strictly prohibited and is not intended to, in anyway, waive privilege or confidentiality. If you have received this E-Mail in error please immediately delete it and notify sender at the above E-Mail address. Agrium uses state of the art anti-virus technology on all incoming and outgoing E-Mail. We encourage and promote the use of safe E-Mail management practices and recommend you check this, and all other E-Mail and attachments you receive for the presence of viruses. The sender and Agrium accept no liability for any damage caused by a virus or otherwise by the transmittal of this E-Mail. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsessionId - is there a way to generate/set in the container
Actually they don't, its a non-java based framework. But Christoper i would still be interested in knowing the approach you took, sounds like an interesting deal to me, now when u say wrap the servlet's container's framework, what extended functionality did you provide in that case in your wrapper, since the container itself provides everything as far as session tracking is concerned, used your sessionId generation mechanism ? or yet implemented your own mean of storing the session in the db for example in contrast to in memory hashtable ? what was so unique about that wrapper and how did it help inter-op.. Thanks Christopher Schultz-2 wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Farhan, > > mfs wrote: > | Actually we have our own session tracking framework, and now > | that i am making a seperate servlet based application, i have come to > need > | to support interoperability between Servlet HttpSession and the sessions > | maintained by our session-tracking framework. > > Does your current session-tracking framework use HttpServletRequest > objects to help identify the request? If so, you could re-factor your > session framework to wrap the container's framework. > > I did this years ago for a company that wrote their own session > framework. The container-managed one is really the way to go, here. > > - -chris > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.9 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkgHU4EACgkQ9CaO5/Lv0PAEdQCcCSIq8l6OTa3jPfTwJkE/5DVI > VQsAoLvjyhc6YdksBV4NnmzPKAE6i39W > =jKz0 > -END PGP SIGNATURE- > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/jsessionId---is-there-a-way-to-generate-set-in-the-container-tp16738580p16751962.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat not starting
See Thread at: http://www.techienuggets.com/Detail?tx=12232 Posted on behalf of a User I was also stuck at the same problem, and copying "msvcr71.dll" to the Tomcat bin directory fixed it. Thanks for the solution. In Response To: Windows 2000 sp4 JRE 1.6_02 Tomcat won't start. Any help Tried it on two seperate machines. Even uninstall and re-installed with boot up in between. Received the following error in the log file [2007-09-07 04:09:17] [174 javajni.c] [error] The specified module could not be found. [2007-09-07 04:09:17] [986 prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0_02\bin\client\jvm.dll [2007-09-07 04:09:17] [1260 prunsrv.c] [error] ServiceStart returned 1 Sincerely, Luc Nadon Information Technology Analyst ITS-Niagara, Fort Erie Section Phone: (905) 994-6887 email: [EMAIL PROTECTED] The rights and freedoms of one should not jeopardize that of another. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sticky sessions without cookies?
sharrissf wrote: > > I see, well just as an FYI, the terracotta thing will work for you then. > Sticky load balancing just keeps the load on terracotta lighter but your > session will be everywhere you need it when you need it. So for the people > who don't do cookies they can hit any appserver > OK, I see, thanks. I'll try to set this up in an test environment and see how it works for me. -- View this message in context: http://www.nabble.com/sticky-sessions-without-cookies--tp16705364p16748765.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
CLOBs, Connection Pooling, Help!
Ok, I've searched and searched, but I cannot figure out the answer. I am using Tomcat container provided connection pooling; connecting to an Oracle XE server and I need to insert a CLOB. It would appear that doing this task is dependent upon which RDBMS vendor you're working with? Can anyone help me understand what I need to do? I've gotten this far: import javax.naming.*; import java.sql.*; import javax.sql.*; import oracle.jdbc.*; // try/catch stuff omitted for example. Context initContext = new InitialContext(); Context envContext = (Context) initContext.lookup("java:/env/"); DataSource ds = (DataSource) envContext.lookup("jdbc/isms_messaging"); Connection conn = ds.getConnection(); sqlString = "insert into message_body (message_id,message_body) values (?,?)"; PreparedStatement insertMsgBodyRecord = conn.prepareStatement(sqlString); insertMsgBodyRecord.setString(1,message.getMessageId()); // This is where things fall apart (setStringForClob // is a Oracle PreparedStatement method) - which // is wrong, but still insertMsgBodyRecord.setStringForClob(2,message.toXML()); insertMsgBodyRecord.executeUpdate(); insertMsgBodyRecord.close(); conn.close(); thanks -- brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Connection Pooling still necessary?
David kerber wrote: Jonathan Mast wrote: I'm developing a webapp that is going to be making frequent DB operations. I know that DB connections are expensive and that developers pool connections to prevent the overhead of frequent instantiation. Is this design pattern still necessary? I ask because I vaguely recall skimming over an article that stated that this design pattern is not needed anymore with newer versions of Java. Currently, our webapps make infrequent calls to our database and as such I simply use a static getConnection() method to create new Connections, which I explicitly close at the end of their use. I realize that our setup, Tomcat 5.5 on Java 1.4.2, will almost certainly require connection pooling. But does newer versions of Java obviate this need? Any pointers to relevant (ie. JDK 1.4.2) tutorials on this topic would be greatly appreciated. Thanks Partly: I don't believe you need to handle the connection pooling yourself, because Tomcat and/or the JRE handle it automatically. I've never done any explicit connection pooling on TC 5.5/Java 1.5, even with some large numbers of simultaneous connections, and it works fine. D Looking at these other posts, and the reference Charles posted, it's apparent that I've been getting away without using pooling, even though I though I was using it... D - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Connection Pooling still necessary?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jonathan, Jonathan Mast wrote: | OK, but isn't there all kinds of special configuration required? The only | part of J2EE I'm using is JSP, no Servlets, no JNDI, just POJOs (J2SE) doing | the database work. Will Tomcat still automagically handle the pooling for | me? No, you have to configure it. Fortunately, configuration is relatively simple. Read the reference Chuck posted. | Sounds a little too good to be true, to me. But I've never done intensive | DB stuff so... Even if you only use a pool with a size of 1 connection, it's worth it to use the infrastructure provided by Tomcat, so you don't have to do it all yourself. Besides, if the use of your database connections increases wildly in the future, you only have to increase the size of your connection pool, instead of re-coding all of your database access code. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHhgUACgkQ9CaO5/Lv0PCsGQCfQt1xqGn+GVoKo96m7MdH90DL tnUAn2vnYzRsANgqfX/QmUOQ9u0pd6wv =Vorp -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsessionId - is there a way to generate/set in the container
so thats not something exposed by the servlet api itself...if i understand u correctly?, well though for my development i use tomcat/jetty servlet containers, but our app is deployed on the oracle app server, which has its own mini servlet engine (OSE), now given that i would need to extend the session managers of each and provide my own, and i am getting a stomach ache by just thinking about it. Farhan. markt-2 wrote: > > mfs wrote: >> Given the above context, i was wondering if there is some way i can >> provide >> my own unique sessionId to the servlet container whenever it creates a >> unique http session against a user. > > You would need to write your own manager. You should be able to extend > org.apache.catalina.session.StandardManager and override > generateSessionId() > > See also http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html > > Mark > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/jsessionId---is-there-a-way-to-generate-set-in-the-container-tp16738580p16747531.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is Connection Pooling still necessary?
> Jonathan Mast wrote: > > I know that DB connections are expensive and that developers pool > connections to prevent the overhead of frequent instantiation. > Is this design pattern still necessary? I ask because I vaguely > recall skimming over an article that stated that this design > pattern is not needed anymore with newer versions of Java. I think "skimming" is the key word in the above, leading to misinterpretation of whatever you were reading. Connection pooling is pretty much a necessity in any real-world situation, but it should be handled by the app server, not individual webapps. Tomcat DBCP configuration is in the docs: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h tml - Chuck P.S. JSPs are servlets, by the way. 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Connection Pooling still necessary?
Pooling still makes sense although in modern servlet containers it's provided. Outside the JVM, there's the overhead of making the connection and authenticating that can eat up significant amounts of time in busy sites with large numbers of queries to the db. Those costs are completely outside the JVM and would occur in stuff built with any of the other languages. Overall, do some performance testing on your webapp. If it's need of a database is so low that connections timeout and get recycled between borrows from the pool, you probably could get away with out the pooling. --David Jonathan Mast wrote: I'm developing a webapp that is going to be making frequent DB operations. I know that DB connections are expensive and that developers pool connections to prevent the overhead of frequent instantiation. Is this design pattern still necessary? I ask because I vaguely recall skimming over an article that stated that this design pattern is not needed anymore with newer versions of Java. Currently, our webapps make infrequent calls to our database and as such I simply use a static getConnection() method to create new Connections, which I explicitly close at the end of their use. I realize that our setup, Tomcat 5.5 on Java 1.4.2, will almost certainly require connection pooling. But does newer versions of Java obviate this need? Any pointers to relevant (ie. JDK 1.4.2) tutorials on this topic would be greatly appreciated. Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirect port 80 to application server
> From: Susan G. Conger [mailto:[EMAIL PROTECTED] > Subject: RE: redirect port 80 to application server > > I have to have the Apache HTTP in front. Don't want it there > but it is required by the customer. To what end? I've never heard of a customer saying "you have to use product xyz, even if it serves no purpose". If http does have some purpose in this environment, what is it? If it's nothing more than a forwarding mechanism, it's doing nothing other than wasting CPU and RAM. Assuming httpd is doing something useful, then use mod_proxy or mod_ajp to pass requests to Tomcat: http://tomcat.apache.org/connectors-doc/ If httpd is just there for show, configure it to use some oddball port and Tomcat to use port 80. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Connection Pooling still necessary?
OK, but isn't there all kinds of special configuration required? The only part of J2EE I'm using is JSP, no Servlets, no JNDI, just POJOs (J2SE) doing the database work. Will Tomcat still automagically handle the pooling for me? Sounds a little too good to be true, to me. But I've never done intensive DB stuff so... Thanks On Thu, Apr 17, 2008 at 12:57 PM, David kerber <[EMAIL PROTECTED]> wrote: > Jonathan Mast wrote: > > > I'm developing a webapp that is going to be making frequent DB > > operations. > > I know that DB connections are expensive and that developers pool > > connections to prevent the overhead of frequent instantiation. Is this > > design pattern still necessary? I ask because I vaguely recall skimming > > over an article that stated that this design pattern is not needed > > anymore > > with newer versions of Java. > > > > Currently, our webapps make infrequent calls to our database and as such > > I > > simply use a static getConnection() method to create new Connections, > > which > > I explicitly close at the end of their use. > > > > I realize that our setup, Tomcat 5.5 on Java 1.4.2, will almost > > certainly > > require connection pooling. But does newer versions of Java obviate > > this > > need? > > > > Any pointers to relevant (ie. JDK 1.4.2) tutorials on this topic would > > be > > greatly appreciated. > > > > Thanks > > > > > Partly: I don't believe you need to handle the connection pooling > yourself, because Tomcat and/or the JRE handle it automatically. I've never > done any explicit connection pooling on TC 5.5/Java 1.5, even with some > large numbers of simultaneous connections, and it works fine. > > D > > > > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: Is Connection Pooling still necessary?
Jonathan Mast wrote: I'm developing a webapp that is going to be making frequent DB operations. I know that DB connections are expensive and that developers pool connections to prevent the overhead of frequent instantiation. Is this design pattern still necessary? I ask because I vaguely recall skimming over an article that stated that this design pattern is not needed anymore with newer versions of Java. Currently, our webapps make infrequent calls to our database and as such I simply use a static getConnection() method to create new Connections, which I explicitly close at the end of their use. I realize that our setup, Tomcat 5.5 on Java 1.4.2, will almost certainly require connection pooling. But does newer versions of Java obviate this need? Any pointers to relevant (ie. JDK 1.4.2) tutorials on this topic would be greatly appreciated. Thanks Partly: I don't believe you need to handle the connection pooling yourself, because Tomcat and/or the JRE handle it automatically. I've never done any explicit connection pooling on TC 5.5/Java 1.5, even with some large numbers of simultaneous connections, and it works fine. D - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is Connection Pooling still necessary?
I'm developing a webapp that is going to be making frequent DB operations. I know that DB connections are expensive and that developers pool connections to prevent the overhead of frequent instantiation. Is this design pattern still necessary? I ask because I vaguely recall skimming over an article that stated that this design pattern is not needed anymore with newer versions of Java. Currently, our webapps make infrequent calls to our database and as such I simply use a static getConnection() method to create new Connections, which I explicitly close at the end of their use. I realize that our setup, Tomcat 5.5 on Java 1.4.2, will almost certainly require connection pooling. But does newer versions of Java obviate this need? Any pointers to relevant (ie. JDK 1.4.2) tutorials on this topic would be greatly appreciated. Thanks
RE: redirect port 80 to application server
> From: Susan G. Conger [mailto:[EMAIL PROTECTED] > I have to have the Apache HTTP in front. Don't want it there > but it is required by the customer. OK. If it's *in front*, then you'll need httpd ("Apache HTTP") to proxy for you by some means. > I say just use the port > http://myserver:8080/webapp and you will get to the > application server. At that point httpd is not "in front" of Tomcat - Tomcat's serving the content directly to the browser. Is that acceptable to the client? > They say we don't want to type in the port just make 80 > redirect to the application server port. $customer needs to be clear what they want. Do they want: - The browser communicating via httpd to Tomcat for all requests; - The browser communicating directly with Tomcat for Tomcat-related requests; - Don't care as long as it works; - Don't care as long as it adheres to our security policies? > So, I am here trying to figure out > the easiest way > to redirect all traffic from 80 to 8080 and still have the > apache running in > front. Should I use remote proxies? The "classic" way of doing that is to use mod_jk in httpd, and an AJP connector in Tomcat. You don't specify which Tomcat version you're on, so it's kinda hard to point you to the correct version of the docs for that :-). - Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: redirect port 80 to application server
Seems to me there are two options. 1. Use mod_jk to send everything back to Tomcat. Httpd just acts as a middle man passing stuff back and forth. 2. Use mod_rewrite and mod_proxy to setup a reverse proxy, still passing everything back and forth. If doing it this way, Tomcat's connector needs the proxyName and proxyPort attributes defined. --David Susan G. Conger wrote: I have to have the Apache HTTP in front. Don't want it there but it is required by the customer. So they type in http://myserver/webapp and expect it to go to the application server. I say just use the port http://myserver:8080/webapp and you will get to the application server. They say we don't want to type in the port just make 80 redirect to the application server port. So, I am here trying to figure out the easiest way to redirect all traffic from 80 to 8080 and still have the apache running in front. Should I use remote proxies? Thanks, Susan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 12:26 PM To: Tomcat Users List Subject: RE: redirect port 80 to application server From: Susan G. Conger [mailto:[EMAIL PROTECTED] Subject: redirect port 80 to application server But I have an Apache HTTP server front end and I want to redirect port 80 so that it goes to port 8080. If by the above you mean you want to send all port 80 requests through to Tomcat on port 8080, why are you bothering with httpd at all? Just take it out and configure Tomcat to use port 80. Or maybe you need to supply more information... - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using DefaultServlet for directory outside of webapps
Chuck, This a great idea. Now I am trying for find where to put ourshare.xml file. We are using Tomcat under Jboss, I didn't find conf\Catalina yet. Thanks a lot! Jeff --- "Caldarale, Charles R" <[EMAIL PROTECTED]> wrote: > > From: Zengfa Gao [mailto:[EMAIL PROTECTED] > > Subject: Using DefaultServlet for directory > outside of webapps > > > > Is any setting for us to redirectory > DefaultServlet to > > look at other defined directory? For example, if > we > > put files under /var/opt/ourshare directory, how > can > > we do it? > > The easiest way is to define another with > a docBase set to the > location of the external directory. For example, > place the following in > conf/Catalina/[host]/ourshare.xml: > > > > You can then forward or redirect references to the > images to > "/ourshare/[image].gif" and the DefaultServlet will > handle them > properly. > > - 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 start a new topic, e-mail: > users@tomcat.apache.org > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirect port 80 to application server
Susan: Is the aplication server a Tomcat? If so, you can use mod_jk. If not, may be you will need to use mod_proxy. Toni. -Original Message- From: Susan G. Conger [mailto:[EMAIL PROTECTED] Sent: jueves, 17 de abril de 2008 18:34 To: 'Tomcat Users List' Subject: RE: redirect port 80 to application server I have to have the Apache HTTP in front. Don't want it there but it is required by the customer. So they type in http://myserver/webapp and expect it to go to the application server. I say just use the port http://myserver:8080/webapp and you will get to the application server. They say we don't want to type in the port just make 80 redirect to the application server port. So, I am here trying to figure out the easiest way to redirect all traffic from 80 to 8080 and still have the apache running in front. Should I use remote proxies? Thanks, Susan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 12:26 PM To: Tomcat Users List Subject: RE: redirect port 80 to application server > From: Susan G. Conger [mailto:[EMAIL PROTECTED] > Subject: redirect port 80 to application server > > But I have an Apache HTTP server front end and I want > to redirect port 80 so that it goes to port 8080. If by the above you mean you want to send all port 80 requests through to Tomcat on port 8080, why are you bothering with httpd at all? Just take it out and configure Tomcat to use port 80. Or maybe you need to supply more information... - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirect port 80 to application server
I have to have the Apache HTTP in front. Don't want it there but it is required by the customer. So they type in http://myserver/webapp and expect it to go to the application server. I say just use the port http://myserver:8080/webapp and you will get to the application server. They say we don't want to type in the port just make 80 redirect to the application server port. So, I am here trying to figure out the easiest way to redirect all traffic from 80 to 8080 and still have the apache running in front. Should I use remote proxies? Thanks, Susan -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 12:26 PM To: Tomcat Users List Subject: RE: redirect port 80 to application server > From: Susan G. Conger [mailto:[EMAIL PROTECTED] > Subject: redirect port 80 to application server > > But I have an Apache HTTP server front end and I want > to redirect port 80 so that it goes to port 8080. If by the above you mean you want to send all port 80 requests through to Tomcat on port 8080, why are you bothering with httpd at all? Just take it out and configure Tomcat to use port 80. Or maybe you need to supply more information... - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using DefaultServlet for directory outside of webapps
> From: Zengfa Gao [mailto:[EMAIL PROTECTED] > Subject: Using DefaultServlet for directory outside of webapps > > Is any setting for us to redirectory DefaultServlet to > look at other defined directory? For example, if we > put files under /var/opt/ourshare directory, how can > we do it? The easiest way is to define another with a docBase set to the location of the external directory. For example, place the following in conf/Catalina/[host]/ourshare.xml: You can then forward or redirect references to the images to "/ourshare/[image].gif" and the DefaultServlet will handle them properly. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: redirect port 80 to application server
> From: Susan G. Conger [mailto:[EMAIL PROTECTED] > Subject: redirect port 80 to application server > > But I have an Apache HTTP server front end and I want > to redirect port 80 so that it goes to port 8080. If by the above you mean you want to send all port 80 requests through to Tomcat on port 8080, why are you bothering with httpd at all? Just take it out and configure Tomcat to use port 80. Or maybe you need to supply more information... - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
redirect port 80 to application server
I am not sure if this is the right list for this. But I have an Apache HTTP server front end and I want to redirect port 80 so that it goes to port 8080. Thanks, Susan === Susan G. Conger Custom Windows & Macintosh Development President Web Site Design & Development YOERIC Corporation Database Design & Development 256 Windy Ridge Road Chapel Hill, NC 27517 Phone/Fax: (919)542-0071 [EMAIL PROTECTED] www.yoeric.com
How to set max heap memory for tomcat 4.1.37 running as window services.
I am not sure whether my previous posting made it to the group. I didn't see it in my inbox, so let me retry. Here you go: In Tomcat 4.1.24 running as windows services, to set the max heap memory for the JVM we can modify the registry setting using 'regedit". In the registry we can add "JVM Option" to add something like "-Xmx512m" to set the JVM max memory to 512MB. In Tomcat 4.1.37 registry I couldn't find the same option to set this max memory. The question I have is: How do I set tomcat max memory when it is running as a window service? Thanks in advance, Joe
Re: Using DefaultServlet for directory outside of webapps
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jeff, Zengfa Gao wrote: | For our application, we want to list/show a list of | gif files. Currently we are using DefaultServlet with | listings=true (web.xml). As the result, we can list | the names of the file, and open the gif file under the | our.war directory. | | For security reason, we are trying to list/show gif | under other directory, not the directory of our.war. | Is any setting for us to redirectory DefaultServlet to | look at other defined directory? For example, if we | put files under /var/opt/ourshare directory, how can | we do it? DefaultServlet cannot (currently) be targeted at a directory other than the root of the webapp. You could probably subclass DefaultServlet and modify its behavior such that you could re-target it to another directory using init-param elements or something like that. It looks like the init() method of DefaultServlet grabs a ProxyDirContext from the application scope. I'm guessing that's a JNDI context that is rooted in the current application's webapp root. By overriding init() (make sure you call super.init()!), you could probably re-target the "resources" member to another directory, and simply leave everything else alone. Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHd+EACgkQ9CaO5/Lv0PBxiQCfboZKcnDiYpow+m30LFLlkSpO b0IAnAolLNXhaJIe7491fDmaQQUPxVBW =XxJE -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: forwarding across contexts?
Hi, When I asked the question, it seems that Fred had the same problem before: http://marc.info/?l=tomcat-user&m=108430682905359&w=2 If Fred is here, could you please tell me what you did for your situation. Thanks! Jeff --- Zengfa Gao <[EMAIL PROTECTED]> wrote: > Hi, > > For our application, we want to list/show a list of > gif files. Currently we are using DefaultServlet > with > listings=true (web.xml). As the result, we can list > the names of the file, and open the gif file under > the > our.war directory. > > For security reason, we are trying to list/show gif > under other directory, not the directory of our.war. > Is any setting for us to redirectory DefaultServlet > to > look at other defined directory? For example, if we > put files under /var/opt/ourshare directory, how can > we do it? > > Thanks a lot! > > Jeff > > > > > Be a better friend, newshound, and > know-it-all with Yahoo! Mobile. Try it now. > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ > > - > To start a new topic, e-mail: > users@tomcat.apache.org > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using DefaultServlet for directory outside of webapps
Hi, For our application, we want to list/show a list of gif files. Currently we are using DefaultServlet with listings=true (web.xml). As the result, we can list the names of the file, and open the gif file under the our.war directory. For security reason, we are trying to list/show gif under other directory, not the directory of our.war. Is any setting for us to redirectory DefaultServlet to look at other defined directory? For example, if we put files under /var/opt/ourshare directory, how can we do it? Thanks a lot! Jeff Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and jmx
Many thanks, it works JLucas > Message du 17/04/08 17:20 > De : "Caldarale, Charles R" > A : "Tomcat Users List" > Copie à : > Objet : RE: Tomcat and jmx > > > From: JLucas ZB [mailto:[EMAIL PROTECTED] > > Subject: RE: Tomcat and jmx > > > > With Tomcat 6, there's only a binary file (tomcat.exe) within > > %TOMCAT_HOME%\bin so there's no other way but configuring > > CATALINA_OPTS through the Panel System. > > Not sure what you mean by "the Panel System", but you should be using the > tomcat6w.exe program to set the Java options. Setting the jmxremote flags > works fine for me. > > - 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 start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >
RE: Tomcat and jmx
> From: JLucas ZB [mailto:[EMAIL PROTECTED] > Subject: RE: Tomcat and jmx > > With Tomcat 6, there's only a binary file (tomcat.exe) within > %TOMCAT_HOME%\bin so there's no other way but configuring > CATALINA_OPTS through the Panel System. Not sure what you mean by "the Panel System", but you should be using the tomcat6w.exe program to set the Java options. Setting the jmxremote flags works fine for me. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and jmx
Hello, that's what i've read from the same url but my tomcat runs under windows, as a service. With Tomcat 6, there's only a binary file (tomcat.exe) within %TOMCAT_HOME%\bin so there's no other way but configuring CATALINA_OPTS through the Panel System. That's what I did but it seems that the "-Dcom.sun.management.jmxremote" options are not read - For example: I set "-Dcom.sun.management.jmxremote.port=". So when I try to access it with JConsole : "service:jmx:rmi:///jndi/rmi://localhost:/jmxrmi" --> Connexion failed (with it's OK) Any other idea ? Cheers > Message du 17/04/08 16:59 > De : "Antonio Vidal Ferrer" > A : "'Tomcat Users List'" , "'ZB'" > Copie à : > Objet : RE: Tomcat and jmx > > Well, it can be done via CATALINA_OPTS. > > For example: > > setenv CATALINA_OPTS "-Dcom.sun.management.jmxremote \ > -Dcom.sun.management.jmxremote.port=8123 \ > -Dcom.sun.management.jmxremote.ssl=false \ > -Dcom.sun.management.jmxremote.authenticate=true \ > -Dcom.sun.management.jmxremote.password.file=conf/jmxremote.password \ > -Dcom.sun.management.jmxremote.access.file=conf/jmxremote.access" > > You can check this here: > http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html > > Best > > Toni. > > > > -Original Message- > From: ZB [mailto:[EMAIL PROTECTED] > Sent: jueves, 17 de abril de 2008 15:38 > To: users@tomcat.apache.org > Subject: Tomcat and jmx > > Hi everybody, > > > i would like to monitor my Tomcat 6.0 with another port instead of . > How can I change the VM arguments within my Tomcat Service (Windows XP) > > Thank you > > JLucas > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >
Re: Cookie-less session tracking - whats are the downsides
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Robert, Robert Koberg wrote: | On Thu, 2008-04-17 at 09:38 -0400, Christopher Schultz wrote: |> The only runtime bottleneck is the time required to add |> ";jsessionid=123456789" to your outgoing URLs, which is to say "pretty |> much nothing". The engineering bottleneck is that you have to run all |> your URLs through HttpServletRequest.encodeURL or |> HttpServletRequest.encodeRedirectURL (which you should have been doing |> all along, right?). | | I doubt you have been doing that unless you have a special | HttpServletRequest :) request... response... whatever ;) s/Request/Response/g - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHZk0ACgkQ9CaO5/Lv0PCGKwCeKv5OOOnoztWIxcnjkUcbrwWy yScAn23Ck+NHG+ZOKBQTVUcHGy+TQhca =ltPT -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat and jmx
Well, it can be done via CATALINA_OPTS. For example: setenv CATALINA_OPTS "-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=8123 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=true \ -Dcom.sun.management.jmxremote.password.file=conf/jmxremote.password \ -Dcom.sun.management.jmxremote.access.file=conf/jmxremote.access" You can check this here: http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html Best Toni. -Original Message- From: ZB [mailto:[EMAIL PROTECTED] Sent: jueves, 17 de abril de 2008 15:38 To: users@tomcat.apache.org Subject: Tomcat and jmx Hi everybody, i would like to monitor my Tomcat 6.0 with another port instead of . How can I change the VM arguments within my Tomcat Service (Windows XP) Thank you JLucas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with datasource connecting to postgresql
I used the same Java 1.5 (the only Java on the system); the snippet occurs in the the build tree for the Tomcat project. The snippet was run inside Eclipse which is running under my own user login, so presumably that's how the snippet ran. I'm not sure what the user is when Tomcat runs -- I've started it both from Eclipse and from the shell script startup.sh. The same Exception occurs. [How do I determine the user in this case?] Note that I've set the permissions for the entire tomcat installation to world -readable (r) and world executable (x), so I would think the user wouldn't make a difference to Tomcat being able to read the jar. On Apr 17, 2008, at 10:00 AM, Jim Cox wrote: Do you use the same version of Java and run as the same user Tomcat runs under when you run it "statically outside of Tomcat"? On Thu, Apr 17, 2008 at 9:53 AM, Ken Bowen <[EMAIL PROTECTED]> wrote: Hi all, I've successfully built a number of Tomcat projects using MySQL, but now I have to also use PostgreSQL for a small demo app. I'm having some trouble with the context and datasource. Setup: Tomcat 5.5.26 (unzipped from the Apache site) on Mac OSX 10.5.2, developing using Eclipse 6.0.1/MyEclipse; PostreSQL 8.3.1 with postgresql-8.3-603.jdbc4.jar The following test snippet works fine when run statically outside of Tomcat: public static void main (String[] args) throws ClassNotFoundException, SQLException { Class pgClass = Class.forName("org.postgresql.Driver"); String url = "jdbc:postgresql://localhost:5432/ trackerdb"; Connection connection = DriverManager.getConnection(url, "trackermgr", ""); goes on to retrieve rows from a table in trackerdb My Tomcat app has the following context.xml in META-INF: There is an AppListener which successully uses this to construct a DataSource. However, when I get to attempting to obtain a Connection, I get the following Exception: Exception: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'postgresql://localhost:5432/trackerdb' com.herenow.database.DAOException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'postgresql://localhost:5432/trackerdb' at com.herenow.database.DAOBaseData.getConnection(DAOBaseData.java:38) etc However, the jar file postgresql-8.3-603.jdbc4.jar is present in the app's lib: tracker/WEB-INF/lib. I've also tried moving the jar to tomcat's common/lib, but I get the same Exception. What am I missing here? Thanks in advance, Ken Bowen ~ ~ ~ ~ ~ ~ ~ ~ ~ "tomcat-user-postgresql-context" 43L, 1985C written - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cookie-less session tracking - whats are the downsides
On Thu, 2008-04-17 at 09:38 -0400, Christopher Schultz wrote: > The only runtime bottleneck is the time required to add > ";jsessionid=123456789" to your outgoing URLs, which is to say "pretty > much nothing". The engineering bottleneck is that you have to run all > your URLs through HttpServletRequest.encodeURL or > HttpServletRequest.encodeRedirectURL (which you should have been doing > all along, right?). I doubt you have been doing that unless you have a special HttpServletRequest :) - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with datasource connecting to postgresql
Do you use the same version of Java and run as the same user Tomcat runs under when you run it "statically outside of Tomcat"? On Thu, Apr 17, 2008 at 9:53 AM, Ken Bowen <[EMAIL PROTECTED]> wrote: > Hi all, > > I've successfully built a number of Tomcat projects using MySQL, but now I > have to also use PostgreSQL for a small demo app. I'm having some trouble > with the context and datasource. > > Setup: Tomcat 5.5.26 (unzipped from the Apache site) on Mac OSX 10.5.2, > developing using Eclipse 6.0.1/MyEclipse; > PostreSQL 8.3.1 with postgresql-8.3-603.jdbc4.jar > > The following test snippet works fine when run statically outside of > Tomcat: > > public static void main (String[] args) >throws ClassNotFoundException, SQLException >{ >Class pgClass = Class.forName("org.postgresql.Driver"); >String url = "jdbc:postgresql://localhost:5432/trackerdb"; >Connection connection = DriverManager.getConnection(url, > "trackermgr", ""); > goes on to retrieve rows from a table in trackerdb > > My Tomcat app has the following context.xml in META-INF: > > >type="javax.sql.DataSource" > maxActive="100" maxIdle="30" maxWait="1" > username="trackermgr" password="" > driverClassName="org.postgresql.Driver" > url="postgresql://localhost:5432/trackerdb"/> > > > There is an AppListener which successully uses this to construct a > DataSource. > However, when I get to attempting to obtain a Connection, I get the > following Exception: > > Exception: Cannot create JDBC driver of class 'org.postgresql.Driver' for > connect URL 'postgresql://localhost:5432/trackerdb' > com.herenow.database.DAOException: Cannot create JDBC driver of class > 'org.postgresql.Driver' for connect URL > 'postgresql://localhost:5432/trackerdb' >at > com.herenow.database.DAOBaseData.getConnection(DAOBaseData.java:38) > etc > > However, the jar file postgresql-8.3-603.jdbc4.jar is present in the app's > lib: > tracker/WEB-INF/lib. I've also tried moving the jar to tomcat's > common/lib, but I get > the same Exception. > > What am I missing here? > Thanks in advance, > Ken Bowen > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > "tomcat-user-postgresql-context" 43L, 1985C written > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Problem with datasource connecting to postgresql
Hi all, I've successfully built a number of Tomcat projects using MySQL, but now I have to also use PostgreSQL for a small demo app. I'm having some trouble with the context and datasource. Setup: Tomcat 5.5.26 (unzipped from the Apache site) on Mac OSX 10.5.2, developing using Eclipse 6.0.1/MyEclipse; PostreSQL 8.3.1 with postgresql-8.3-603.jdbc4.jar The following test snippet works fine when run statically outside of Tomcat: public static void main (String[] args) throws ClassNotFoundException, SQLException { Class pgClass = Class.forName("org.postgresql.Driver"); String url = "jdbc:postgresql://localhost:5432/ trackerdb"; Connection connection = DriverManager.getConnection(url, "trackermgr", ""); goes on to retrieve rows from a table in trackerdb My Tomcat app has the following context.xml in META-INF: type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="1" username="trackermgr" password="" driverClassName="org.postgresql.Driver" url="postgresql://localhost:5432/trackerdb"/> There is an AppListener which successully uses this to construct a DataSource. However, when I get to attempting to obtain a Connection, I get the following Exception: Exception: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'postgresql://localhost:5432/trackerdb' com.herenow.database.DAOException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'postgresql://localhost:5432/ trackerdb' at com.herenow.database.DAOBaseData.getConnection(DAOBaseData.java:38) etc However, the jar file postgresql-8.3-603.jdbc4.jar is present in the app's lib: tracker/WEB-INF/lib. I've also tried moving the jar to tomcat's common/lib, but I get the same Exception. What am I missing here? Thanks in advance, Ken Bowen ~ ~ ~ ~ ~ ~ ~ ~ ~ "tomcat-user-postgresql-context" 43L, 1985C written - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: sessionListener.sessionDestroyed is called on shutdown of a node in the cluster
Please remove me from this list... Thanks!! Jim Petruzella Windows System Administrator Distributed Systems Perdue Farms Inc. Corporate Office Salisbury Md. 21802 www.perdue.com [EMAIL PROTECTED] (410) 341-2176 -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 9:50 AM To: Tomcat Users List Cc: Filip Hanik - Dev Lists Subject: Re: sessionListener.sessionDestroyed is called on shutdown of a node in the cluster -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ronald, Ronald Klop wrote: | In sessionDestroyed I register the user as logged out. | | How can I know if sessionDestroyed is called from session.invalidate() | from the real expiration of the session or shutdown of one cluster node? Are your shutdowns typically planned? If so, you could stick something in the session like "shuttingDown192.168.1.123" and then check for that key when you are processing a "session destroyed" event. Just ignore such events from the current machine's IP address. Or, you could even do something like this: 1. Before shutdown, place a "shutting down" key in the application scope. 2. Modify your sessionDestroyed code to do this: public void sessionDestroyed(HttpSessionEvent se) { ~ ServletContext application = se.getSession().getServletContext(); ~ if(null != application.getAttribute("SHUTTING_DOWN")) ~ return; ~ // Otherwise, process the shutdown normally. } This should work given that the application scope is not distributed across nodes in the cluster. You just put your node in a "shutdown" state and then ignore all events (or any you care to ignore). Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHVX0ACgkQ9CaO5/Lv0PC27ACfdh2El6QLeI4LpHaoowJcfJ/Q cOgAn1ocNzI8qXhax4cs/LLUJYSqWytT =7EAa -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER: ** This communication, including attachments, may contain confidential, privileged, copyrighted or other legally protected information. If you are not the intended recipient, you are hereby notified that any use, disclosure, dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please immediately re-send this communication to the sender and delete the original message and any copy of it, including all attachments, from your computer system. ** - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sessionListener.sessionDestroyed is called on shutdown of a node in the cluster
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ronald, Ronald Klop wrote: | In sessionDestroyed I register the user as logged out. | | How can I know if sessionDestroyed is called from session.invalidate() | from the real expiration of the session or shutdown of one cluster node? Are your shutdowns typically planned? If so, you could stick something in the session like "shuttingDown192.168.1.123" and then check for that key when you are processing a "session destroyed" event. Just ignore such events from the current machine's IP address. Or, you could even do something like this: 1. Before shutdown, place a "shutting down" key in the application scope. 2. Modify your sessionDestroyed code to do this: public void sessionDestroyed(HttpSessionEvent se) { ~ ServletContext application = se.getSession().getServletContext(); ~ if(null != application.getAttribute("SHUTTING_DOWN")) ~ return; ~ // Otherwise, process the shutdown normally. } This should work given that the application scope is not distributed across nodes in the cluster. You just put your node in a "shutdown" state and then ignore all events (or any you care to ignore). Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHVX0ACgkQ9CaO5/Lv0PC27ACfdh2El6QLeI4LpHaoowJcfJ/Q cOgAn1ocNzI8qXhax4cs/LLUJYSqWytT =7EAa -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsessionId - is there a way to generate/set in the container
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Farhan, mfs wrote: | Actually we have our own session tracking framework, and now | that i am making a seperate servlet based application, i have come to need | to support interoperability between Servlet HttpSession and the sessions | maintained by our session-tracking framework. Does your current session-tracking framework use HttpServletRequest objects to help identify the request? If so, you could re-factor your session framework to wrap the container's framework. I did this years ago for a company that wrote their own session framework. The container-managed one is really the way to go, here. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHU4EACgkQ9CaO5/Lv0PAEdQCcCSIq8l6OTa3jPfTwJkE/5DVI VQsAoLvjyhc6YdksBV4NnmzPKAE6i39W =jKz0 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cookie-less session tracking - whats are the downsides
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Farhan, mfs wrote: | I would want to know the downsides to using cookie-less sessions ? I want to | give my client the freedom to disable cookies on the browser if he chooses | to, but i would want to know the implications to that ? http://randomcoder.com/articles/jsessionid-considered-harmful I disagree with nearly everything this guy has to say (laziness is no excuse and it's no less risky than using cookies), except for the part about the search engine problems (which shouldn't be understated). The author provides a workaround for that, though. Unfortunately, that solution generates /lots/ of sessions unless your code handles it properly. Frankly, you should be avoiding sessions without authentication in the first place, search engines should never authenticate, and therefore your application should never generate a session for a search engine, and the problem is gone. There are certainly reasons to create sessions for non-authenticated users, but this is one argument against doing that. | Some say, exposing your sessionId in the url exposes it to hackers who can | spoof the IP (as of the victim) and provide the jsessionId (in the url) and | can gain control of the victim's session, but if u are using ssl, that | shouldnt be an issue. ...and this is just as easy with cookies. They are no less susceptible to this type of attack. The only difference is that URLs (including the jsessionid) are often logged on proxies and web servers, while cookies are almost never logged. SSL fixes everything but the logging, which shouldn't be a problem on properly secured systems. | Would someone comment on the real hazards/bottlenecks to the cookie-less | approach. The only runtime bottleneck is the time required to add ";jsessionid=123456789" to your outgoing URLs, which is to say "pretty much nothing". The engineering bottleneck is that you have to run all your URLs through HttpServletRequest.encodeURL or HttpServletRequest.encodeRedirectURL (which you should have been doing all along, right?). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgHUt4ACgkQ9CaO5/Lv0PDFHACgi8yIAnRsDENNTnukH25AVkUG krYAn2xwy69v5FTgJ0MIFhmPsGp5kEkF =vvmJ -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat and jmx
Hi everybody, i would like to monitor my Tomcat 6.0 with another port instead of . How can I change the VM arguments within my Tomcat Service (Windows XP) Thank you JLucas
RE: Tomcat user
Many thanks Antonio > Message du 17/04/08 10:37 > De : "Antonio Vidal Ferrer" > A : "'Tomcat Users List'" , "'ZB'" > Copie à : > Objet : RE: Tomcat user > > Hi: > > > As with many other services, specially web oriented ones, you should use any > user with a limited set of permissions on the host machine. So better use > "lambda" ;) > > Best, > > Toni. > > -Original Message- > From: ZB [mailto:[EMAIL PROTECTED] > Sent: jueves, 17 de abril de 2008 10:10 > To: users@tomcat.apache.org > Subject: Tomcat user > > Hi everybody, > > sorry but i'm new to tomcat ! > > which user id is preferred to run tomcat : "root" or "lambda" ? > > Thank you > > JLucas > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >
Re: WAR created on tomcat 6.0 -Executed on Tomcat 5.5
I've never had standard.jar or jstl.jar anywhere except the webapp's WEB-INF/lib folder so it's hard to say what tomat will do with that. You may have to declare the taglibs in WEB-INF/web.xml when done that way. Also what is the "necessary folders" you installed the jars in? --David Computerjuice wrote: I've just looked at the netbean tutorial(http://www.netbeans.org/kb/55/mysql-webapp.html#getting) that was used as the basis for my application. It was for use with netbeans 5.5, which was bundled with Tomcat 5.5.17 I think. So going by what you have already said, my WAR file is unlikely to contain features of 2.5. I know someone suggested I download ensure package the .jar files. But even if these files did not get packed into my WAR i remember explicitly installing these files into necessary folders on the my server space. This was done by suggestion of the host company. But still the JSTL tags were displayed with no apparent connection to the database. There must be a problem with the website Host. Thank you to all that replied Hassan Schroeder-2 wrote: On Wed, Apr 16, 2008 at 4:59 PM, Computerjuice <[EMAIL PROTECTED]> wrote: So aside form installing Tomcat 6 is there a way round this compatibility issue. ie is there a way that a Tomcat 6.0 WAR could be made to function in tomcat 5.5. That depends on whether your app depends on features of the 2.5 servlet spec, or can run on 2.4. Which is another way of putting my previous, unanswered, question :-) -- Hassan Schroeder [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cookie-less session tracking - whats are the downsides
The "man in the middle" attack you describe below is one possible issue. However it's easy to capture cookies and provide those in an attack. An effective hacker is going to be able to look exactly like the client on an unencrypted connection. URL encoded sessonIds can cause headaches if you a proxy in the middle strip off the sessionIds on the way through or if the search bots suck up URLs with sessonIds. If your app can effectively handle those cases, I don't see a downside. --David mfs wrote: Guys, I would want to know the downsides to using cookie-less sessions ? I want to give my client the freedom to disable cookies on the browser if he chooses to, but i would want to know the implications to that ? Some say, exposing your sessionId in the url exposes it to hackers who can spoof the IP (as of the victim) and provide the jsessionId (in the url) and can gain control of the victim's session, but if u are using ssl, that shouldnt be an issue. Would someone comment on the real hazards/bottlenecks to the cookie-less approach. Thanks in advance and Regards, Farhan. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache 2.2.4 + Tomcat 5.5 + Mod_jk 1.2 causing login loop
The problem was traced to duplicate jvmRoute in the Tomcat's server.xml murthy gandikota <[EMAIL PROTECTED]> wrote: We have 2 tomcat servers being load-balanced by a front-end apache server using mod-jk. Whenever we open a new browser and point the url to the http://fakedomain.com/xyz/content/home/home.jsf and submit the form, we get back the same form again with sessionid. Effectively, we end up logging in twice. In other words, the form is fetched twice and submitted twice. Can anyone please guess what's going on ? Here are the worker.properties: worker.list=loadbalancer worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=worker1,worker2 worker.worker1.type=ajp13 worker.worker1.host=172.16.170.30 worker.worker1.port=8009 worker.worker1.lbfactor=1 worker.worker1.retries=1 worker.worker2.type=ajp13 worker.worker2.host=172.16.170.35 worker.worker2.port=8009 worker.worker2.lbfactor=1 worker.worker2.retries=1 This is mod-jk.conf # Load mod_jk module # Specify the filename of the mod_jk lib LoadModule jk_module modules/mod_jk.so # Where to find workers.properties JkWorkersFile conf/worker.properties # Where to put jk logs JkLogFile logs/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel debug # Select the log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" # JkOptions indicates to send SSK KEY SIZE JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat JkRequestLogFormat "%w %V %T" # Mount your applications JkMount /nva/* loadbalancer JkMount /dwr/* loadbalancer #JkMount /es/* es JkMount /es/* loadbalancer # You can use external file for mount points. # It will be checked for updates each 60 seconds. # The format of the file is: /url=worker # /examples/*=loadbalancer JkMountFile conf/uriworkermap.properties # Add shared memory. # This directive is present with 1.2.10 and # later versions of mod_jk, and is needed for # for load balancing to work properly JkShmFile logs/jk.shm # Add jkstatus for managing runtime data JkMount status Order deny,allow Deny from all Allow from 127.0.0.1 Finally in httpd.conf we have this line Include conf/mod-jk.conf If don't see any errors. What should I be looking in the debug output? Thanks - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: test all nodes in cluster
We use JMX to check if all sessions are available on all nodes. This is some info to do that from ant: http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html It is also very easy to program it from Java. This has helped us a lot detecting and debugging a session-sync problem a few weeks ago. Ronald. On Thu Apr 17 11:34:53 CEST 2008 Tomcat Users List wrote: Li Ma wrote: >> We setup a Tomcat cluster with 3 nodes running behind Apache with mod_jk >> module. >> Everytime we deploy something to the cluster, we would like to make sure >> every single nodes is working. And from time to time, we would like to test >> each node to make sure they are healthy too. However, besides of accessing >> their IP and 8080 port, is there anyway to test against the Apache server >> directly? >> >> For example, is it possible to enter URL like: >> http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca1 >> http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca2 >> http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca3 >> To reach each one of the nodes? Close to that: http://www.myserver.com/mywebapp/test.jsp;jsessionid=123456789.tomca1 http://www.myserver.com/mywebapp/test.jsp;jsessionid=123456789.tomca2 http://www.myserver.com/mywebapp/test.jsp;jsessionid=123456789.tomca3 assuming that tomca1, tomca2 and tomca3 are the jvmRoutes defined in the server.xml of the three nodes. You can replace 123456789 by an even shorter string, I think even an empty string would work, as long as there is a dot before the jvmRoute. Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sessionListener.sessionDestroyed is called on shutdown of a node in the cluster
Thanks for replying. I still have not found a solution. As Filip mentions below. It isn't going to be fixed. Maybe it is possible to do something with valueBound, valueUnbound events, but I didn't have time to check it yet. Ronald. On Wed Apr 16 12:23:38 CEST 2008 Tomcat Users List wrote: Hello, I have the same problem. please let me know if you have got any solution to this. sanjeev Ronald Klop wrote: > > In sessionDestroyed I register the user as logged out. > > How can I know if sessionDestroyed is called from session.invalidate() > from the real expiration of the session or shutdown of one cluster node? > > > Ronald. > > On Thu Mar 20 17:40:26 CET 2008 Tomcat Users List > wrote: >> It's expected behavior, sessions will always expire on the local node >> during a graceful shutdown. >> >> expireSessionsOnShutdown="false" simply means that we don't expire >> sessions in the remote nodes >> >> Filip >> >> >> Ronald Klop wrote: >> > Hello, >> > >> > When I shutdown a node in my cluster (tomcat 5.5.26) sessionDestroyed >> > is called on all SessionListeners on that node. >> > But I'm running a cluster, so one node stopping doesn't mean the >> > session is destroyed. >> > >> > My understanding is that expireSessionsOnShutdown="false" by default >> > and I don't change it in my config. >> > >> > Is this a bug, a feature or am I doing something wrong? >> > >> > Ronald. >> > >> >> > >> > No virus found in this incoming message. >> > Checked by AVG. >> > Version: 7.5.519 / Virus Database: 269.21.7/1334 - Release Date: >> 3/18/2008 8:52 PM >> > >> >> >> - >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> > > -- View this message in context: http://www.nabble.com/sessionListener.sessionDestroyed-is-called-on-shutdown-of-a-node-in-the-cluster-tp16178701p16720610.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: test all nodes in cluster
Li Ma wrote: We setup a Tomcat cluster with 3 nodes running behind Apache with mod_jk module. Everytime we deploy something to the cluster, we would like to make sure every single nodes is working. And from time to time, we would like to test each node to make sure they are healthy too. However, besides of accessing their IP and 8080 port, is there anyway to test against the Apache server directly? For example, is it possible to enter URL like: http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca1 http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca2 http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca3 To reach each one of the nodes? Close to that: http://www.myserver.com/mywebapp/test.jsp;jsessionid=123456789.tomca1 http://www.myserver.com/mywebapp/test.jsp;jsessionid=123456789.tomca2 http://www.myserver.com/mywebapp/test.jsp;jsessionid=123456789.tomca3 assuming that tomca1, tomca2 and tomca3 are the jvmRoutes defined in the server.xml of the three nodes. You can replace 123456789 by an even shorter string, I think even an empty string would work, as long as there is a dot before the jvmRoute. Regards, Rainer - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Roles of an application
> From: maux [mailto:[EMAIL PROTECTED] > I would like to know how can i obtain the roles than an > application uses. > That is, the roles that the users of the application can have. You read the application's documentation or contact its producer. Tomcat has no knowledge of, or control over, application roles or how they are implemented. - Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Roles of an application
Hi, I would like to know how can i obtain the roles than an application uses. That is, the roles that the users of the application can have. Thanks in advance. -- View this message in context: http://www.nabble.com/Roles-of-an-application-tp16741420p16741420.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat user
Hi: As with many other services, specially web oriented ones, you should use any user with a limited set of permissions on the host machine. So better use "lambda" ;) Best, Toni. -Original Message- From: ZB [mailto:[EMAIL PROTECTED] Sent: jueves, 17 de abril de 2008 10:10 To: users@tomcat.apache.org Subject: Tomcat user Hi everybody, sorry but i'm new to tomcat ! which user id is preferred to run tomcat : "root" or "lambda" ? Thank you JLucas - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat user
Hi everybody, sorry but i'm new to tomcat ! which user id is preferred to run tomcat : "root" or "lambda" ? Thank you JLucas
Re: Apache 2.2.4 + Tomcat 5.5 + Mod_jk 1.2 causing login loop
On Wed, April 16, 2008 7:23 pm, murthy gandikota wrote: > We have 2 tomcat servers being load-balanced by a front-end apache > server using mod-jk. Whenever we open a new browser and point the url > to the http://fakedomain.com/xyz/content/home/home.jsf and submit the > form, we get back the same form again with sessionid. Effectively, we > end up logging in twice. In other words, the form is fetched twice and > submitted twice. Have you set to different jvmRoute attributes in the conf/server.xml for the two tomcats? Like ... ... for one tomcat and ... ... for the other one? Otherwise mod_jk will not be able to route the session to the right tomcat (which is the one which generated the session). Or you will have to set up session replication for the tomcats. Bye Felix > Can anyone please guess what's going on ? > Here are the worker.properties: > worker.list=loadbalancer > worker.loadbalancer.type=lb > worker.loadbalancer.balance_workers=worker1,worker2 > worker.worker1.type=ajp13 > worker.worker1.host=172.16.170.30 > worker.worker1.port=8009 > worker.worker1.lbfactor=1 > worker.worker1.retries=1 > worker.worker2.type=ajp13 > worker.worker2.host=172.16.170.35 > worker.worker2.port=8009 > worker.worker2.lbfactor=1 > worker.worker2.retries=1 > This is mod-jk.conf ># Load mod_jk module > # Specify the filename of the mod_jk lib > LoadModule jk_module modules/mod_jk.so > # Where to find workers.properties > JkWorkersFile conf/worker.properties > # Where to put jk logs > JkLogFile logs/mod_jk.log > # Set the jk log level [debug/error/info] > JkLogLevel debug > # Select the log format > JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" > # JkOptions indicates to send SSK KEY SIZE > JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories > # JkRequestLogFormat > JkRequestLogFormat "%w %V %T" > # Mount your applications > JkMount /nva/* loadbalancer > JkMount /dwr/* loadbalancer > #JkMount /es/* es > JkMount /es/* loadbalancer > # You can use external file for mount points. > # It will be checked for updates each 60 seconds. > # The format of the file is: /url=worker > # /examples/*=loadbalancer > JkMountFile conf/uriworkermap.properties > # Add shared memory. > # This directive is present with 1.2.10 and > # later versions of mod_jk, and is needed for > # for load balancing to work properly > JkShmFile logs/jk.shm > # Add jkstatus for managing runtime data > > JkMount status > Order deny,allow > Deny from all > Allow from 127.0.0.1 > > Finally in httpd.conf we have this line > Include conf/mod-jk.conf > If don't see any errors. What should I be looking in the debug output? > Thanks > > > > > - > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it > now. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat ModJK Issues
Razat Gupta (razgupta) wrote: httpd 1.3.26 mod_jk 1.2.1 Time for an upgrade. mod_jk is on 1.2.26. There are also newer versions of httpd and Tomcat but I would start with mod_jk. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can we slow down the speed of servlet response ?
> To start with, I'd take the naive approach and see whether it worked > well enough for the job. I'd use thread.sleep(), and make sure I had > enough worker threads (configured in server/conf.xml) to handle the > number of outstanding requests you want to generate. That could be > many thousands (I don't know your requirements), and each one > potentially consumes a thread on the host operating system, so make > sure you're running on a system that has enough memory and enough > threads configured in the OS. Sorry I can't be specific on what > "enough" is, but I've never done this myself! > > A second - and completely different - approach would be to throttle the > bandwidth out of the server in some way, such that the responses were > buffered for the required time. I'm not sure this is feasible at the > link layer, as I presume you're using HTTP, so the TCP acks would have > to get back in a timely fashion. If you're able to manage that > somehow, though, connecting the Tomcat server via the networking > equivalent of two tin cans and a piece of string - possibly a serial > lead? - might provide the slowdown you're looking for. A third solution: compute your result immediately, keep that in the session as well as the time of the request, forward to a waiting view that will wait client side and then ask the result on a specific URL, then when asked for the result, check that 1) the result has been computed, if this is not the case returns an error, 2) enough time has passed, else re-forward to the waiting view. If all is correct, send the result that lies in the session. Benjamin Lerman - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat ModJK Issues!!!
httpd 1.3.26 mod_jk 1.2.1 Catalina Configuration: Sorry for not posting the exact version earlier. -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Thursday, April 17, 2008 12:30 PM To: Tomcat Users List Subject: Re: Tomcat ModJK Issues!!! Razat Gupta (razgupta) wrote: > We are using Tomcat 4.1.29, Apache 1.3 and modjk in our project. httpd 1.3.what? mod_jk version? Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat ModJK Issues!!!
Razat Gupta (razgupta) wrote: We are using Tomcat 4.1.29, Apache 1.3 and modjk in our project. httpd 1.3.what? mod_jk version? Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]