Re: Loadbalancer in Tomcat 5.5
Peter, Thank you. Can you please tell me if the Tomcat load balance supports SSL? If yes, do I need to setup certificate in the apache as well? Thank you. On 8/14/05, Peter Rossbach [EMAIL PROTECTED] wrote: Mark your session with jvmRoute parameter. Engine jvmRoute=tomcat1 ... see.http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cluster-howto.html Why you can't used balancer demo app? Read http://www.onjava.com/pub/a/onjava/2004/03/31/clustering.html peter samuel cheung schrieb: Hi, Can I use the LoadBalancer webapp to load balance requests to a number of tomcat server in round-robin fashion? I know there is an example of the Loadbalancer in the documentation, but that is different from what I want. And how can the load balancer make sure the same session (based on the session id) handles by the SAME tomcat server? Thank you. Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loadbalancer in Tomcat 5.5
Peter, Thanks. I guess I am confussed by the mod_jk module and the loadbalancer webapp comes with tomcat. When should I use each one? Thank you. Sam On 8/15/05, Peter Rossbach [EMAIL PROTECTED] wrote: Why you don't use apache with mod_jk? Then you can used directly the mod_jk loadbalancer features and apache/ssl support? peter samuel cheung schrieb: Peter, Thank you. Can you please tell me if the Tomcat load balance supports SSL? If yes, do I need to setup certificate in the apache as well? Thank you. On 8/14/05, Peter Rossbach [EMAIL PROTECTED] wrote: Mark your session with jvmRoute parameter. Engine jvmRoute=tomcat1 ... see.http://jakarta.apache.org/tomcat/tomcat-5.5-doc/cluster-howto.html Why you can't used balancer demo app? Read http://www.onjava.com/pub/a/onjava/2004/03/31/clustering.html peter samuel cheung schrieb: Hi, Can I use the LoadBalancer webapp to load balance requests to a number of tomcat server in round-robin fashion? I know there is an example of the Loadbalancer in the documentation, but that is different from what I want. And how can the load balancer make sure the same session (based on the session id) handles by the SAME tomcat server? Thank you. Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Loadbalancer in Tomcat 5.5
Hi, Can I use the LoadBalancer webapp to load balance requests to a number of tomcat server in round-robin fashion? I know there is an example of the Loadbalancer in the documentation, but that is different from what I want. And how can the load balancer make sure the same session (based on the session id) handles by the SAME tomcat server? Thank you. Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fault Tolerance in Tomcat Cluster
Hi, From this article http://www.onjava.com/pub/a/onjava/2004/03/31/clustering.html?page=2, it said Tomcat 5 does not provide a built-in fail over mechanism to detect when a cluster member crashes. Can someone tell me if Tomcat 5.5 provides fail over detection in tomcat cluster? Thank you. Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hotswap servlet code in Tomcat 5?
I have 1 more question regarding this matter. During the upgrade of the servlet, I need to 1. serialize the current session using that servlet 2. undeploy the old servlet 3. deploy the new servlet 4. deserialize the session saved in #1 During this window (from step 1 to 4), if there is a request coming in for those sessions (either during serializion or deserialization), what will happens? Will that request drop? Or that request will be queued by Tomcat, and it will be served when the whole upgrade is done? -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 11:20 AM To: Tomcat Users List Subject: RE: Hotswap servlet code in Tomcat 5? Hi, Is Counter Serializable? Yoav Shapira Millennium ChemInformatics -Original Message- From: Samuel Cheung [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 12:15 PM To: 'Tomcat Users List' Subject: RE: Hotswap servlet code in Tomcat 5? Thanks. I try this, but it is different from what I expected. In my doGet() of my servlet, I have a Counter object in my session. When I reload the page in my browser, I see the value of the counter increments. (say from 0 to 1 to 2). Then I go to the Tomcat manager web page, and then undeploy the original servlet, and deploy a newer version of the same servlet (context name is the same). The value of the counter starts from 0 again when I reload the page again. The difference between the orginal servlet and the new servlet is the name of the Method inc(). I rename it to newInc() in the new servlet. I am expecting the value of the counter will be 3 when I reload the browser after I undeploy/deploy the servlet. Is this a correct assumption? Here is the portion of the doGet() method in my servlet. public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(true); Counter sessionCounter = (Counter) session.getAttribute(session_counter); if (sessionCounter == null) { sessionCounter = new Counter(); session.setAttribute(session_counter, sessionCounter); } // rename inc() to newInc() sessionCounter.inc(); out.println(session counter =); out.println(sessionCounter.getValue()); } -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, March 05, 2004 7:44 AM To: Tomcat Users List Subject: RE: Hotswap servlet code in Tomcat 5? Hi, If the objects in the session is serialized to the disk and then re-serialized when I re-deploy my servlet, what happens if the class in my newer version of my servlet has - added/removed methods/attributes in the class - added/removed static variables in the class How will the hotswap work? One has nothing to with the other, unless you're design is so bad that it places a instance of your servlet class as a session attribute. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hotswap servlet code in Tomcat 5?
Thanks. I try this, but it is different from what I expected. In my doGet() of my servlet, I have a Counter object in my session. When I reload the page in my browser, I see the value of the counter increments. (say from 0 to 1 to 2). Then I go to the Tomcat manager web page, and then undeploy the original servlet, and deploy a newer version of the same servlet (context name is the same). The value of the counter starts from 0 again when I reload the page again. The difference between the orginal servlet and the new servlet is the name of the Method inc(). I rename it to newInc() in the new servlet. I am expecting the value of the counter will be 3 when I reload the browser after I undeploy/deploy the servlet. Is this a correct assumption? Here is the portion of the doGet() method in my servlet. public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(true); Counter sessionCounter = (Counter) session.getAttribute(session_counter); if (sessionCounter == null) { sessionCounter = new Counter(); session.setAttribute(session_counter, sessionCounter); } // rename inc() to newInc() sessionCounter.inc(); out.println(session counter =); out.println(sessionCounter.getValue()); } -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, March 05, 2004 7:44 AM To: Tomcat Users List Subject: RE: Hotswap servlet code in Tomcat 5? Hi, If the objects in the session is serialized to the disk and then re-serialized when I re-deploy my servlet, what happens if the class in my newer version of my servlet has - added/removed methods/attributes in the class - added/removed static variables in the class How will the hotswap work? One has nothing to with the other, unless you're design is so bad that it places a instance of your servlet class as a session attribute. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hotswap servlet code in Tomcat 5?
Sorry, it is my fault. Now I understanding. Sam -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 11:20 AM To: Tomcat Users List Subject: RE: Hotswap servlet code in Tomcat 5? Hi, Is Counter Serializable? Yoav Shapira Millennium ChemInformatics -Original Message- From: Samuel Cheung [mailto:[EMAIL PROTECTED] Sent: Monday, March 08, 2004 12:15 PM To: 'Tomcat Users List' Subject: RE: Hotswap servlet code in Tomcat 5? Thanks. I try this, but it is different from what I expected. In my doGet() of my servlet, I have a Counter object in my session. When I reload the page in my browser, I see the value of the counter increments. (say from 0 to 1 to 2). Then I go to the Tomcat manager web page, and then undeploy the original servlet, and deploy a newer version of the same servlet (context name is the same). The value of the counter starts from 0 again when I reload the page again. The difference between the orginal servlet and the new servlet is the name of the Method inc(). I rename it to newInc() in the new servlet. I am expecting the value of the counter will be 3 when I reload the browser after I undeploy/deploy the servlet. Is this a correct assumption? Here is the portion of the doGet() method in my servlet. public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(true); Counter sessionCounter = (Counter) session.getAttribute(session_counter); if (sessionCounter == null) { sessionCounter = new Counter(); session.setAttribute(session_counter, sessionCounter); } // rename inc() to newInc() sessionCounter.inc(); out.println(session counter =); out.println(sessionCounter.getValue()); } -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, March 05, 2004 7:44 AM To: Tomcat Users List Subject: RE: Hotswap servlet code in Tomcat 5? Hi, If the objects in the session is serialized to the disk and then re-serialized when I re-deploy my servlet, what happens if the class in my newer version of my servlet has - added/removed methods/attributes in the class - added/removed static variables in the class How will the hotswap work? One has nothing to with the other, unless you're design is so bad that it places a instance of your servlet class as a session attribute. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Hotswap servlet code in Tomcat 5?
If the objects in the session is serialized to the disk and then re-serialized when I re-deploy my servlet, what happens if the class in my newer version of my servlet has - added/removed methods/attributes in the class - added/removed static variables in the class How will the hotswap work? I use the hotswap debugging in eclipse IDE, sometimes the hotswap will fail if I change the class structure. I assume hot-deploy of servlet will have the same issues. And how does Tomcat resolve these issues. Thank you for any help. -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Mon, 23 Feb 2004 11:22:29 -0800 To: Tomcat Users List Subject: RE: problem with tomcat shutdown on solaris Howdy, With Tomcat 5, I can deploy/undeploy my WAR file thru the Admin Interface. What happens if there are sessions running the servlet when I try to hotswap to a newer version (i.e. undeploy the current version and re-deploy a newer version)? How will this work? By default the sessions get persisted to disk and restored when the new app starts up. This is just like a normal server shutdown/restart. You can control this behavior by modifying the Manager element in server.xml/context.xml for your webapp, as has been explained many times on the user list. In fact, this whole topic belongs on tomcat-user rather than tomcat-dev, so please continue this discussion there if you have further questions. Yoav Shapira
User define mbeans in servlet under Tomcat 5.0.x
Hi, Is it possible for me to add my own Standard/Dynamic MBeans in my servlet and I can manage that mbean thru Tomcat admin/manager interface? From here, it said I can add my own mbean, but I can't find the file org.apache.catalina.mbeans.mbeans-descriptor.xml http://jakarta.apache.org/tomcat/tomcat-5.0-doc/mbeans-descriptor-howto.html Please tell me if my understanding is correct. Thank you for any help. Sam
RE: User define mbeans in servlet under Tomcat 5.0.x
Thanks for the quick response. So in order to add my own mbeans for my servlet, I need to get modify the file org.apache.catalina.mbeans.mbeans-descriptor.xml in Tomcat source and rebuild the whole tomcat? So I can't use my own mbeans for my servlet on the official Tomcat 5.0.x? And could you please tell me if I can manager my own mbeans thru the existing Tomcat 5.0.x admin/manager interface? Thank you again. -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Monday, January 26, 2004 12:43 PM To: Tomcat Users List Subject: RE: User define mbeans in servlet under Tomcat 5.0.x Howdy, Is it possible for me to add my own Standard/Dynamic MBeans in my servlet and I can manage that mbean thru Tomcat admin/manager interface? From here, it said I can add my own mbean, but I can't find the file org.apache.catalina.mbeans.mbeans-descriptor.xml http://jakarta.apache.org/tomcat/tomcat-5.0-doc/mbeans-descriptor- howto.html The same URL tells you where the file is: org.apache.catalina.mbeans.mbeans-descriptor.xml. You can also see it via cvs.apache.org. The MBeans have to be available to the common classloader, so can't just put them in your WEB-INF/classes or WEB-INF/lib directory. You can put them in common/classes or common/lib. Alternatively you can make your webapp privileged. Finally, take all this with a grain of salt as I haven't added user webapps MBeans to tomcat5, so this is just theory on my part. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SQLException when using a datasource
I am trying to setup a hibernate example with Tomcat 4.1.27. So I add a datasource to my server.xml. But when I access a connection, I got this exception: 20:56:49,072 WARN SessionFactoryImpl:171 - Could not obtain connection metadata java.sql.SQLException: Cannot load JDBC driver class 'null' could some one please tell me how to fix that. I check the parameter of the DBCP connection, they are correct. Thanks in advance. Sam I have added the following in my server.xml of Tomcat: Context path=quickstart docBase=/quickstart Resource name=jdbc/quickstart scope=Shareable type=javax.sql.DataSource/ ResourceParams name=jdbc/quickstart parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- DBCP database connection settings -- parameter nameurl/name valuejdbc:mysql://localhost:3306/mysql/value /parameter parameter namedriverClassName/namevalueorg.gjt.mm.mysql.Driver/value /parameter parameter nameusername/name valueremote/value /parameter parameter namepassword/name valueremote/value /parameter !-- DBCP connection pooling options -- parameter namemaxWait/name value5000/value /parameter parameter namemaxIdle/name value2/value /parameter parameter namemaxActive/name value4/value /parameter /ResourceParams /Context from the Tomcat console 20:56:49,010 INFO DatasourceConnectionProvider:51 - Using datasource: java:comp/env/jdbc/quickstart 20:56:49,010 INFO SessionFactoryImpl:155 - Use outer join fetching: true 20:56:49,057 WARN JDBCExceptionReporter:36 - SQL Error: 0, SQLState: null 20:56:49,057 ERROR JDBCExceptionReporter:44 - Cannot load JDBC driver class 'null' 20:56:49,072 WARN SessionFactoryImpl:171 - Could not obtain connection metadata java.sql.SQLException: Cannot load JDBC driver class 'null' at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.jav a:529) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3 12) at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(Datas ourceConnectionProvider.java:60) at net.sf.hibernate.impl.SessionFactoryImpl.init(SessionFactoryImpl.java:160) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:59 4) at net.sf.hibernate.examples.quickstart.TestHibernateServlet.initHibernate(Test HibernateServlet.java:109) at net.sf.hibernate.examples.quickstart.TestHibernateServlet.doGet(TestHibernat eServlet.java:26) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
RE: slightly OT: tag library for paging
Will this work: http://edhill.its.uiowa.edu/display-examples-0.8/ -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 11:26 PM To: Tomcat Users List Subject: slightly OT: tag library for paging Hi, I apologize for the slightly off-topic post, but is there a tag library available out there for pagination of records fetched from the database? I did google, but didn't find any. thanks, manav.
RE: slightly OT: tag library for paging
or this: http://jsptags.com/tags/navigation/pager/ -Original Message- From: Manavendra Gupta [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 19, 2002 11:26 PM To: Tomcat Users List Subject: slightly OT: tag library for paging Hi, I apologize for the slightly off-topic post, but is there a tag library available out there for pagination of records fetched from the database? I did google, but didn't find any. thanks, manav.
Tomcat and Avalon
Does Tomcat use Avalon(http://jakarta.apache.org/avalon/index.html) as its server framework? Thanks.
RE: Limits to JSP/Servlet Execution time?
I think you need to implement your own mechanism to do that. -Original Message- From: David Boyer [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 3:54 PM To: Tomcat Users List Subject: Q: Limits to JSP/Servlet Execution time? In IIS, we set the ASP script timeout to be 30 seconds and ASP scripts are automatically terminated after 30 seconds. Otherwise, enough requests to a poorly written script could eventaully consume all threads for the scripting engine. Is there a way to do this with JSP/Servlets in Tomcat, at either the application level or the container level to ensure JSP/Servlets cannot run indefinitely. Or is this not needed due to some other design? Thanks! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Filters in Tomcat
Hi, Could someone please tell me if I can activate/deactivate filters in Tomcat dynamically after the servlet is running? Thank you. Sam -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HttpResponseBase.sendRedirect vs JetSpeed
Does the servlet spec allows servlets to flush() the outputStream of the HTTP response class? Or it will be ignored by the container as well? Thanks. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 5:53 PM To: Tomcat Users List Subject: Re: HttpResponseBase.sendRedirect vs JetSpeed Per the servlet spec, it is not legal to modify HTTP headers from inside an include (either RD.include() or jsp:include)), and any such attempt will be ignored by the container. You can certainly build Tomcat from source and make the modification you're talking about in your copy, but you'll be making your copy non-spec-compliant if you do. Craig On Tue, 10 Sep 2002, Erich Bratton wrote: Date: Tue, 10 Sep 2002 17:22:59 -0500 From: Erich Bratton [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: HttpResponseBase.sendRedirect vs JetSpeed Hi, We're working on getting JetSpeed up and running with some portlets using Velocity and some using JSP. We are seeing behavior where, even using Tomcat 4.1 with a bufferSize set to 100k, when a JSP page calls response.sendRedirect(), nothing happens. The problem appears to be in HttpResponseBase, lines 1132-1133, where it checks to see if it is being called from a RequestDispatcher.include() and if so, it just returns and silently does nothing. This behavior seems odd, since lines 1128-1130 check to see if the response has been committed already, and if so, it throws an Exception. Having said all this, is this a bug? Is there a way to configure this behavior from a config file somewhere? Is there a way for us to compile a version of HttpResponseBase with lines 1132-1133 commented out and for us to drop it somewhere in the Tomcat hierarchy where it will 'override' the default Tomcat version of HttpResponseBase? Thanks for any and all ideas, --Erich -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HttpResponseBase.sendRedirect vs JetSpeed
Craig, Thanks. But when i try to call the flush() method incrementally during the execution of the doGet(), the client does not display anything. The browser keeps loading and displayed everything at the end. I am using Tomcat 4.1.10 for this example. Thanks for your help. Sam public void doGet() { int count = 0; response.setBufferSize(1); PrintWriter out = response.getWriter(); for (int i= 0; i 10; i++) { out.println(h1 Count: ); out.println(count++); out.println(/h1); System.out.println (print log count: + count); out.flush(); response.flushBuffer(); Thread.sleep(5000); } -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 10:28 PM To: Tomcat Users List Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed Yes, you can call writer.flush() or response.flushBuffer(). See the servlet spec for all the details: http://java.sun.com/products/servlet/download.html Craig On Tue, 10 Sep 2002, Samuel Cheung wrote: Date: Tue, 10 Sep 2002 18:04:00 -0500 From: Samuel Cheung [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed Does the servlet spec allows servlets to flush() the outputStream of the HTTP response class? Or it will be ignored by the container as well? Thanks. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 5:53 PM To: Tomcat Users List Subject: Re: HttpResponseBase.sendRedirect vs JetSpeed Per the servlet spec, it is not legal to modify HTTP headers from inside an include (either RD.include() or jsp:include)), and any such attempt will be ignored by the container. You can certainly build Tomcat from source and make the modification you're talking about in your copy, but you'll be making your copy non-spec-compliant if you do. Craig On Tue, 10 Sep 2002, Erich Bratton wrote: Date: Tue, 10 Sep 2002 17:22:59 -0500 From: Erich Bratton [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: HttpResponseBase.sendRedirect vs JetSpeed Hi, We're working on getting JetSpeed up and running with some portlets using Velocity and some using JSP. We are seeing behavior where, even using Tomcat 4.1 with a bufferSize set to 100k, when a JSP page calls response.sendRedirect(), nothing happens. The problem appears to be in HttpResponseBase, lines 1132-1133, where it checks to see if it is being called from a RequestDispatcher.include() and if so, it just returns and silently does nothing. This behavior seems odd, since lines 1128-1130 check to see if the response has been committed already, and if so, it throws an Exception. Having said all this, is this a bug? Is there a way to configure this behavior from a config file somewhere? Is there a way for us to compile a version of HttpResponseBase with lines 1132-1133 commented out and for us to drop it somewhere in the Tomcat hierarchy where it will 'override' the default Tomcat version of HttpResponseBase? Thanks for any and all ideas, --Erich -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: HttpResponseBase.sendRedirect vs JetSpeed
Craig, Thanks for your help. When you say * You are using a web connector that does its own buffering., do you mean the Web connector within Tomcat? Isn't tomcat 4.1 use coyote as its web connector? Thanks again. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 10:48 PM To: Tomcat Users List Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed Possible reasons: * You are opening an HTML element like table or p and not closing it before the flush, and writing to a browser that does not incrementally render (like Netscape 4.x). * You are using a web connector that does its own buffering. * There is a proxy or something in between. * Bug in 4.1.10 (submit a bug report). Counting on incremental output being visible is a very chancy bet. Craig On Tue, 10 Sep 2002, Samuel Cheung wrote: Date: Tue, 10 Sep 2002 22:38:15 -0500 From: Samuel Cheung [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed Craig, Thanks. But when i try to call the flush() method incrementally during the execution of the doGet(), the client does not display anything. The browser keeps loading and displayed everything at the end. I am using Tomcat 4.1.10 for this example. Thanks for your help. Sam public void doGet() { int count = 0; response.setBufferSize(1); PrintWriter out = response.getWriter(); for (int i= 0; i 10; i++) { out.println(h1 Count: ); out.println(count++); out.println(/h1); System.out.println (print log count: + count); out.flush(); response.flushBuffer(); Thread.sleep(5000); } -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 10:28 PM To: Tomcat Users List Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed Yes, you can call writer.flush() or response.flushBuffer(). See the servlet spec for all the details: http://java.sun.com/products/servlet/download.html Craig On Tue, 10 Sep 2002, Samuel Cheung wrote: Date: Tue, 10 Sep 2002 18:04:00 -0500 From: Samuel Cheung [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Subject: RE: HttpResponseBase.sendRedirect vs JetSpeed Does the servlet spec allows servlets to flush() the outputStream of the HTTP response class? Or it will be ignored by the container as well? Thanks. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 5:53 PM To: Tomcat Users List Subject: Re: HttpResponseBase.sendRedirect vs JetSpeed Per the servlet spec, it is not legal to modify HTTP headers from inside an include (either RD.include() or jsp:include)), and any such attempt will be ignored by the container. You can certainly build Tomcat from source and make the modification you're talking about in your copy, but you'll be making your copy non-spec-compliant if you do. Craig On Tue, 10 Sep 2002, Erich Bratton wrote: Date: Tue, 10 Sep 2002 17:22:59 -0500 From: Erich Bratton [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: HttpResponseBase.sendRedirect vs JetSpeed Hi, We're working on getting JetSpeed up and running with some portlets using Velocity and some using JSP. We are seeing behavior where, even using Tomcat 4.1 with a bufferSize set to 100k, when a JSP page calls response.sendRedirect(), nothing happens. The problem appears to be in HttpResponseBase, lines 1132-1133, where it checks to see if it is being called from a RequestDispatcher.include() and if so, it just returns and silently does nothing. This behavior seems odd, since lines 1128-1130 check to see if the response has been committed already, and if so, it throws an Exception. Having said all this, is this a bug? Is there a way to configure this behavior from a config file somewhere? Is there a way for us to compile a version of HttpResponseBase with lines 1132-1133 commented out and for us to drop it somewhere in the Tomcat hierarchy where it will 'override' the default Tomcat version of HttpResponseBase? Thanks for any and all ideas, --Erich -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail
Using the new Tomcat Admin Page in Tomcat 4.1.x
Hi, I am using log4j in my servlet. log4j has JMX interface to change its parameters at run-time. Could someone please tell me if I can use the new Tomcat Admin Page in Tomcat 4.1.x to change the log4j parameters? Thanks. Sam -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Run away servlet in Tomcat
Hi, How does Tomcat handle a run away servlet? (I mean tomcat gets a request, it call a servlet to handle it, that servlet stuck in an infinite loop) Can tomcat still handle new requests to same/other servlet? Can we config tomcat to kill certain request if it does not finish execution within a time period? Thank you. Sam -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
tomcat 4.x and new io in JDK 1.4
Hi, Could someone please tell me if Tomcat 4.x is using the new IO in JDK 1.4? If not, will Tomcat be changed to take advantage the new IO functionality? Thanks. Sam __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]