RE: High load on CPU from upload attempts
Hi There, you can get an evaluation version of JProfiler or netbeans now comes with a free profiler. Thanks Pete -Original Message- From: Holly, Michael [mailto:[EMAIL PROTECTED] Sent: 09 September 2004 16:35 To: Tomcat Users List Subject: RE: High load on CPU from upload attempts Yoav Well... I currently do not have a Test server that resides in the same environment that production resides in ( long story ) Also I do not have a profiler. Is there a free profiler? Can you point me toward one? I do have one client box that seems to consistently be able to induce the behavior. The upload module is home grown based on the article http://www.fawcette.com/javapro/2002_01/magazine/features/acalsavara/ . I have been wanting to switch to commons fileupload but haven't found the time. I really feel this is somehow caused by mal formed multipart request from IE 6. I potentially have the ability to profile the behaviour in the off hours on the production system. Michael -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 10:18 AM To: Tomcat Users List Subject: RE: High load on CPU from upload attempts Hi, Can you reproduce the behavior on a test server? If so, you can run Tomcat with a Profiler on the test server and see exactly where CPU time is spent. Another thing you can do if you can reproduce the behavior is check out the new J2SE 5.0 debugging tools. If you can't reproduce the behavior, you're in a tougher spot obviously. What are you using to handle the upload, commons-fileupload? Yoav Shapira Millennium Research Informatics >-Original Message- >From: Holly, Michael [mailto:[EMAIL PROTECTED] >Sent: Thursday, September 09, 2004 11:07 AM >To: [EMAIL PROTECTED] >Subject: High load on CPU from upload attempts > >I am having a problem with high CPU utilization by my Tomcat (java) >process. > >First some background > >Sun V880 >Solaris 9 >java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition >java.vm.version = 1.4.1_06-b01 Tomcat 4.1.27 >MySQL 3.23.53 >Homegrown object cache (eliminates trips to database) >DBCP > >We are running the 64 bit extensions for java. > >Application is a viewer of reports and is used to upload new reports. >Report sizes are anywhere from 2k to 800 MB. Users can only view at >most 1500 pages (~10MB) at any one time. > >400 total users. 50 fairly active users. maybe 4 concurrent tops > >Client in almost all cases is IE 6 using https over a VPN > >CPU utilization for java is usually < 2% > >Here is a top when java is out of control > >load averages: 2.42, 2.43, 2.39 hou-ftp >09:45:50 >88 processes: 85 sleeping, 1 stopped, 2 on cpu >CPU states: 51.9% idle, 31.8% user, 16.2% kernel, 0.0% iowait, 0.0% >swap >Memory: 8.0G real, 5.8G free, 706M swap in use, 6.8G swap free > > PID USERNAME THR PR NCE SIZE RES STATE TIME FLTSCPU COMMAND > 29028 root 32 0 0 365M 325M cpu02 17.1H1 26.27% java > 15313 root 1 20 0 1872K 1416K sleep 9:470 2.98% >resend.sh > 24938 root 1 59 0 1912K 1456K sleep 9:500 0.05% >nocmon.20040406 > 7123 mholly 1 29 10 2680K 1720K cpu06 1:090 0.04% top > 5339 root 1 59 0 1904K 1432K sleep 19:020 0.02% >get_pushes.sh > 1 root 1 59 0 1304K 528K sleep 91:030 0.01% init > 16772 root 1 59 0 1992K 1520K sleep 19:190 0.01% >postmaster.sh > 29503 root 1 59 0 4512K 2920K sleep 0:000 0.01% sshd > 776 root 1 59 0 952K 720K sleep 0:000 0.01% sleep > 702 root 1 59 0 952K 720K sleep 0:000 0.01% sleep > 29429 root 1 59 0 952K 720K sleep 0:000 0.01% sleep > 16785 root 1 59 0 1912K 1440K sleep 10:320 0.00% >distribution.sh > 11717 root 1 60 0 9488K 7848K sleep 0:230 0.00% arkvlib > 229 root 1 59 0 1872K 1416K sleep 0:000 0.00% ksh > 7753 root 1 59 0 4304K 3192K sleep 37.9H0 0.00% >burst_controlle > >My SA ran truss when the box was under distress, however, I do not >understand what I am looking at. He says it is polling something. > >It appears this problem occurs after a user performs an upload to the >system. We have had problems with IE 6 and poor way it manages >authentication, however, >we seem to have a work around for this. > >Not all users induce this load when they upload. After the event in >question CPU bumps from < 2% to ~25% (1 CPU taken up) and stays there. >If another event >occurs then the CPU goes to ~50% (2 CPUs) etc. > >I think the event occurs when a user attempts and upload and it appears >to be hung so they click the upload button again. What > >What options do I have for instrumenting this and understanding what is >going on? My SA wants to know if there are any switches we can apply to >help us understand >what is happening at a java level. > >Obviously, we are looking at upgrading the J
RE: Trouble running Tomcat using Sun's JDK1.4.2_05
Hi There, Thanks for the reply, what I dont understand is why it woudl work with 1.4.2_04, the only thing that has changed is the JDK. No config changes have been made. Thanks Pete -Original Message- From: Kannan Raghu [mailto:[EMAIL PROTECTED] Sent: 09 July 2004 08:40 To: Tomcat Users List Subject: Re: Trouble running Tomcat using Sun's JDK1.4.2_05 go ahead check ur xml files... if there is any problem in xml files u will get this sort of org.apache.jasper.JasperException... like, u would have missed some tags or context path etc.. Kannan On Fri, 9 Jul 2004 08:15:22 +0100, Peter Guyatt <[EMAIL PROTECTED]> wrote: > Hi There, > >Has anyone come across this problem. All Iam am doing is starting tomcat > and then attempting to use my web app. > > The exception I am getting is as follows: > > Exception report > > message > > description The server encountered an internal error () that prevented it > from fulfilling this request. > > exception > > org.apache.jasper.JasperException: Error allocating a servlet instance >at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 > 54) >at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) >at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) >at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) >at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application > FilterChain.java:247) >at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh > ain.java:193) >at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja > va:256) >at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok > eNext(StandardPipeline.java:643) >at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) >at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) >at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja > va:191) >at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok > eNext(StandardPipeline.java:643) >at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) >at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) >at > org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) >at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 > ) >at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok > eNext(StandardPipeline.java:643) >at > org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. > java:171) >at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok > eNext(StandardPipeline.java:641) >at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 > ) >at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok > eNext(StandardPipeline.java:641) >at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) >at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) >at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java > :174) >at > org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok > eNext(StandardPipeline.java:643) >at > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) >at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) >at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) >at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601) >at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne > ction(Http11Protocol.java:392) >at > org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) >at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav > a:619) >at java.lang.Thread.run(Thread.java:534) > > root cause > > javax.servlet.ServletException: Error allocating a servlet instance >at > org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:672) >at > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. > java:653) >at > org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch > er.java:432)
Trouble running Tomcat using Sun's JDK1.4.2_05
Hi There, Has anyone come across this problem. All Iam am doing is starting tomcat and then attempting to use my web app. The exception I am getting is as follows: Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Error allocating a servlet instance at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:534) root cause javax.servlet.ServletException: Error allocating a servlet instance at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:672) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:653) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch er.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:356) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430) at org.apache.jsp.index_jsp._jspService(index_jsp.java:42) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 10) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(Standard
Trouble running Tomcat using Sun's JDK1.4.2_05
Hi There, Has anyone come across this problem. All Iam am doing is starting tomcat and then attempting to use my web app. The exception I am getting is as follows: Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Error allocating a servlet instance at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:619) at java.lang.Thread.run(Thread.java:534) root cause javax.servlet.ServletException: Error allocating a servlet instance at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:672) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:653) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch er.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:356) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:430) at org.apache.jsp.index_jsp._jspService(index_jsp.java:42) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 10) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(Standard
RE: TC5 / Solaris CPU usage
Hi There, Have you tried just running Tomcat without you web application. It could be configuration? I think TC5 has extra configuration files, maybe its a configuration issue. Thanks Pete -Original Message- From: David Parfitt [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 12:50 To: Tomcat Users List Subject: RE: TC5 / Solaris CPU usage No luck. Same results. Cheers- Dave --- Peter Guyatt <[EMAIL PROTECTED]> wrote: > Hi There, > > Try running in client mode. > > Thanks > > Pete > > -Original Message- > From: David Parfitt [mailto:[EMAIL PROTECTED] > Sent: 25 June 2004 11:33 > To: Tomcat Users List > Subject: RE: TC5 / Solaris CPU usage > > > I've tried 5.0.25 - same results + other non-related > issues so we ended up > sticking > with 5.0.16. > > Cheers - > Dave > > > "Dale, Matt" <[EMAIL PROTECTED]> wrote: > > We use tomcat 5 on solaris 9 without this problem. > Have you considered > upgrading to the latest stable release 5.0.25? > > Ta > Matt > > -Original Message- > From: David Parfitt [mailto:[EMAIL PROTECTED] > Sent: 24 June 2004 22:40 > To: [EMAIL PROTECTED] > Subject: TC5 / Solaris CPU usage > > > Hi - > I'm having a problem using Tomcat 5.0.16 on Solaris > 9. > We've just upgraded to Tomcat 5 from 4.x and are > having a problem > with CPU usage. After we start our app, the CPU > load goes to 50% and never goes below this number. > Does anyone else have any experience with this > problem? > Running truss shows that Java is in a tight loop > doing a yield(). > (We don't have any code that uses threads outside of > the Tomcat > code, and we aren't in an infinite loop anywhere). > > We are using: > java version "1.4.2_04" > Java(TM) 2 Runtime Environment, Standard Edition > (build 1.4.2_04-b05) > Java HotSpot(TM) Client VM (build 1.4.2_04-b05, > mixed mode) > > JAVA_OPTS="-server -Xms300m -Xmx1000m" > export JAVA_OPTS > > I've also tried using these in JAVA_OPTS: > -Xconcurrentio -Xincgc > > SunOS foo 5.9 Generic_112233-11 sun4u sparc > SUNW,Sun-Fire-280R > > Any help would be greatly appreciated! > > Cheers - > Dave > > > - > Do you Yahoo!? > Yahoo! Mail - 50x more storage than other providers! > Any opinions expressed in this E-mail may be those > of the individual and not > necessarily the company. This E-mail and any files > transmitted with it are > confidential and solely for the use of the intended > recipient. If you are > not the intended recipient or the person responsible > for delivering to the > intended recipient, be advised that you have > received this E-mail in error > and that any use or copying is strictly prohibited. > If you have received > this E-mail in error please notify the beCogent > postmaster at > [EMAIL PROTECTED] > Unless expressly stated, opinions in this email are > those of the individual > sender and not beCogent Ltd. You must take full > responsibility for virus > checking this email and any attachments. > Please note that the content of this email or any of > its attachments may > contain data that falls within the scope of the Data > Protection Acts and > that you must ensure that any handling or processing > of such data by you is > fully compliant with the terms and provisions of the > Data Protection Act > 1984 and 1998. > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > - > Do you Yahoo!? > New and Improved Yahoo! Mail - Send 10MB messages! > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - 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: TC5 / Solaris CPU usage
Hi There, Try running in client mode. Thanks Pete -Original Message- From: David Parfitt [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 11:33 To: Tomcat Users List Subject: RE: TC5 / Solaris CPU usage I've tried 5.0.25 - same results + other non-related issues so we ended up sticking with 5.0.16. Cheers - Dave "Dale, Matt" <[EMAIL PROTECTED]> wrote: We use tomcat 5 on solaris 9 without this problem. Have you considered upgrading to the latest stable release 5.0.25? Ta Matt -Original Message- From: David Parfitt [mailto:[EMAIL PROTECTED] Sent: 24 June 2004 22:40 To: [EMAIL PROTECTED] Subject: TC5 / Solaris CPU usage Hi - I'm having a problem using Tomcat 5.0.16 on Solaris 9. We've just upgraded to Tomcat 5 from 4.x and are having a problem with CPU usage. After we start our app, the CPU load goes to 50% and never goes below this number. Does anyone else have any experience with this problem? Running truss shows that Java is in a tight loop doing a yield(). (We don't have any code that uses threads outside of the Tomcat code, and we aren't in an infinite loop anywhere). We are using: java version "1.4.2_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05) Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode) JAVA_OPTS="-server -Xms300m -Xmx1000m" export JAVA_OPTS I've also tried using these in JAVA_OPTS: -Xconcurrentio -Xincgc SunOS foo 5.9 Generic_112233-11 sun4u sparc SUNW,Sun-Fire-280R Any help would be greatly appreciated! Cheers - Dave - Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! Any opinions expressed in this E-mail may be those of the individual and not necessarily the company. This E-mail and any files transmitted with it are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this E-mail in error and that any use or copying is strictly prohibited. If you have received this E-mail in error please notify the beCogent postmaster at [EMAIL PROTECTED] Unless expressly stated, opinions in this email are those of the individual sender and not beCogent Ltd. You must take full responsibility for virus checking this email and any attachments. Please note that the content of this email or any of its attachments may contain data that falls within the scope of the Data Protection Acts and that you must ensure that any handling or processing of such data by you is fully compliant with the terms and provisions of the Data Protection Act 1984 and 1998. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jspc
Hi There, The memory leak was in JDK1.4.1 and was to do with Strings and StringBuffer sharing memory for performance. Use JDK1.4.2 to ensure that this problem does not happen. Pete -Original Message- From: Nick Curry [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 11:08 To: Tomcat Users List Subject: RE: jspc I seem to remember something about a known memory leak in javac 1.4 (not sure which version), which might affect you if you use javac and have many JSPs to compile - so that might be another argument for precompiling your jsps... Nick -Original Message- From: Michiel Toneman [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 10:29 To: Tomcat Users List Subject: Re: jspc A good reason to precompile your JSP files is to make sure you don't accidentally have broken JSP files on production. You then know *before* deployment if any changes to your JSP files or the java classes they belong to cause breakage. Michiel Paul Wallace wrote: >Hi, > Yes..that is what I thought, but I learned from a 'reliable' >source I could accomplish this on saving overhead. So rather than >looking into the whys and whats, I looked into how to do it, and look >into the performance benefits later. I will provide the list with my >sources reasoning, when it becomes available! > A thought..and to answer a question with a question (Why would >you precompile jsp files?), why is jspc there? If only to increase >performance on the first hit? > >Thanks > >Paul. > >It will increase speed on the first viewing of the jsp, but after that I > >can't see how there will be any difference. How much memory can you >save >if any? And how would that work? > >Thanks > >On Fri, 25 Jun 2004 11:12:44 +1000, Paul Wallace <[EMAIL PROTECTED]> >wrote: > > > >>In an effort to increase speed/free up memory that otherwise might be >>consumed by Tomcat otherwise >> >>Why would you precompile jsp files? >> >>On Fri, 25 Jun 2004 09:32:38 +1000, Paul Wallace <[EMAIL PROTECTED]> >>wrote: >> >> >> >>>(sorry, wrong key!) >>> >>>Hi Jason, >>> Thanks for that. Yes, it does make sense. A couple of things >>>though, I just ran it with -compile - great. But my query about the >>> >>> >>work >> >> >>>directory and was more towards what I am being 'encouraged' to do >>> >>> >from > > >>>the powers that be. I.e not WAR the app., but put it in the work >>>directory. Is this ill-advised/poor practice? >>> To accomplish this, is it as simple as dragging the compiled >>>source under my work directory, and modifying my web.xml as advised? >>> Why does -compile work, but not appear in the usage?! >>> Also, can I specify a path for the compilation, rather than the >>>classes be placed in the same dirs as the source? (I tried adding a >>> >>> >>path >> >> >>>after the -compile switch, but it constructed and compiled a file >>> >>> >with > > >>>the same name as the class directory destination). >>> >>>Do I make sense?! >>> >>>Paul. >>> >>>Paul, >>> >>>I just use the -compile option and have jspc do the >>>compilation from .java to .class for me. It seems to >>>work fairly well. Once all the fully compiled (ie >>>.class) files are placed in you applications >>>WEB-INF/classes directory you just need to place the >>>generated web.xml file in WEB-INF. There is an option >>>to create a complete web.xml file that you can place >>>in WEB-INF or, if you already have a web.xml file you >>>want to keep, you can have jspc create an xml fragment >>>that just contains the servlet definitions and >>>mappings that you then add (in the appropriate place) >>>to your existing web.xml. Then just war up you >>>application directory in the normal way (you can even >>>delete the jsps once your certain the servlet mappings >>>are working). >>> If you try to put the generated files in your >>>working directory you won't be able to war them up and >>>deploy them in the normal "put war file under webapps >>>directory and tomcat will expand it when it starts" >>>way. You'd have to ship a complete tomcat directory >>>structure with the work directory already filled in >>>with your compiled jsps. Does that make sense? >>> >>>Jason >>> >>>--- Paul Wallace <[EMAIL PROTECTED]> wrote: >>> >>> Hello, I have compiled my JSPs thus: jspc -webapp C:\src\site -d C:\src\site\classes -s -l -uriroot C:\src\site this builds the Java source files to the specified location, but how might I deploy them? What is a typical deployment after a JSP compilation? Compilation of Java source files, then WAR/JAR? Can I not define the JSP compile to go under my work directory? The purpose of my efforts is to try and speed up / make TC less memory consumptive. cheers Paul. -- Michiel Toneman Software Engineer Bibit Global Payment Services Regulierenring 10 3981 LB Bunnik [EMAIL PROTECTED] Tel. +31-30-6595168 Fax +31-30-6564464
RE: how to check if a String is empty?
Hi There, You could do the check test.length() > 0 Pete -Original Message- From: Carl Olivier [mailto:[EMAIL PROTECTED] Sent: 24 June 2004 17:18 To: 'Tomcat Users List' Subject: RE: how to check if a String is empty? There is a trim() funtion in java.lang.String ? -Original Message- From: Marten Lehmann [mailto:[EMAIL PROTECTED] Sent: 24 June 2004 06:20 PM To: 'Tomcat Users List' Subject: how to check if a String is empty? Hello, maybe this is not the perfect group for my question, but as my problem appears at the development of JSPs and tomcat is concerned with that, I hope you can answer it. I often see the condition String test = req.getParameter("test"); if (test == null) { /* string is empty */ } else { /* string contains something */ } But if test contains just blanks and other whitespaces, it's not null, but doesn't contain usable data anyhow. How can I check if a string contains whitespaces only? I though of something like if (test == null || test.trim().equals("")) { } but there's no trim()-function, right? How do you solve this problem? With whitespaces I mean blanks, tabs and newlines. Regards Marten - 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: Apps terminating abruptly
Hi There, This exception is thrown when the Method.invoke method is called. The actual reason for this exception occurring is that the method invoked by this call has thrown an Exception. For more information on the exception an the Method class please look at the API documentation: http://java.sun.com/j2se/1.4.2/docs/api/ Thanks Pete -Original Message- From: Andi Reinbrech [mailto:[EMAIL PROTECTED] Sent: 18 May 2004 09:24 To: 'Tomcat Users List' Subject: RE: Apps terminating abruptly Thanks for replying, Well, a thread dump wouldn't help. I've noticed last night that the app actually terminates at a specific point, but no exception is raised, so I can't figure out what the problem is. Java "sends" the exception back to .NOT - I get a " java.lang.reflect.InvocationTargetException" from within my C# application. I have now narrowed it down to not being a 5.0.24 issue, as I have just copied the whole jakarta-5.0.18 dir from my test server to my local machine, and it *still* doesn't work. I.e. something is buggered on my machine. I have set PATH= and CLASSPATH= to nothing before running startup.bat, just to make sure I'm not picking up Oracle's JRE instead of 1.4.2. The JSDK verions on production and my machine are identical. H... apart from the /jre/lib/ext directories - maybe there's something extra in there that "makes it work" on the production box. Will give that a try. But in the meantime I would greatly appreciate any help - esp. what the " java.lang.reflect.InvocationTargetException" exactly means. Thanks, Andi ** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: XSLT in Tomcat apps
Hi There, We use the Xerces XML parser and the Xalan XSLT processor. all are downloadable from http://xml.apache.org We usually just add the jar files to the WEB-INF/lib directory or in the j2sdk1.4.2_xx/jre/lib/endorsed directory is we are using a JDK later than 1.3 Hope this helps Pete -Original Message- From: Paul [mailto:[EMAIL PROTECTED] Sent: 05 May 2004 14:59 To: Tomcat Users List Subject: XSLT in Tomcat apps does anyone out there use XSLT with Tomcat 4 or 5? if so, which xslt processor do you use, and how do you make it accessible via Tomcat to your web apps? i cannot seem to find any documentation toward using xslt with Tomcat. i have been struggling with this issue for days now, so even a vague pointer in the right direction would be a great help. thanks, paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Accessing Dll's
eturnStreet, StringBuffer > >> csReturnCityName, StringBuffer csReturnCounty, StringBuffer > >> csReturnState, StringBuffer csReturnZip, StringBuffer csReturnErrorMsg) ; > >> //-- > >> > >> - > >> public AddressValidate(){ > >> inad=null; > >> outad=null; > >> usercompany=new String(""); > >> > >> } > >> //-- > >> > >> - > >> public String validate (Address inad,Address outad){ > >> csReturnStreet=new StringBuffer(""); csReturnCityName=new > >> StringBuffer(""); csReturnCounty=new StringBuffer(""); > >> csReturnState=new StringBuffer(""); csReturnZip=new StringBuffer(""); > >> csReturnErrorMsg=new StringBuffer(""); this.inad=inad; > >> this.outad=outad; > >> > >> > >> try{ > >> // System.out.println("Street1 :"+inad.Street1); > >> // System.out.println("city :"+inad.City); > >> // System.out.println("state :"+inad.State); > >> // System.out.println("postalcode"+inad.PostalCode); > >> > >> JAVAAVSValidate (usercompany, > >> inad.Street1, > >> inad.City, > >> inad.State, > >> inad.PostalCode, csReturnStreet, csReturnCityName, csReturnCounty, > >> csReturnState, csReturnZip, csReturnErrorMsg); > >> outad.Street1 = csReturnStreet.toString(); outad.City = > >> csReturnCityName.toString(); outad.County = csReturnCounty.toString(); > >> outad.State = csReturnState.toString(); outad.PostalCode = > >> csReturnZip.toString(); // System.out.println("Street1 :"+outad.Street1); > >> // System.out.println("city :"+outad.City); > >> // System.out.println("state :"+outad.State); > >> // System.out.println("postalcode"+outad.PostalCode); > >> > >> }catch(Exception e){ > >> System.out.println("Error in Validating Address " + e.toString()); > >> } > >> > >> return (csReturnErrorMsg.toString()); > >> } > >> > >> > >> } > >> > >> Peter Guyatt wrote: > >> Hi There, > >> > >> Can I see you native code and your class that declares you native > >> methods. > >> > >> Thanks > >> > >> Pete > >> > >> -Original Message- > >> From: Mark Schmeets [mailto:[EMAIL PROTECTED] > >> Sent: 22 April 2004 16:13 > >> To: Tomcat Users List > >> Subject: Re: Accessing Dll's > >> > >> > >> Hi, > >> Is it possible that this dll is being loaded somewhere else in your > >> instance? > >> My experience with this error came from trying to use the Oracle native > >> JDBC drivers. It usually came down to one of three issues, first that > >> the dll couldn't be "found", second that another web-app had already > >> loaded it, third it was a dll versioning problem. > >> Hope it helps. > >> > >> Mark > >> > >> Annamalai Ramasamy wrote: > >> > >> > >>> Hi., > >>> Again same error. > >>> I did put the dll to /jre/bin and winnt/system32. > >>> Any other ideas please... > >>> Thanks., > >>> MALAI > >>> > >>> Hans Wichman wrote: > >>> sorry, i meant lib\bin\ instead of lib\ext\ > >>> > >>> grtz > >>> Sorv > >>> > >>> At 03:43 PM 4/22/2004 +0100, Annamalai Ramasamy wrote: > >>> > >>> > >>> > >>>> Hi., > >>>> Again Same Error.. > >>>> Actually after the System.loadlibrary..i can able to see my > >>>> system.out.println values. > >>>> Then while trying to call my method i'm getting UnsatishfiedLinkError. > >>>> Thanks., > >>>> MALAI > >>>> > >>>> Hans Wichman wrote: > >>>> try putting them in the lib/ext folder of your j2sdk1.4.2_03 folder. > >>>> > >>>> grtz > >>>> Sorv > >>>> > >>>> At 03:24 PM 4/22/2004 +0100, Annamalai Ramasamy wrote: > >>>> > >>>> > >>>> > >>>>> Hi., > >>>>> I'm using Tomcat4.0.29 wi
RE: Accessing Dll's
Hi There, Can I see you native code and your class that declares you native methods. Thanks Pete -Original Message- From: Mark Schmeets [mailto:[EMAIL PROTECTED] Sent: 22 April 2004 16:13 To: Tomcat Users List Subject: Re: Accessing Dll's Hi, Is it possible that this dll is being loaded somewhere else in your instance? My experience with this error came from trying to use the Oracle native JDBC drivers. It usually came down to one of three issues, first that the dll couldn't be "found", second that another web-app had already loaded it, third it was a dll versioning problem. Hope it helps. Mark Annamalai Ramasamy wrote: >Hi., >Again same error. >I did put the dll to /jre/bin and winnt/system32. >Any other ideas please... >Thanks., >MALAI > >Hans Wichman <[EMAIL PROTECTED]> wrote: >sorry, i meant lib\bin\ instead of lib\ext\ > >grtz >Sorv > >At 03:43 PM 4/22/2004 +0100, Annamalai Ramasamy wrote: > > >>Hi., >>Again Same Error.. >>Actually after the System.loadlibrary..i can able to see my >>system.out.println values. >>Then while trying to call my method i'm getting UnsatishfiedLinkError. >>Thanks., >>MALAI >> >>Hans Wichman wrote: >>try putting them in the lib/ext folder of your j2sdk1.4.2_03 folder. >> >>grtz >>Sorv >> >>At 03:24 PM 4/22/2004 +0100, Annamalai Ramasamy wrote: >> >> >>>Hi., >>>I'm using Tomcat4.0.29 with J2SDK 1.4.2_03. >>>I have my native libraries(dll's) in winnt folder. >>>I'm loading the dll thru System.loadlibrary and accessing the methods. >>>I'm getting UnsatishfiedLinkError. >>>My class files are in my web-inf classes directory. >>>In forums i searcehed, and i tried out all possibility like >>>setting path and changing my classes to common/classes and all. >>>Please give me your suggestions... >>>Thanks., >>>MALAI >>> >>> >>>- >>>Yahoo! Messenger - Communicate instantly..."Ping" your friends today! >>>Download Messenger Now >>> >>> >>- >>To unsubscribe, e-mail: [EMAIL PROTECTED] >>For additional commands, e-mail: [EMAIL PROTECTED] >> >> >>- >>Yahoo! Messenger - Communicate instantly..."Ping" your friends today! >>Download Messenger Now >> >> > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > >- > Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now > > - 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: Accessing Dll's
Hi There, Put you DLL's in the /winnt/system32 directory. Thanks Pete -Original Message- From: Annamalai Ramasamy [mailto:[EMAIL PROTECTED] Sent: 22 April 2004 15:44 To: Tomcat Users List Subject: Re: Accessing Dll's Hi., Again Same Error.. Actually after the System.loadlibrary..i can able to see my system.out.println values. Then while trying to call my method i'm getting UnsatishfiedLinkError. Thanks., MALAI Hans Wichman <[EMAIL PROTECTED]> wrote: try putting them in the lib/ext folder of your j2sdk1.4.2_03 folder. grtz Sorv At 03:24 PM 4/22/2004 +0100, Annamalai Ramasamy wrote: >Hi., > I'm using Tomcat4.0.29 with J2SDK 1.4.2_03. >I have my native libraries(dll's) in winnt folder. >I'm loading the dll thru System.loadlibrary and accessing the methods. >I'm getting UnsatishfiedLinkError. >My class files are in my web-inf classes directory. >In forums i searcehed, and i tried out all possibility like >setting path and changing my classes to common/classes and all. >Please give me your suggestions... >Thanks., >MALAI > > >- > Yahoo! Messenger - Communicate instantly..."Ping" your friends today! > Download Messenger Now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
serving static HTML pages from a servlet
Hi There, I would like to serve a static web page using Tomcat. The problem I have is that a use must have been authencated before they can view this page. I have a servlet that takes care of this and then it should forward the user to the static page. E.g. /WEB-INF/English/Welcome/Welcom.htm However all I get is a 404 error, I am sure the path is ok. Any suggestions Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5 : java.lang.OutOfMemoryError
Hi There, Yep that exactly what I am saying ;-) I had this problem with the stuff that I have done, a customer wanted to display a file that happened to be 10 meg, so I to use the print stream in a Servlet instead of using JSP pages. Thanks Pete -Original Message- From: Francesco Pellegrini [mailto:[EMAIL PROTECTED] Sent: 20 April 2004 11:31 To: Tomcat Users List Subject: R: Tomcat 5 : java.lang.OutOfMemoryError At the moment I use : java class to execute query JSP page that shows the result of the query. Your answer means i need to execute query and shows the result by SERVLET ? Thans Francesco. -Messaggio originale- Da: Peter Guyatt [mailto:[EMAIL PROTECTED] Inviato: martedì 20 aprile 2004 12.19 A: Tomcat Users List Oggetto: RE: Tomcat 5 : java.lang.OutOfMemoryError Hi There, I have seen this before. It is when your page is going to be over a certain size. (I believe its around 4MB) Just use a Servlet to display the result of the query Thanks Pete -Original Message- From: Francesco Pellegrini [mailto:[EMAIL PROTECTED] Sent: 20 April 2004 11:05 To: Tomcat-User-ML Subject: Tomcat 5 : java.lang.OutOfMemoryError Hi all, I have Tomcat 5.0.18 with one java web application and database Access 2000. When one Servlet/JSP try to make "heavy" query to database, tomcat shows this error message : 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 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:867) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:800) org.apache.jsp.pannelli.telematica.visconsumi_jsp._jspService(visconsumi_jsp .java:789) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 11) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) root cause java.lang.OutOfMemoryError -- I've tried to modify the catilina.bat file, increased start memory by set : set CATALINA_OPTS=" -server -Xmx1200M -Xms1200M -Xss256k" but i still having the same problem How can I solve it? Thans in advance for your kind attention, Francesco. - 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]
RE: Tomcat 5 : java.lang.OutOfMemoryError
Hi There, I have seen this before. It is when your page is going to be over a certain size. (I believe its around 4MB) Just use a Servlet to display the result of the query Thanks Pete -Original Message- From: Francesco Pellegrini [mailto:[EMAIL PROTECTED] Sent: 20 April 2004 11:05 To: Tomcat-User-ML Subject: Tomcat 5 : java.lang.OutOfMemoryError Hi all, I have Tomcat 5.0.18 with one java web application and database Access 2000. When one Servlet/JSP try to make "heavy" query to database, tomcat shows this error message : 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 org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:867) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:800) org.apache.jsp.pannelli.telematica.visconsumi_jsp._jspService(visconsumi_jsp .java:789) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 11) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) root cause java.lang.OutOfMemoryError -- I've tried to modify the catilina.bat file, increased start memory by set : set CATALINA_OPTS=" -server -Xmx1200M -Xms1200M -Xss256k" but i still having the same problem How can I solve it? Thans in advance for your kind attention, Francesco. - 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: SESSION VARIABLE BECOMES NULL AFTER SOME REFRESH
Hi There, The NPE is coming from the { if (session == null || session.isNew()) } since even if session is null then you are still trying to call a method of session. a safer alternative would be if (session == null) { //error } else { if (session.isNew()) { } else { } } Thanks Pete -Original Message- From: MUKUND Premchander [mailto:[EMAIL PROTECTED] Sent: 12 April 2004 11:19 To: [EMAIL PROTECTED] Subject: SESSION VARIABLE BECOMES NULL AFTER SOME REFRESH Hi, I have a jsp page which is refreshed atuomatically every 10 seconds.I get and put values in the session by using the implicit session variable . Everything works fine for say 2-3 mins after that the session becomes null and throws a null pointer exception. IN the try block I even have a code as try { if (session == null || session.isNew()) { //do something } else { //do otherwise } }catch(Exception e ) { //print stack trace and value of session } I get a null pointer exception and session is preinted as null but even the if block is noit executed . I printed the value of request.getSession(false);.This gives me session object ,where as the implicit session does not have this after many refresh interval . During the first few refresh both have the same value. Also note that this runs fine in Windows ,I get this problem only in UNIX . I use tomcat 3.2 in unix and view using IE in windows Please help me out as to where I am going wrong . thanks and Regards Mukund - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: calling native code
Hi there, What OS are you using ? If windows just copy the dll to the windows/system32 directory or solaris to the use/lib directory. That way you dont have to specify the location of the library Thanks Pete -Original Message- From: Astrid Wagner [mailto:[EMAIL PROTECTED] Sent: 05 April 2004 13:13 To: [EMAIL PROTECTED] Subject: calling native code Hi, I am using tomcat 4.1.24 and want to use native c-code with JNI. I have a shared library installed in an oracle subdirectory that is added to the LD_LIBRARY_PATH when Apache is started (apachectl) but when I restart tomcat this directory is no longer in it which leads to a java.lang.UnsatisfiedLinkError: error. Where can I modify the LD_LIBRARY_PATH within tomcat ? When I restart Apache, the LD_LIBRARY_PATH is correct but I get a ClassDefNotFound exeception for the class that calls the c-interface (IprShellInterface.class package com.mot.sps.ipr.common). I have installed that class in CATALINA_HOME/common/classes/com/mot/sps/ipr/common/IprShellInterface.class. I called that class successfully before but now I seemed to have run into a deadlock. Can anyone help? Thanks Astrid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
PDF Files
Hi All, Does anyone know how to jump directly to a specific page in a PDF document if you have manually loaded it and served it through a servlet ? Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I get a method to be called every 60 seconds in Tomcat?
Hi There, How about writing your own timer task, that performs a callback on an on class implementing TimerListener. Thanks Pete -Original Message- From: David Rees [mailto:[EMAIL PROTECTED] Sent: 16 March 2004 07:29 To: Tomcat Users List Subject: Re: How can I get a method to be called every 60 seconds in Tomcat? tom ly wrote, On 3/15/2004 7:01 PM: > I want to get a method to automatically get called every 60 seconds > in Tomcat. The method reset() will reset monitoring information. > How can I do this? Jcrontab - http://jcrontab.sourceforge.net/ -Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 4.1 hangs on File Reading
Hi There, This read of the file? are you doing it a character at a time (ie via the read() method?) If so try reading more than one charcter at a time. Ie. public void readFile (String filename) { try { File f = new File(filename); FileReader fr = new FileReader(f); char data[] = new char[4096]; int line = 0, read, i; //loop until all the data is read from the stream while ((read = fr.read(data, 0, 4096)) != -1) { //do somthing with the data read } } catch (Exception e) { e.printStackTrace(); } } This will dramatically improve performance and hopefully stop your problem Thanks Pete -Original Message- From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Sent: 10 March 2004 13:06 To: Tomcat Users List Subject: Re: Tomcat 4.1 hangs on File Reading Adam, Sound very similar to a problem I had a couple of days ago. Are you using any loops in your code? Specifically while or do-while or endless for loops. If so try changing them to a for loop with a high count say 10k-100k and see what happens. I had a sort method that under the right conditions would bring down my IDE and hog all the processor. Doug www.parsonstechnical.com - Original Message - From: "Adam Buglass" <[EMAIL PROTECTED]> To: "Tomcat Users List" <[EMAIL PROTECTED]> Sent: Wednesday, March 10, 2004 7:52 AM Subject: Tomcat 4.1 hangs on File Reading > I've got a website which members can log in and out of > (by way of a form which connects to a JSP). > > I've created a simple method in a Java class to write to > a text format log file to tell me stuff like who they are, > when they logged in etc. > > So far so good. > > I'm now trying to write a JSP to analyse this log but > when I try and access the page, tomcat usually hangs > indefinitely. Occassionally it will display something I jtas ask > for, say, the Strings of IDs. Tomcat will then slow right down > (approximately 4-6x slower) and eventually need restarting. > > I've tried with a smaller test file. > I'm closing the file connection which I open in Java. > There doesn't appear to be anything in the logs, in fact > neither Tomcat nor Apache appear to recognise the page request > at all. > > Any ideas / thoughts / suggestions !? > > Thanks, > Adam. > > > - > 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: Using tomcat to serve PDF files
Hi There, Thanks, I forgot to use get output stream. Cheers Pete -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: 05 March 2004 16:15 To: Tomcat Users List Subject: RE: Using tomcat to serve PDF files Hi, > I was hoping that someone would be able to point me in the direction >of an >example for using tomcat to serve PDF files. It's been discussed many times on the list in the past. There really isn't much to it: - Write the PDF via response.getOutputStream (not getWriter) because it's binary data, - Set the content-type appropriately - Set the content-disposition header if you'd like, so that the user is prompted with the open/save dialog box. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using tomcat to serve PDF files
Hi, I was hoping that someone would be able to point me in the direction of an example for using tomcat to serve PDF files. Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Invalidate User Session
Hi There, Not very easily, There is no onClose event for the window object in the DOM model. I found some javascript code that would mimic the onClose function but if you refreshed the page via F5 or the refresh button then it assumed it was closing the window. If this is not a problem I could forward you the javascript. Thanks Pete -Original Message- From: Juan de Bravo [mailto:[EMAIL PROTECTED] Sent: 04 March 2004 10:45 To: Lista usuarios tomcat (E-mail) Subject: Invalidate User Session Hi everybody, is it possible to listen for window closing event to invalidate user session? Thanks, Juan. - 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: addShutdownHook in Tomcat does not seem to get called on shutdown
Hi There, Why not use the ServletContextListener interface to do all of your cleanup stuff when the contextDestroyed method is called ? Pete -Original Message- From: Elie Medeiros [mailto:[EMAIL PROTECTED] Sent: 03 March 2004 10:44 To: [EMAIL PROTECTED] Subject: addShutdownHook in Tomcat does not seem to get called on shutdown Hi, I added a shutdown hook in my app, which works fine when I run it in standalone mode, but which does not seem to get called when Tomcat stops. The shutdown hook operates according to following the following semantics: __ class MyApp{ public void doSomething(){ ShutdownHook sdh = new ShutdownHook(); synchronized(Runtime.getRuntime()){ Runtime.getRuntime().addShutdownHook(sdh); } // //do something here // logger.info("Finished doing something"); //remove shutdown hook once process has finished sdh.setFinished(); if (!sdh.isInitialised()){ synchronized(Runtime.getRuntime()){ Runtime.getRuntime().removeShutdownHook(sdh); } } } private class ShutdownHook extends Thread { private boolean INITIALISED = false; private boolean FINISHED = false; public void run() { this.INITIALISED = true; this.setPriority(2); logger.debug("Shutdown hook: shutdown thread started - a shutdown has been requested"); out : while (true) { //keep on looping until the claaing app has finished synchronized(this.FINISHED){ if (this.FINISHED == true) { logger.debug("Shutdown hook: parent program finished, allowing shutdown process to complete"); return; } } } } public synchronized boolean isInitialised() { return this.INITIALISED; } public synchronized void setFinished() { this.FINISHED = true; } } } __ The log does not show any trace of the shutdown hook being called, and the process does indeed not complete before Tomcat shuts down, which to me sounds like the hook is not getting registered properly for some reason. Any ideas why this might be happening? I am running Tomcat 4.1.18 on Windows 2K (no advice about switching to Linux please). Thanks, Elie - 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: Stopping repeating requests
Hi All, Thanks for the replys. The form is processed by my servlet and the user is directed to another page (in this case a summary list of all of the data that they have entered). The problem occurrs when they hit refresh on this summary page and the last action was to add a new entry to there database, it looks like it is because the URL still has the last request in it. Is there any way of clearing this URL other than useing window.location.href ? The unique token sounds like a good idea. Thanks Pete -Original Message- From: Parsons Technical Services [mailto:[EMAIL PROTECTED] Sent: 18 February 2004 18:14 To: Tomcat Users List Subject: Re: Stopping repeating requests Phil, True. I should have not said "all client side". How about client side validation? Point being as weather to handle it more from the client or server. All depends on application. Doug > Hi! > > Parsons Technical Services wrote: > > The > > better way is to clear the form or send them to another page. That's all > > client side. > > Not necessarily. What I do in such situations is this: have a servlet > process the form data and then send something else (e.g. an "update > successfull"-page) as response via sendRedirect(). This way, the user > _has_ to at least push the back button. If you then add headers to > prevent the page containing the form from being cached, even that > would give the user a plain empty form all over again. > > Phil > > > - > 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: printStackTrace throwing java.lang.StackOverflowError
Hi There, It looks like an exeception to do with either a recursive method call or a problem with inheritenance. HTH Pete -Original Message- From: Unnikrishnan C [mailto:[EMAIL PROTECTED] Sent: 19 February 2004 08:22 To: [EMAIL PROTECTED] Subject: printStackTrace throwing java.lang.StackOverflowError Hi, I'm using Apache Tomcat 5.0.18, I'm getting a " java.lang.StackOverflowError" while trying to do a printStackTrace for an Exception (java.lang.Exception). The code is working fine when it is running on IBM Websphere Application Server 4.0, but fails when I put it in Tomcat. The stack trace is attached java.lang.StackOverflowError at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) at com.info.aa.exception.HipaaException.printStackTrace(HipaaException.java:77) at java.lang.Throwable.printStackTrace(Throwable.java:451) Thanks, Unnikrishnan
Stopping repeating requests
Hi, I have a problem where a user enters data into a form and then submits this to the server, which in turn wrights this content into a database. The problem I have is that if the user then refreshes the page via F5 then it adds the same data in again. Is there any way to ensure that this does not occur. Any help would be greatly appreciated. Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to know when Tomcat has completed startup?
What about using a session listener. Why not call your method in the constructor for the SessionListsner Pete -Original Message- From: James Neville [mailto:[EMAIL PROTECTED] Sent: 16 February 2004 12:38 To: [EMAIL PROTECTED] Subject: How to know when Tomcat has completed startup? Hi all, I'm trying to get a certain method within my startup class to *only* execute after Tomcat startup has fully completed. I understand I can implement a LifecycleListener, but there only seems to be before/after start/stop events. (i'm not sure that Lifecycle.AFTER_START_EVENT refers to 'startup is complete', or 'startup event was requested') In short, as part of my Startup procedure, we pre-generate(if rqd) a fornightly clandar of 'events' from some JSPs on the same Tomcat instance. The problem is mainly that we also use Apache/JK2, so a HTTP 500 error is generated (the Apache connection can be made, but Tomcat is not yet available), unless we can defer until Tomcat has started. I could, of course, defer the event for a few minutes, but that doesn't strike me as much of a graceful approach. I'm assuming this is probably pretty simple? Any pointers would be much appreciated. (not google.com, been all morning in there! :) ) James - 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]
XForms processor
Hi, Does anyone know of an XForms processor other than OXF that can be used with Tomcat ? Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I limit ( or reduce) the max Mb of RAM for tomcat?
Hi There, the -Xmx is what is used to limit the maximum amount of memeory that java uses. I have heard of problems in the JVM itself when using the -server, try removing this and see if this memory problem resolves itself. It could be that there is a memory leak in your code, do you have a session listener that adds sessions to a collection?, if so do you remove them from this collection when the session is destroyed ? Thanks Pete -Original Message- From: Salvador Santander Gutierrez [mailto:[EMAIL PROTECTED] Sent: 21 January 2004 09:00 To: Tomcat List Subject: How can I limit ( or reduce) the max Mb of RAM for tomcat? I want to limit ( or reduce) the max Mb of RAM for tomcat, Can I configure this in Tomcat? We've a problem with Tomcat: Memory assigned to Tomcat grows and grows and when process of Tomcat use the 64% of phisical memory, Tomcat crash and I need to restart the server. We're using Red Hat Linux 9, jdk 1.4.2, and Tomcat 4.1.24 with the options JAVA_OPST="-server -Xms128m -Xmx512m -Dfile.encoding=ISO-8859-1" Thanks. - 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: Keeping servlet thread awake
Hi There, It sounds to me like you have deadlock, not that tomcat is killing your thread Can your post the source so that I can take a look at it. Thanks Pete -Original Message- From: Allan Bruce [mailto:[EMAIL PROTECTED] Sent: 20 January 2004 14:08 To: Tomcat Users List Subject: Re: Keeping servlet thread awake > > Howdy, > This is not a good design to start with. However, let's address your > immediate issue first: how do you know that tomcat kills the thread? > How do you start the thread? > > Yoav Shapira > Millennium ChemInformatics > I dont know that tomcat kills it as such, but I do know there is a problem. The problem is only apparent if I compile the file on my linux machine (the same one that tomcat runs on). If I compile the file on my windows machine and transfer it across, everything runs fine. Let me try to explain what my servlet is trying to accomplish. At start of day, during init() the servelet loads the necessary config and spawns a thread which is used purely for synchronising the servlet with others that are specified in the config. This thread is the one that I am requesting to sleep for 30 minutes at a time. Meanwhile, the servlet processes any requests as normal. During creating this separate thread synchronized(sSema4) is called to ensure that the contents of the data are not altered during the synchronising process (awkward naming!). sSema4 is a static Object() passed to the synchronized() method. There is no error, but when compiled on my linux machine the thread hangs when calling synchronized(sSema4). I hope I have managed to explain things a little better now. Thanks for the help Allan - 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: Memory Leaks
Hi There, You can invoke the garbage collector by using the System.gc() method. The memory is never returned to OS but the JVM keeps it in a pool used for object creation, it would make no sense in releasing this back to the OS as it will probably need to use it at some point or another. In more recent JVM's (1.4 onwards) the garbage collector has been threaded to improve performance and penalties as until then the cost of a collection was relatively expensive. For more information read the documentation at www.java.sun.com Hope this helps Pete -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: 14 January 2004 14:07 To: Tomcat Users List Subject: Re: Memory Leaks My understanding is that the GC runs on a low-priority thread, so you never get to tell it when to run. The operating system and JVM deal with it. I also recall reading that memory is returned to the JVM, but not released back to the OS. So if you're watching Memory Usage in the Windows Task Manager and not seeing it go down, that might explain why. - MOD --- Christian Witucki <[EMAIL PROTECTED]> wrote: > Does anyone know that when Garbage Collection is > going on how often it should be set to collect and > if memory is really being returned. I believe that > the memory is not, but how can I check to determine > that??? > > Christian Witucki > Network Analyst > 375 Essjay Road > Williamsville, NY 14221 > 716-631-3001 x3812 > > CONFIDENTIALITY NOTICE. This e-mail and attachments, > if any, may contain confidential information which > is privileged and protected from disclosure by > Federal and State confidentiality laws, rules or > regulations. This e-mail and attachments, if any, > are intended for the designated addressee only . If > you are not the designated addressee, you are hereby > notified that any disclosure, copying, or > distribution of this e-mail and its attachments, if > any, may be unlawful and may subject you to legal > consequences. If you have received this e-mail and > attachments in error, please contact Independent > Health immediately at (716) 631-3001 and delete the > e-mail and its attachments from your computer. > Thank you for your attention. > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Maximum page size before JasperException
Hi There, The JSP page had it as a JavaScript variable (long story!!). I am more curious to find out what the maximum size is due to an academic curiosity Thanks Pete -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: 17 December 2003 11:21 To: Tomcat Users List Subject: Re: Maximum page size before JasperException Hmm maybe you can just write out the file to the response body in a servlet ? Or do you need to do something in the jsp ? Peter Guyatt wrote: >Hi there, > > Its an XML file > >Pete > >-Original Message- >From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] >Sent: 17 December 2003 11:12 >To: Tomcat Users List >Subject: Re: Maximum page size before JasperException > > >What are you displaying in a JSP page that takes up 4 megs ? > > >Peter Guyatt wrote: > > > >>Hi There, >> >> Can anyone possibly tell me what the maximum page size allowed when >>compiling/presenting JSP page. >> >>The question arises when I try and display a 4meg file. >> >>If there is a limit is there any way to increase the maximum allowed size? >> >>Thanks >> >>Pete >> >> >>- >>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]
RE: Maximum page size before JasperException
Hi there, Its an XML file Pete -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: 17 December 2003 11:12 To: Tomcat Users List Subject: Re: Maximum page size before JasperException What are you displaying in a JSP page that takes up 4 megs ? Peter Guyatt wrote: >Hi There, > > Can anyone possibly tell me what the maximum page size allowed when >compiling/presenting JSP page. > >The question arises when I try and display a 4meg file. > >If there is a limit is there any way to increase the maximum allowed size? > >Thanks > >Pete > > >- >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]
Maximum page size before JasperException
Hi There, Can anyone possibly tell me what the maximum page size allowed when compiling/presenting JSP page. The question arises when I try and display a 4meg file. If there is a limit is there any way to increase the maximum allowed size? Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Dies
Hi There, It looks like there is a memory lieak in your code, do you have any listeners, and if so are you storing the session objects in a collection and not removing them from the collection when they are being invalidated. Thanks Pete -Original Message- From: Rob Wichterman [mailto:[EMAIL PROTECTED] Sent: 24 November 2003 15:44 To: 'Tomcat Users List' Subject: Tomcat Dies I have two tomcat instances each on a separate folder. My problem is that after a few days we get one the following errors in Catalina.out 1. Exception java.lang.OutOfMemoryError: requested 24 bytes for promotion. Out of swap space? 2. SEVERE: Caught exception executing [EMAIL PROTECTED], terminating thread java.lang.OutOfMemoryError Any help would be appreciated. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Synchronising database access
Hi There, Use a singleton class to manage the database transactions. Then implement a owner mechanism. E.g. class DbTxMgr { String owner = null; public synchronized boolean lockMgr (String threadId) { if (owner == null) { owner = threadId; return true; } else { if (owner.equals(threadId)) { return true } return false; } } public synchronized void releaseMgr (String threadId) { if (owner != null) { if (owner.equals(threadId)) { owner = null; } } } public synchronized boolean insert (String statement, String threadId) { if (owner == null) { owner = threadId; } if (owner.equals(threadId)) { //do the transaction } } } your code class tester { //name of your thread Thread t = new Thread("testerThread") ... if (lockMgr(t.getName())) { //do database code } lockMgr.releaseLock(t.getName()); } This way olny the owner of the lock can perform transactions and all other threads must wait for the lock to be released Thanks Pete -Original Message- From: Antony Paul [mailto:[EMAIL PROTECTED] Sent: 21 November 2003 11:51 To: Tomcat Users List Subject: [OT] Synchronising database access Hi, I want to synchronise all database access. There are lots of situations where first first a select query is performed to get the results and then insert/update data. I dont want to implement row level locking or optimistic locking. I just want to synchronise the whole process. Only after a thread completes the entire process other threads can execute the code. How to do it. Do I have to synchronise on Connection or on this or implement SingleThreadModel. I also want to know how much extra time a synchronised block requires than an unsynchronised block. Antony Paul. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Crashing
Hi There, Which platform are you running on if its linix or solaris then it could be either the SIGINT (ctrc-c) or SIGHUP (your console closing) causing it to exit. Thanks Pete -Original Message- From: Bender, Christopher [mailto:[EMAIL PROTECTED] Sent: 19 November 2003 14:42 To: Tomcat Users List Subject: Tomcat Crashing Hey, I am fairly new to Tomcat and developing a web-app that does some database work. Lately, Tomcat (4.1.29) will sometimes inexplicably crash without error. My Tomcat console window just closes and I get an apache error, 500 Internal Server Error, in my browser, (apache and tomcat liked with mod_jk2). When I look in the log files, I do not see anything that seems abnormal. I wish I could give more information but Im not even sure where to look right now. Has anyone in the community encountered a similar problem and found what the cause may be? If there is somewhere else I could look for error information please let me know. Thanks, Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to tune Tomcat and Java?
Hi There sorry sent the last one before it was ready ;-) Java and Tomcat are both multi-threaded applications. So they are both using more than one CPU (if available). If it is using 50% of one processor then it is using 100% CPU on that processor, since its 50% of the actual processing capacity. Check for an infinate loop without a sleep in your code, especially if you are attempting to connect a client socket to a server since linux does not wait before throwing an exception. Thanks Pete -Original Message- From: Jens Ove Lillegraven [mailto:[EMAIL PROTECTED] Sent: 12 November 2003 15:17 To: [EMAIL PROTECTED] Subject: How to tune Tomcat and Java? Hi, We have a problem in that the Tomcat (java) process is the bottleneck and is using only one CPU. There will be high load on the server when it is put online, so we are stress testing it offline now. Using the top command in Linux during the stress test, it seems that java is the bottleneck of the system. But it uses not 100%, but about 45-50% of one CPU. We get no http error, the page performance (pages pr. second) is just getting worse as we put on more stress load. The max memory consumption is set to 300M, but I've never seen java using more than 111M. I suppose the throughput would have increased if both CPUs could be used, but is Java (Tomcat) a single processor application? The network throughput has a maximum average of 500kbps (kilo-bits) during the stress test, and should manage much more. Anyone who know how to make java and Tomcat performing better? Details of hardware and innstalled applications: Compaq ProLiant 6000, 2 x PII Xeon 400MHz, 1,3GB RAM Red Hat Linux Enterprise 3 ES J2EE: j2sdkee-1_3_1-linux J2SE: j2sdk-1_4_2_02-linux-i586 Tomcat: 4.1.24 MySQL: 4.0.16 Tuning Tomcat memory (done): in /usr/bin/dtomcat4: CATALINA_OPTS="-Xmx300M -Xms100M $CATALINA_OPTS $JPDA_OPTS" MySQL has been tuned, and is running very well. Thanks Jens Ove - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to tune Tomcat and Java?
Hi There, Java and Tomcat are both multi-threaded applications. So they are both using more than one CPU. If it is using 50% of one processor then it is using 100% CPU on that processor, since its 50% of the actual processing capacity. Thanks Pete -Original Message- From: Jens Ove Lillegraven [mailto:[EMAIL PROTECTED] Sent: 12 November 2003 15:17 To: [EMAIL PROTECTED] Subject: How to tune Tomcat and Java? Hi, We have a problem in that the Tomcat (java) process is the bottleneck and is using only one CPU. There will be high load on the server when it is put online, so we are stress testing it offline now. Using the top command in Linux during the stress test, it seems that java is the bottleneck of the system. But it uses not 100%, but about 45-50% of one CPU. We get no http error, the page performance (pages pr. second) is just getting worse as we put on more stress load. The max memory consumption is set to 300M, but I've never seen java using more than 111M. I suppose the throughput would have increased if both CPUs could be used, but is Java (Tomcat) a single processor application? The network throughput has a maximum average of 500kbps (kilo-bits) during the stress test, and should manage much more. Anyone who know how to make java and Tomcat performing better? Details of hardware and innstalled applications: Compaq ProLiant 6000, 2 x PII Xeon 400MHz, 1,3GB RAM Red Hat Linux Enterprise 3 ES J2EE: j2sdkee-1_3_1-linux J2SE: j2sdk-1_4_2_02-linux-i586 Tomcat: 4.1.24 MySQL: 4.0.16 Tuning Tomcat memory (done): in /usr/bin/dtomcat4: CATALINA_OPTS="-Xmx300M -Xms100M $CATALINA_OPTS $JPDA_OPTS" MySQL has been tuned, and is running very well. Thanks Jens Ove - 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]
Creation of HttpServlets
Hi All, I am hoping someone can help answer me this quick question. If I had a web app with one servlet for processing all requests would that one servlet be used by every thread or is it a one to one relation (each thread uses its own instance of the servlet). Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problems with dbcp
Hi, Why dont you override the finialize method so that when your objects fall out of scope and are garbage collected then you close the connections ? Thanks Pete -Original Message- From: Florian Ebeling [mailto:[EMAIL PROTECTED] Sent: 03 November 2003 13:27 To: Tomcat Users List Subject: Re: problems with dbcp Ok. That's the same point I am currently trying to solve. I intentionally leave connections open, but they don't get freed. Perhaps someone else could comment here? -Florian my settings in server.xml--- factory org.apache.commons.dbcp.BasicDataSourceFactory maxActive 20 maxIdle 5 maxWait 1 username caspar password geheim driverClassName com.mysql.jdbc.Driver url jdbc:mysql://localhost:3306/tomcatds?autoReconnect=true removeAbandoned true removeAbandonedTimeout 10 logAbandoned true Edson Alves Pereira wrote: > But removeAbandoned and removeAbandonedTimeout doesn´t close > all ResultSet, Statement and Connections even if they are forsaken? > > > >>-- >>De: Florian Ebeling[SMTP:[EMAIL PROTECTED] >>Responder:Tomcat Users List >>Enviada: segunda-feira, 3 de novembro de 2003 9:51 >>Para: Tomcat Users List >>Assunto: Re: problems with dbcp >> >>Hi, >> >>you probably do nor close some statement, resultSet or connection. When >>using CP one has to do this always explicitly. >> >>Tyrex is an alternative CP implementation which has been replaced by DBCP. >> >>Edson Alves Pereira wrote: >> >> >>> Hello folks, i followed what is written in tomcat-4.1.x´s JDNI >>>DataSource documentation, but i getting this error: >>> >>>java.sql.SQLException: DBCP could not obtain an idle db connection, pool >>>exhausted >>> >>> The machanism is not returning my connection to pool, what do i >>>should do? Do i really need tirex as Persistence Layer? Here is my DBCP >>>configuration: >>> >auth="Container" >>>type="javax.sql.DataSource"/> >>> >>> >>>factory >>>org.apache.commons.dbcp.BasicDataSourceFactory >>> >>> >>> >>>maxActive >>>10 >>> >>> >>> >>> >>>maxIdle >>>30 >>> >>> >>> >>>maxWait >>>1 >>> >>> >>> >>>username >>>blah >>> >>> >>>password >>>blah >>> >>> >>> >>>driverClassName >>>oracle.jdbc.driver.OracleDriver >>> >>> >>> >>>url >>>jdbc:oracle:thin:@000.000.000:blah >>> >>> >>> >>>validationQuery >>>select sysdate from dual >>> >>> >>> >>>removeAbandoned >>>true >>> >>> >>> >>>removeAbandonedTimeout >>>60 >>> >>> >>> >>>logAbandoned >>>true >>> >>> >>> >>> As i wrote above, DBCP should revover all connection objects and >>>close automatic everything, but is not. Any idea? >>> >>> Regards, >>> Edson >>> >> >> >>- >>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: Intermittent Performance Problems
Hi There, Change to either the 1.4.2 or 1.3.1 branch of Java. Pete -Original Message- From: icewind [mailto:[EMAIL PROTECTED] Sent: 30 October 2003 20:42 To: [EMAIL PROTECTED] Subject: Intermittent Performance Problems Hello, I'm having performance issues that are hard to pin down. Every so often, the site's performance will slow to an absolute crawl for some period of time, and the only solution is to restart tomcat or wait for the problem to "fix itself", which it sometimes does. My cocoon app is hosted on tomcat version 4.1.18 running on SunOS 5.8 with specs as follows: /usr/local# prtconf -v System Configuration: Sun Microsystems sun4u Memory size: 1024 Megabytes System Peripherals (Software Nodes): SUNW,Ultra-250 /var/adm# psrinfo -v Status of processor 0 as of: 10/02/03 15:08:50 Processor has been on-line since 07/11/03 11:38:48. The sparcv9 processor operates at 400 MHz, and has a sparcv9 floating point processor. Status of processor 1 as of: 10/02/03 15:08:51 Processor has been on-line since 07/11/03 11:38:49. The sparcv9 processor operates at 400 MHz, and has a sparcv9 floating point processor. So, in summary, the machine is a dual ultrasparc, with 1GB ram. The JDK version is j2sdk1.4.1_01. The last time I noticed this performance problem, the following entries were in catalina_log: 2003-10-22 12:24:28 CoyoteAdapter An exception or error occurred in the container during the request processing java.lang.OutOfMemoryError 2003-10-22 16:21:32 CoyoteAdapter An exception or error occurred in the container during the request processing java.lang.OutOfMemoryError 2003-10-22 16:23:10 CoyoteAdapter An exception or error occurred in the container during the request processing java.lang.OutOfMemoryError 2003-10-22 22:52:03 CoyoteAdapter An exception or error occurred in the container during the request processing java.lang.OutOfMemoryError During this time, I also get entries in localhost_log of the following form: 2003-10-22 16:15:50 StandardWrapperValve[5cam]: Servlet.service() for servlet 5cam threw exception javax.servlet.ServletException: Servlet execution threw an exception at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:632) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:590) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:707) at org.apache.tomcat.util.threads.ThreadPool$ControlRunn
RE: Tomcat stops handling HTTP connections, socket is SYN_RECV
Hi there, I was JDK1.3.1_09 with 4.1.27 on solaris and have seen the same issue, anyone know if this is a bug in Tomcat ? Thanks Pete -Original Message- From: Frode E. Moe [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 11:58 To: Tomcat Users List Subject: Re: Tomcat stops handling HTTP connections, socket is SYN_RECV On Mon, Oct 27, 2003 at 11:54:48 -, Peter Guyatt wrote: > Hi There, > > Can you let me know which version of Tomcat has this problem ? > > I have seen a similar problem, I thought that it could be connected to > deadlock, but it now does not appear to be the case. Yes, it's (at least) Tomcat 4.1.27 running on Sun's 1.4.2 jdk, on Linux 2.4.21. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 27 October 2003 11:50 > To: [EMAIL PROTECTED] > Subject: Re: Tomcat stops handling HTTP connections, socket is SYN_RECV > > > On Fri, Oct 24, 2003 at 16:01:48 +0200, [EMAIL PROTECTED] wrote: > > When everything quiets down, tomcat seems to be unable to service > > any http requests. Any attempt to connect to port 10003 with a web > > browser eventually causes a "No data in response"-style error message. > > At this point it seems the http connector listening on port 10003 has > > gone "zombie" on me: > > I've figured out what's going wrong. > The following exception is printed once on standard out when things > fail: > > java.lang.OutOfMemoryError: unable to create new native thread > at java.lang.Thread.start(Native Method) > at > org.apache.catalina.connector.http.HttpProcessor.threadStart(HttpProcessor.j > ava:1178) > at > org.apache.catalina.connector.http.HttpProcessor.start(HttpProcessor.java:12 > 62) > at > org.apache.catalina.connector.http.HttpConnector.newProcessor(HttpConnector. > java:937) > at > org.apache.catalina.connector.http.HttpConnector.createProcessor(HttpConnect > or.java:868) > at > org.apache.catalina.connector.http.HttpConnector.run(HttpConnector.java:1075 > ) > > I looked into the source for HttpProcessor briefly; perhaps the > "thread.start()" on line 1178 or the threadStart() call on line 1262 > could be surrounded with a try/catch(OutOfMemoryError), and throw a > LifecycleException? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat stops handling HTTP connections, socket is SYN_RECV
Hi There, Can you let me know which version of Tomcat has this problem ? I have seen a similar problem, I thought that it could be connected to deadlock, but it now does not appear to be the case. Thanks Pete -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 27 October 2003 11:50 To: [EMAIL PROTECTED] Subject: Re: Tomcat stops handling HTTP connections, socket is SYN_RECV On Fri, Oct 24, 2003 at 16:01:48 +0200, [EMAIL PROTECTED] wrote: > When everything quiets down, tomcat seems to be unable to service > any http requests. Any attempt to connect to port 10003 with a web > browser eventually causes a "No data in response"-style error message. > At this point it seems the http connector listening on port 10003 has > gone "zombie" on me: I've figured out what's going wrong. The following exception is printed once on standard out when things fail: java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start(Native Method) at org.apache.catalina.connector.http.HttpProcessor.threadStart(HttpProcessor.j ava:1178) at org.apache.catalina.connector.http.HttpProcessor.start(HttpProcessor.java:12 62) at org.apache.catalina.connector.http.HttpConnector.newProcessor(HttpConnector. java:937) at org.apache.catalina.connector.http.HttpConnector.createProcessor(HttpConnect or.java:868) at org.apache.catalina.connector.http.HttpConnector.run(HttpConnector.java:1075 ) I looked into the source for HttpProcessor briefly; perhaps the "thread.start()" on line 1178 or the threadStart() call on line 1262 could be surrounded with a try/catch(OutOfMemoryError), and throw a LifecycleException? - 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: JSP question
Hi There, Why dont you change the button back to a submit and then add a onSubmit='return validation();' to you form ? Thats what we do Eg. function valid () { if (document.form.val.value.length < 1) { alert("Please enter a value"); return false; } return true; } Thanks Pete -Original Message- From: epyonne [mailto:[EMAIL PROTECTED] Sent: 21 October 2003 16:35 To: Tomcat Users List Subject: JSP question Hello All, I am pulling my hair on this problem, and since there are many Java experts on this mailing list, I hope someone can help me on this. I have a simple servlet that calls a JSP page where the user can enter a search value. When the user clicks on the submit button, the search value will be passed back to the servlet for processing and display. All these are running on Tomcat 4.1.24. Everything works fine until I added the form validation routine in the JSP page. Initially, my input button type was "submit". I changed it to "button" and leave the submission to the form validation routine which is in JavaScript. Now, when I click on the button, I get the error message of: "Object doesn't support this property or method" at the line of code: document.form1.submit(); Does anyone know why? The following is code of the JSP page: //code begin-- blah blah blah Please enter ANI for query: ANI function validateForm(){ if(document.form1.ani.value == ""){ alert("Please enter an ANI"); return; } document.form1.submit();//This line generated error. The .submit() method is not supported. } <%@ include file="footer.jsp"%> //code end Any help will be very much appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat not shutting down correctly
Hi There, Thanks that sorted it. Thanks Pete -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: 14 October 2003 15:48 To: Tomcat Users List Subject: RE: Tomcat not shutting down correctly Howdy, Could it be that your app or a library it uses spawns non-daemon threads and doesn't shut them down properly? This is a well-known issue. What happens if you add a System.exit(0) call to the contextDestroyed method of a ServletContextListener in your webapp? ;) Finally, without looking at your attached script (attachments don't come through on this list), why aren't you using the standard tomcat one? Yoav Shapira Millennium ChemInformatics >-Original Message- >From: Peter Guyatt [mailto:[EMAIL PROTECTED] >Sent: Tuesday, October 14, 2003 10:46 AM >To: Tomcat Users List >Subject: Tomcat not shutting down correctly > >Hi There, > > I was hoping someone will be able to shed some light on a problem I >am >having with stopping tomcat. > >I use the attached shell script to start/stop tomcat, the problem is that >when I use the stop argument Tomcat just seems to hang. > >The Catalina socket is closed, however the HTTP socket is kept alive but >stops processing any requests, The only way to stop this is to use kill on >the process id. > >I would very much appreciate any light that someone could shed on this. > >Thanks > >Pete > > > This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat not shutting down correctly
Hi There, I was hoping someone will be able to shed some light on a problem I am having with stopping tomcat. I use the attached shell script to start/stop tomcat, the problem is that when I use the stop argument Tomcat just seems to hang. The Catalina socket is closed, however the HTTP socket is kept alive but stops processing any requests, The only way to stop this is to use kill on the process id. I would very much appreciate any light that someone could shed on this. Thanks Pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: auto refresh pages and session timeout
Hi There, Please find attached. Basically I used a listener add the created session to a Vector. That session is also added to the timer task, along with a timeout period. The sessionInactivityMonitor is used as a session bean, the timer task is static. basically every timer a page request was received the controllers id is passed in along with the action. Hope this helps Thanks Pete -Original Message- From: Mark W. Webb [mailto:[EMAIL PROTECTED] Sent: 07 October 2003 14:49 To: Tomcat Users List Subject: Re: auto refresh pages and session timeout I would like to see the code. Thank you. Peter Guyatt wrote: >Hi There, > > I had a similar problem and basically started an internal timer that was >only reset if the page requested was not the same as the previous page. > >I could forward you the code if required. > >Thanks > >Pete > >-Original Message- >From: David Rees [mailto:[EMAIL PROTECTED] >Sent: 06 October 2003 21:51 >To: [EMAIL PROTECTED] >Subject: Re: auto refresh pages and session timeout > > >On Mon, October 6, 2003 1at 1:12 am, Mark W. Webb sent the following > > >>Is there a way to implement "" >> >> >tag in HTML and still have the ability to timeout a session after X >number of minutes ? Would there have to be some logic in place for the >servlet that changes the session timeout for every refresh? > >Changing the JSP to not use a session might work: > ><[EMAIL PROTECTED] session="false"%> > >-Dave > > > > >- >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]
RE: Accessing objects with any servlets, where the object is already pre-created
Hi there, It will be a direct reference thanks Pete -Original Message- From: Vidar Langberget [mailto:[EMAIL PROTECTED] Sent: 08 October 2003 14:00 To: Tomcat Users List Subject: Re: Accessing objects with any servlets, where the object is already pre-created I understand that you can't put every object you want to cache in the servletcontext, and a holder/wrapper object is needed. But you still need to call servletContext.getAttribute() once for every request. The question is: Does it matter performance-wise if the objects you store in the servletContext are large or small. Ie, when you have the following code: CacheManager cm = (CacheManager)servletContext.getAttribute("cache"): FineObj fo = (FineObj)cm.getObject(key); .. Is cm object getting a reference to the cache attribute(fast), or a copy of the object stored there(slow)? Sorry for not making my question clearer. regards, Vidar - Original Message - From: "Tim Funk" <[EMAIL PROTECTED]> > The easy workaround is not store *many* objects into the servletContext but > to store a "holder object" into the servletContext. > > Rehashing is a non-issue if at initialization time all the information is > loaded into the servletContext. If not future writes are done into the > servlet context, then no rehashing is done. > > In fact, you can have one object in your servletContext which holds ALL of > your data. Then you have full control of the hashing issues and don't need to > worry about excessive calls to (CAST)servletContext.getAttribute() or worry > about static variables. > - 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: Accessing objects with any servlets, where the object is already pre-created
Hi there, I beleive that using the setAttribute adds the object to a hashtable. If when the hashtable reaches a certian limit (usually 75% of its total size) it re-hashs which can be expensive and cause performance problems. The solution is to ensure that the limit is never reached. Is there a way to set the initial limit for the context? Pete -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 07 October 2003 12:33 To: Tomcat Users List Subject: Re: Accessing objects with any servlets, where the object is already pre-created I can't see why there would be a difference. -Tim Vidar Langberget wrote: > Have you noticed any performance problems with storing large amounts of data > in the servlet context? > > I'm developing a cache for my webapp, and I can't decide if I want to use a > static class or store cache instances in the servlet context. > > > Vidar > > - Original Message - > From: "Tim Funk" <[EMAIL PROTECTED]> > > >>My preference is to store the data into the servlet context (using >>setAttribute). Then no static variables are needed. > - 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: Accessing objects with any servlets, where the object is already pre-created
Hi there, Use somthing like this public calss stringHolder { private static stringHolder instance; private Vector v; public static stringHolder Instance() { if (instance == null) { instance = new stringHolder(); } return instance; } private stringHolder() { v = new Vector(); } public addString (String s) { v.add(s); } public Vector getStrings() { return v; } } There now all you have to do is call the Instance() method to get a handle on the class. There will only ever be one instance so it can be used between multiple Servlets Hope this helps Thanks Pete -Original Message- From: zeallousbigpond.net.au [mailto:[EMAIL PROTECTED] Sent: 07 October 2003 11:43 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Accessing objects with any servlets, where the object is already pre-created Hi guys! Is it possible to create a bunch of objects, put them aside, and Servlets can just access them any time without recreating those objects or having to pass them around?? say, Vector s = a very large vector of Strings that will appear in many servlets, but now I don't want to have to create them in each servlet, I want to have them pre-created somewhere, and servlets will go grab them when they need that Vector of Strings. Thanks! Anson - 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: auto refresh pages and session timeout
Hi There, I had a similar problem and basically started an internal timer that was only reset if the page requested was not the same as the previous page. I could forward you the code if required. Thanks Pete -Original Message- From: David Rees [mailto:[EMAIL PROTECTED] Sent: 06 October 2003 21:51 To: [EMAIL PROTECTED] Subject: Re: auto refresh pages and session timeout On Mon, October 6, 2003 1at 1:12 am, Mark W. Webb sent the following > Is there a way to implement "" tag in HTML and still have the ability to timeout a session after X number of minutes ? Would there have to be some logic in place for the servlet that changes the session timeout for every refresh? Changing the JSP to not use a session might work: <[EMAIL PROTECTED] session="false"%> -Dave - 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: Instantiate a bean on startup
Hi There, If you only want to have one instance of a class for many objects then use the following class myClass { private static myClass c = null; public myClass () { //set stuff } public static myClass Instance () { if (c==null) { c = new myClass(); } return c; } } now the data member c holds a reference to itself and is returned every time you call the Instance method, it is only instantiated once. If you put this in a session listeners constructor it will be instantiated when the listener is. Now every time you call the static method Instance from any servlet or JSP page you will be working with that version of the class only. Hope this helps Thanks Pete -Original Message- From: Nikola Milutinovic [mailto:[EMAIL PROTECTED] Sent: 07 October 2003 06:22 To: Tomcat Users List Subject: Re: Instantiate a bean on startup > Hello all. Is there an easy way to instantiate a bean > as soon as tomcat starts? Basically, I want a bean to > be instantiated and available to all sessions as soon > tomcat starts. Any ideas? There is no such thing as "Tomcat scope" for variables, so you're hosed. Not just with Tomcat... Why would you want to do something like that? There is no way to specify what is to be done on Tomcat's startup (there is for a particular application). And even if you hack it somehow, how will any Servlet access that object? Nix. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat on Netware
Hi There, Sorry I don't, you may have to raise a bug report for this problem. I am positive that it will be an easy fix so it should be solved relatively quickly. Hope this is ok Thanks Pete -Original Message- From: Aziz Yacoub [mailto:[EMAIL PROTECTED] Sent: 30 September 2003 15:08 To: [EMAIL PROTECTED] Subject: RE: Tomcat on Netware Thanks... do you know why tomcat would be doing this on startup?? >>> "Peter Guyatt" <[EMAIL PROTECTED]> 30/09/2003 11:04:36 pm >>> Yeah, The fact that you need to have the call to the method synchronized its the same as using the wait() method implemented in the Object class you need to own the lock before you can call this method eg. some method { synchronized (this) { //this is ok wait(); } } where as some method { wait(); } would throw an IllegalMonitorStateException. Hope this helps Pete -Original Message- From: Aziz Yacoub [ mailto:[EMAIL PROTECTED] Sent: 30 September 2003 13:51 To: > Subject: Tomcat on Netware I've been successfully running Tomcat 4.0.4 on Novell Netware with the Novell (ie Netscape) Enterprise Server (using nsapi_rd.nlm) for many months, and now I want to upgrade to Tomcat 4.1.27. I installed and configured 4.1.27 just like 4.0.4 (ajp13, workers etc), and now it's giving the following error when I try to start it: Bootstrap: Class loader creation threw exception java.lang.IllegalMonitorStateException: current thread not owner The log file shows: [Tue Sep 30 22:27:31 2003] [jk_worker.c (88)]: Into wc_open [Tue Sep 30 22:27:31 2003] [jk_worker.c (222)]: Into build_worker_map, creating 1 workers [Tue Sep 30 22:27:31 2003] [jk_worker.c (228)]: build_worker_map, creating worker worker1 [Tue Sep 30 22:27:31 2003] [jk_worker.c (148)]: Into wc_create_worker [Tue Sep 30 22:27:31 2003] [jk_worker.c (162)]: wc_create_worker, about to create instance worker1 of ajp13 [Tue Sep 30 22:27:31 2003] [jk_ajp13_worker.c (108)]: Into ajp13_worker_factory [Tue Sep 30 22:27:31 2003] [jk_worker.c (171)]: wc_create_worker, about to validate and init worker1 [Tue Sep 30 22:27:31 2003] [jk_ajp_common.c (1219)]: Into jk_worker_t::validate [Tue Sep 30 22:27:31 2003] [jk_ajp_common.c (1239)]: In jk_worker_t::validate for worker worker1 contact is localhost:8009 [Tue Sep 30 22:27:31 2003] [jk_ajp_common.c (1267)]: Into jk_worker_t::init [Tue Sep 30 22:27:31 2003] [jk_ajp_common.c (1287)]: In jk_worker_t::init, setting socket timeout to 0 [Tue Sep 30 22:27:31 2003] [jk_worker.c (187)]: wc_create_worker, done [Tue Sep 30 22:27:31 2003] [jk_worker.c (238)]: build_worker_map, removing old worker1 worker [Tue Sep 30 22:27:31 2003] [jk_worker.c (250)]: build_worker_map, done [Tue Sep 30 22:27:31 2003] [jk_worker.c (111)]: wc_open, done 1 [Tue Sep 30 22:28:28 2003] [jk_nsapi_plugin.c (298)]: jk_init, a second passed [Tue Sep 30 22:29:22 2003] [jk_worker.c (118)]: Into wc_close [Tue Sep 30 22:29:22 2003] [jk_worker.c (199)]: close_workers got 1 workers to destroy [Tue Sep 30 22:29:22 2003] [jk_worker.c (206)]: close_workers will destroy worker worker1 [Tue Sep 30 22:29:22 2003] [jk_ajp_common.c (1324)]: Into jk_worker_t::destroy [Tue Sep 30 22:29:22 2003] [jk_ajp_common.c (1331)]: Into jk_worker_t::destroy up to 1 endpoint to close [Tue Sep 30 22:29:22 2003] [jk_worker.c (120)]: wc_close, done The server setup is Netware 5.1 sp6, JVM 1.1.3.8, NES 5.1. Does anyone know what would cause an IllegalMonitorStateException ??? TIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat on Netware
Yeah, The fact that you need to have the call to the method synchronized its the same as using the wait() method implemented in the Object class you need to own the lock before you can call this method eg. some method { synchronized (this) { //this is ok wait(); } } where as some method { wait(); } would throw an IllegalMonitorStateException. Hope this helps Pete -Original Message- From: Aziz Yacoub [mailto:[EMAIL PROTECTED] Sent: 30 September 2003 13:51 To: > Subject: Tomcat on Netware I've been successfully running Tomcat 4.0.4 on Novell Netware with the Novell (ie Netscape) Enterprise Server (using nsapi_rd.nlm) for many months, and now I want to upgrade to Tomcat 4.1.27. I installed and configured 4.1.27 just like 4.0.4 (ajp13, workers etc), and now it's giving the following error when I try to start it: Bootstrap: Class loader creation threw exception java.lang.IllegalMonitorStateException: current thread not owner The log file shows: [Tue Sep 30 22:27:31 2003] [jk_worker.c (88)]: Into wc_open [Tue Sep 30 22:27:31 2003] [jk_worker.c (222)]: Into build_worker_map, creating 1 workers [Tue Sep 30 22:27:31 2003] [jk_worker.c (228)]: build_worker_map, creating worker worker1 [Tue Sep 30 22:27:31 2003] [jk_worker.c (148)]: Into wc_create_worker [Tue Sep 30 22:27:31 2003] [jk_worker.c (162)]: wc_create_worker, about to create instance worker1 of ajp13 [Tue Sep 30 22:27:31 2003] [jk_ajp13_worker.c (108)]: Into ajp13_worker_factory [Tue Sep 30 22:27:31 2003] [jk_worker.c (171)]: wc_create_worker, about to validate and init worker1 [Tue Sep 30 22:27:31 2003] [jk_ajp_common.c (1219)]: Into jk_worker_t::validate [Tue Sep 30 22:27:31 2003] [jk_ajp_common.c (1239)]: In jk_worker_t::validate for worker worker1 contact is localhost:8009 [Tue Sep 30 22:27:31 2003] [jk_ajp_common.c (1267)]: Into jk_worker_t::init [Tue Sep 30 22:27:31 2003] [jk_ajp_common.c (1287)]: In jk_worker_t::init, setting socket timeout to 0 [Tue Sep 30 22:27:31 2003] [jk_worker.c (187)]: wc_create_worker, done [Tue Sep 30 22:27:31 2003] [jk_worker.c (238)]: build_worker_map, removing old worker1 worker [Tue Sep 30 22:27:31 2003] [jk_worker.c (250)]: build_worker_map, done [Tue Sep 30 22:27:31 2003] [jk_worker.c (111)]: wc_open, done 1 [Tue Sep 30 22:28:28 2003] [jk_nsapi_plugin.c (298)]: jk_init, a second passed [Tue Sep 30 22:29:22 2003] [jk_worker.c (118)]: Into wc_close [Tue Sep 30 22:29:22 2003] [jk_worker.c (199)]: close_workers got 1 workers to destroy [Tue Sep 30 22:29:22 2003] [jk_worker.c (206)]: close_workers will destroy worker worker1 [Tue Sep 30 22:29:22 2003] [jk_ajp_common.c (1324)]: Into jk_worker_t::destroy [Tue Sep 30 22:29:22 2003] [jk_ajp_common.c (1331)]: Into jk_worker_t::destroy up to 1 endpoint to close [Tue Sep 30 22:29:22 2003] [jk_worker.c (120)]: wc_close, done The server setup is Netware 5.1 sp6, JVM 1.1.3.8, NES 5.1. Does anyone know what would cause an IllegalMonitorStateException ??? TIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Desperation! Tomcat crashing inexplicably. :-& Fresh ideas needed.
We did on our last project. But it was the JVM crashing and taking Tomcat down with it. We just moved to a newer version just to make sure. Try and upgrade the JVM, what version are you using ? -Original Message- From: Andoni [mailto:[EMAIL PROTECTED] Sent: 18 September 2003 16:12 To: Tomcat Users List Subject: Re: Desperation! Tomcat crashing inexplicably. :-& Fresh ideas needed. That's the problem. I can't be more specific. One moment I was clicking through the site and the next I get an Apache error saying it could not find the file. Then when I looked at the server processes Tomcat was down. Unfortunately the log file is locked so I cannot see it until I bring the machine down again at about 6pm but I doubt it will say very much either. Do you use DBCP with Tomcat 4.0.x ? Andoni. - Original Message - From: "Phillip Qin" <[EMAIL PROTECTED]> To: "'Tomcat Users List'" <[EMAIL PROTECTED]> Sent: Thursday, September 18, 2003 3:48 PM Subject: RE: Desperation! Tomcat crashing inexplicably. :-& Fresh ideas needed. > Be more specific. Describe "crash". > > -Original Message- > From: Andoni [mailto:[EMAIL PROTECTED] > Sent: September 18, 2003 10:55 AM > To: Tomcat Users List > Subject: Desperation! Tomcat crashing inexplicably. :-& Fresh ideas needed. > > Hello, > > I am trying to put live a new version of my web site. The biggest change in > this version is that it uses DBCP connection pooling. > > The problem I am having is that after a while of being live Tomcat just > crashes with no warning. > > What are the groups experiences with Tomcat crashing? What kinds of things > make it crash? I am at a loss having tried every thing I can imagine to > make it work. I would be eternally grateful for any new leads. > > My thanks, > Andoni. > > Tomcat 4.0.4 (crashes) > Apache 1.3.26 (keeps going) > DBCP > Ajp13 > Oracle 9i (keeps going) > - 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: Desperation! Tomcat crashing inexplicably. :-& Fresh ideas needed.
Hi, Have you tried moving to a new version of Tomcat? We had problems with earlier versions crashing, We also moved from JDK1.2 to 1.3.1_07 Thanks Pete -Original Message- From: Andoni [mailto:[EMAIL PROTECTED] Sent: 18 September 2003 15:55 To: Tomcat Users List Subject: Desperation! Tomcat crashing inexplicably. :-& Fresh ideas needed. Hello, I am trying to put live a new version of my web site. The biggest change in this version is that it uses DBCP connection pooling. The problem I am having is that after a while of being live Tomcat just crashes with no warning. What are the groups experiences with Tomcat crashing? What kinds of things make it crash? I am at a loss having tried every thing I can imagine to make it work. I would be eternally grateful for any new leads. My thanks, Andoni. Tomcat 4.0.4 (crashes) Apache 1.3.26 (keeps going) DBCP Ajp13 Oracle 9i (keeps going) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Obtaining client connection
Hi There, I am not too sure if you are actually able to do this but I have a need to get the IP address/hostname of the client that has accessed a page in our web application. This is mainly for security/auditing purposes, however I really need to get the client Socket connection and not the ip address given in the attributes of the HTTP header. Is there any way of obtaining a handle on the client socket that has connected to the server. Any help on this matter would be greatly appreciated. Currently we are using Tomcat version 4.1.18 Many Thanks Pete Guyatt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]