Re: how to caculate the PV,ip,PU according to the tomcat log
TO *Christopher Schultz*: 2011/2/23 Christopher Schultz ch...@christopherschultz.net -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 2/18/2011 7:38 PM, maven apache wrote: how to caculate the PV,ip,PU according to the tomcat log? Good question. What are PV, ip, and PU? Thanks for your attention and Sorry for my negligence. PV: page view, how many people visit a page. IP: how many ips visitor the website within one day or one hour... PU:Unique Visitor, For example: visitor A(ip:10.0.0.1) scan the site :http://www.xx.com/index.html http://www.xx.com/about.html Visitor B (ip:10.0.0.2) scan the same two pages Then VIsitor A change his/her ip to 10.0.0.3 (but its cookie in her/his browser is not change) and visitor the two pages again. Then from all of the above,the ips=3 (three distinct ips) pv=2 (two pages) PU=2 (just two different person,although three ip. Is this clear? If not,I can add more. :) For the ip I can use : select count(distinct ip)... Okay, that explains /one/ question. What about the others? But how about the pv and pu? I have no idea, please do me a favor if you know. If you can tell us what those abbreviations mean, perhaps we can write your SQL statements for you. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1kEkUACgkQ9CaO5/Lv0PDPQwCeMGyWknG04hZ1v2xrH9B5WuHT JBQAnjoe1/b0f3/hcSZOKfd0BuOI9WvE =1KL4 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
how to caculate the PV,ip,PU according to the tomcat log
Hi: how to caculate the PV,ip,PU according to the tomcat log? I have export the tomcat log to db. This is the db structure: +---+---+--+--++-+--+--++-+-+--+---+ | Id| hostip| username | datasend | method | uri | queryStr | protocol | status | time| browser | platform | refer | +---+---+--+--++-+--+--++-+-+--+---+ | 44359 | 127.0.0.1 | -|0 | GET| / | | HTTP/1.1 |404 | 2011-02-17 08:08:25 | Unknown | Unknown | - | +---+---+--+--++-+--+--++-+-+--+---+ For the ip I can use : select count(distinct ip)... But how about the pv and pu? I have no idea,please do me a favor if you know.
Re: how does the tomcat log generated? log4j?
Thanks,I will have a try. 2010/12/25 Konstantin Kolinko knst.koli...@gmail.com 2010/12/25 maven apache apachemav...@gmail.com: Perhaps I’m not making myself clear,in fact I want to do some processing work to the the logs created by the access log valve http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve to database. You can use JDBCAccessLogValve http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/valves/JDBCAccessLogValve.html Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: how does the tomcat log generated? log4j?
2010/12/25 André Warnier a...@ice-sa.com The logging page which I pointed you to, does not say that Tomcat uses log4j. It says that you /can/ configure Tomcat to use log4j, instead of the default juli logging. It even provides instructions to do so. The AccessLogValve documentation page does not say either that it uses log4j. But what it does say at the very beginning, is that the output file is changed every day at midnight. So if you only read the files up to last night at midnight, you will never encounter the problem that something is still writing to it. Also, I do not know what your ultimate purpose is, but there exist already several open-source programs which read a logfile in the format produced by the Tomcat AccessLogValve, parse it, and produce nice graphical statistics out of it (like webalizer or awstats). Maybe you are re-inventing something which already exists ? Unfortunately yes,our boss want our own analyzer system based on java. :( Web access statistics are not usually something which needs to be accurate in real-time. Having Tomcat writing them directly to a database may have a noticeable impact on your applications performance. That's why this is something usually done off-line. In fact,I just analyzer the logs before yesterday,it is also my boss who require the real-time(almost) analysis .:) Thank you anyway,although having Tomcat writing logs directly to a database may cause performance problem,it is another way. My boss will decide it :) maven apache wrote: Perhaps I’m not making myself clear,in fact I want to do some processing work to the the logs created by the access log valve http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve to database. For example:the log: 10.33.2.45 - - [08/Dec/2010:08:44:43 +0800] GET /poi.txt HTTP/1.1 200 672 - Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 will be saved in the db in this format: ip timemethod uri statusbytes browser platform 10.33.2.45 2010-10-08 08:44:43 GET/poi.txt200672 Firefox/3.6.8winxp And now I meet some problems when I read the log file like: localhost_access_log.2010-12-20.txt I read the file line by line,but sometime I can not get a complete line since this file may be written in. So,someone suggest me add a db appender(log4j),which will do the procesing work and then export the log to db. --- Now,from the link you give me ,it seems that tomcat does use log4j to create its access log. 2010/12/25 André Warnier a...@ice-sa.com Hi. It is not very clear what you are asking, specially since you do not specify which version of Tomcat your are using, under which Java version and on which platform. Assuming you are using Tomcat 6.0.x, the on-line documentation for logging is here : http://tomcat.apache.org/tomcat-6.0-doc/logging.html Maybe read it first, and then come back if you have a specific question ? (But then try to specify the question clearly) maven apache wrote: Hi: I wonder how is the tomcat log generated,I mean the log like this; localhost_access_log.2010-12-20.txt I want to export the logs to db. Some one suggestion I directly add one Appender http://logging.apache.org/log4j/1.2/apidocs/index.html if tomcat also uses log4j to generate the logs and I have access to the tomcat's log4j config file. More details can be found in this post: http://stackoverflow.com/questions/4486620/randomaccessfile-probelm So I wonder if this is possible? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: how does the tomcat log generated? log4j?
2010/12/26 Pid p...@pidster.com On 25/12/2010 04:37, maven apache wrote: Hi: I wonder how is the tomcat log generated,I mean the log like this; localhost_access_log.2010-12-20.txt I want to export the logs to db. Some one suggestion I directly add one Appender http://logging.apache.org/log4j/1.2/apidocs/index.html if tomcat also uses log4j to generate the logs and I have access to the tomcat's log4j config file. More details can be found in this post: http://stackoverflow.com/questions/4486620/randomaccessfile-probelm So I wonder if this is possible? Dear Mr Maven Apache. Is that really your name? Of course not. Just a web nickname. Since I like mavenhttp://maven.apache.org/,it is the best build tool I have ever used. p
Re: how does the tomcat log generated? log4j?
2010/12/26 André Warnier a...@ice-sa.com maven apache wrote: 2010/12/25 André Warnier a...@ice-sa.com The logging page which I pointed you to, does not say that Tomcat uses log4j. It says that you /can/ configure Tomcat to use log4j, instead of the default juli logging. It even provides instructions to do so. The AccessLogValve documentation page does not say either that it uses log4j. But what it does say at the very beginning, is that the output file is changed every day at midnight. So if you only read the files up to last night at midnight, you will never encounter the problem that something is still writing to it. Also, I do not know what your ultimate purpose is, but there exist already several open-source programs which read a logfile in the format produced by the Tomcat AccessLogValve, parse it, and produce nice graphical statistics out of it (like webalizer or awstats). Maybe you are re-inventing something which already exists ? Unfortunately yes,our boss want our own analyzer system based on java. :( Oh well, if the boss says so. But then I would /still/ recommend writing something in java which reads the above logfiles and feeds the database. Seems a bit more reliable and more scaleable to me. Thanks for your kind. I prefer to this manner also. And it is why I ask problems in the stackover. :) Of course,it is a java io question,not related to tomcat. :) What if the database is not available at some point for whatever reason ? You stop tomcat, or you lose the information ? In any case, you should look at the current access log files, and count the number of lines which it writes per second|minute|hour, and ask yourself if you want this number of transactions going into your database system in real-time. Thanks for all your guys. Web access statistics are not usually something which needs to be accurate in real-time. Having Tomcat writing them directly to a database may have a noticeable impact on your applications performance. That's why this is something usually done off-line. In fact,I just analyzer the logs before yesterday,it is also my boss who require the real-time(almost) analysis .:) Thank you anyway,although having Tomcat writing logs directly to a database may cause performance problem,it is another way. My boss will decide it :) maven apache wrote: Perhaps I’m not making myself clear,in fact I want to do some processing work to the the logs created by the access log valve http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve to database. For example:the log: 10.33.2.45 - - [08/Dec/2010:08:44:43 +0800] GET /poi.txt HTTP/1.1 200 672 - Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 will be saved in the db in this format: ip timemethod uri statusbytes browser platform 10.33.2.45 2010-10-08 08:44:43 GET/poi.txt200672 Firefox/3.6.8winxp And now I meet some problems when I read the log file like: localhost_access_log.2010-12-20.txt I read the file line by line,but sometime I can not get a complete line since this file may be written in. So,someone suggest me add a db appender(log4j),which will do the procesing work and then export the log to db. --- Now,from the link you give me ,it seems that tomcat does use log4j to create its access log. 2010/12/25 André Warnier a...@ice-sa.com Hi. It is not very clear what you are asking, specially since you do not specify which version of Tomcat your are using, under which Java version and on which platform. Assuming you are using Tomcat 6.0.x, the on-line documentation for logging is here : http://tomcat.apache.org/tomcat-6.0-doc/logging.html Maybe read it first, and then come back if you have a specific question ? (But then try to specify the question clearly) maven apache wrote: Hi: I wonder how is the tomcat log generated,I mean the log like this; localhost_access_log.2010-12-20.txt I want to export the logs to db. Some one suggestion I directly add one Appender http://logging.apache.org/log4j/1.2/apidocs/index.html if tomcat also uses log4j to generate the logs and I have access to the tomcat's log4j config file. More details can be found in this post: http://stackoverflow.com/questions/4486620/randomaccessfile-probelm So I wonder if this is possible? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr
Re: how does the tomcat log generated? log4j?
Perhaps I’m not making myself clear,in fact I want to do some processing work to the the logs created by the access log valvehttp://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valveto database. For example:the log: 10.33.2.45 - - [08/Dec/2010:08:44:43 +0800] GET /poi.txt HTTP/1.1 200 672 - Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 will be saved in the db in this format: ip timemethod uri statusbytes browser platform 10.33.2.45 2010-10-08 08:44:43 GET/poi.txt200672 Firefox/3.6.8winxp And now I meet some problems when I read the log file like: localhost_access_log.2010-12-20.txt I read the file line by line,but sometime I can not get a complete line since this file may be written in. So,someone suggest me add a db appender(log4j),which will do the procesing work and then export the log to db. --- Now,from the link you give me ,it seems that tomcat does use log4j to create its access log. 2010/12/25 André Warnier a...@ice-sa.com Hi. It is not very clear what you are asking, specially since you do not specify which version of Tomcat your are using, under which Java version and on which platform. Assuming you are using Tomcat 6.0.x, the on-line documentation for logging is here : http://tomcat.apache.org/tomcat-6.0-doc/logging.html Maybe read it first, and then come back if you have a specific question ? (But then try to specify the question clearly) maven apache wrote: Hi: I wonder how is the tomcat log generated,I mean the log like this; localhost_access_log.2010-12-20.txt I want to export the logs to db. Some one suggestion I directly add one Appender http://logging.apache.org/log4j/1.2/apidocs/index.html if tomcat also uses log4j to generate the logs and I have access to the tomcat's log4j config file. More details can be found in this post: http://stackoverflow.com/questions/4486620/randomaccessfile-probelm So I wonder if this is possible? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
how does the tomcat log generated? log4j?
Hi: I wonder how is the tomcat log generated,I mean the log like this; localhost_access_log.2010-12-20.txt I want to export the logs to db. Some one suggestion I directly add one Appender http://logging.apache.org/log4j/1.2/apidocs/index.html if tomcat also uses log4j to generate the logs and I have access to the tomcat's log4j config file. More details can be found in this post: http://stackoverflow.com/questions/4486620/randomaccessfile-probelm So I wonder if this is possible?
tomcat log format disable the ipv6 format
Here are three log exmaples: 127.0.0.1 - - [17/Sep/2010:14:03:07 +0800] GET /docs/logging.html HTTP/1.1 200 24040 http://localhost:8000/docs/manager-howto.html; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727) 0:0:0:0:0:0:0:1 - - [26/Oct/2010:09:53:30 +0800] GET /docs/images/tomcat.gif HTTP/1.1 200 1934 http://localhost:8000/docs/; Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 0:0:0:0:0:0:0:1 - - [26/Oct/2010:09:53:30 +0800] GET /docs/images/asf-logo.gif HTTP/1.1 200 7279 http://localhost:8000/docs/; Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 The first is correct,however the ip of the second and the third is ipv6 format, how to avoid this?
Re: tomcat log format disable the ipv6 format
2010/10/29 Mark Thomas ma...@apache.org On 29/10/2010 12:24, maven apache wrote: Here are three log exmaples: 127.0.0.1 - - [17/Sep/2010:14:03:07 +0800] GET /docs/logging.html HTTP/1.1 200 24040 http://localhost:8000/docs/manager-howto.html; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727) 0:0:0:0:0:0:0:1 - - [26/Oct/2010:09:53:30 +0800] GET /docs/images/tomcat.gif HTTP/1.1 200 1934 http://localhost:8000/docs/; Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 0:0:0:0:0:0:0:1 - - [26/Oct/2010:09:53:30 +0800] GET /docs/images/asf-logo.gif HTTP/1.1 200 7279 http://localhost:8000/docs/; Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 The first is correct,however the ip of the second and the third is ipv6 format, how to avoid this? Don't connect to Tomcat using IPv6. I did not intend to. But I am using win7 now,so I do not know how to disable the ipv6,also I *can not* control the user. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat log format disable the ipv6 format
http://osdir.com/ml/users-tomcat.apache.org/2010-05/msg00315.html From this thread, I want to set the connect address format to :0:0:0:0 however I can not find this attribute at: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html 2010/10/29 Mark Thomas ma...@apache.org On 29/10/2010 13:06, maven apache wrote: But I am using win7 now,so I do not know how to disable the ipv6, That would be a question for a Windows support forum if you want to disable it globally. To control which address Tomcat listens on, read the docs or search the archives. Mark also I *can not* control the user. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
can not start tomcat and the jre_home var error
Hi: I am using Ubuntu9.10. I have install jdk1.6 in /home/kk/ProgramFiles/jdk1.6 , also I have set up a permanent environment variable JAVA_HOME which link to the jdk directory. I just downloaded apache-tomcat-6.0.24.tar.gz and extact it to /home/kk/ProgramFiles/apache-tomcat-6.0.24, since the JAVA_HOME env var existed, so I run the startup.sh directly,however I can not enter the http://localhost:8080; and I got the following message: Using CATALINA_BASE: /home/kk/ProgramFiles/apache-tomcat-6.0.24 Using CATALINA_HOME: /home/kk/ProgramFiles/apache-tomcat-6.0.24 Using CATALINA_TMPDIR: /home/kk/ProgramFiles/apache-tomcat-6.0.24/temp Using JRE_HOME:/usr Using CLASSPATH: /home/kk/ProgramFiles/apache-tomcat-6.0.24/bin/bootstrap.jar It seems that tomcat did not identify the JAVA_HOME var, so how to do next in my case?
Re: can not start tomcat and the jre_home var error
2010/3/4 David Smith d...@cornell.edu On 3/4/2010 8:00 AM, maven apache wrote: Hi: I am using Ubuntu9.10. I have install jdk1.6 in /home/kk/ProgramFiles/jdk1.6 , also I have set up a permanent environment variable JAVA_HOME which link to the jdk directory. I just downloaded apache-tomcat-6.0.24.tar.gz and extact it to /home/kk/ProgramFiles/apache-tomcat-6.0.24, since the JAVA_HOME env var existed, so I run the startup.sh directly,however I can not enter the http://localhost:8080; and I got the following message: Using CATALINA_BASE: /home/kk/ProgramFiles/apache-tomcat-6.0.24 Using CATALINA_HOME: /home/kk/ProgramFiles/apache-tomcat-6.0.24 Using CATALINA_TMPDIR: /home/kk/ProgramFiles/apache-tomcat-6.0.24/temp Using JRE_HOME:/usr Using CLASSPATH: /home/kk/ProgramFiles/apache-tomcat-6.0.24/bin/bootstrap.jar It seems that tomcat did not identify the JAVA_HOME var, so how to do next in my case? How exactly are you starting tomcat? It's important to understand where tomcat is getting it's environment from. The tomcat directory is /home/kk/ProgramFiles/apache-tomcat-6.0.24' In the terminal , I enter this the bin directory and run sudo ./startup.sh --David - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: can not start tomcat and the jre_home var error
2010/3/4 Markus Schönhaber tomcat-us...@list-post.mks-mail.de 04.03.2010 14:44, maven apache: The tomcat directory is /home/kk/ProgramFiles/apache-tomcat-6.0.24' In the terminal , I enter this the bin directory and run sudo ./startup.sh Why do you start Tomcat as root? Ok, I tried it again. -- Regards mks - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: can not start tomcat and the jre_home var error
2010/3/4 Caldarale, Charles R chuck.caldar...@unisys.com From: maven apache [mailto:apachemav...@gmail.com] Subject: Re: can not start tomcat and the jre_home var error In the terminal , I enter this the bin directory and run sudo ./startup.sh Try it without the sudo. You should never run Tomcat as root. Thanks, it works. But I wonder why? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: can not start tomcat and the jre_home var error
2010/3/4 Markus Schönhaber tomcat-us...@list-post.mks-mail.de 04.03.2010 15:01, maven apache: 2010/3/4 Caldarale, Charles R chuck.caldar...@unisys.com From: maven apache [mailto:apachemav...@gmail.com] Subject: Re: can not start tomcat and the jre_home var error In the terminal , I enter this the bin directory and run sudo ./startup.sh Try it without the sudo. You should never run Tomcat as root. Thanks, it works. But I wonder why? Because, by default, sudo resets the environment. Oh, thanks I got it. Now I found there is something wrong with the apr component because I got the info: INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /home/kk/ProgramFiles/jdk1.6.0_17/jre/lib/i386/client:/home/kk/ProgramFiles/jdk1.6.0_17/jre/lib/i386:/home/kk/ProgramFiles/jdk1.6.0_17/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib And the whole logs can be found here:http://dpaste.com/167789/ Does it matter? -- Regards mks - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: can not start tomcat and the jre_home var error
I have config the manager by adding user username=admin password=000 roles=role1/ Then I found that I can not enter the manager page by a 403 error. I restart the tomcat many times, and I am sure I enter the correct username and password. However I always got the 403 error page.
Re: can not start tomcat and the jre_home var error
2010/3/4 Caldarale, Charles R chuck.caldar...@unisys.com From: maven apache [mailto:apachemav...@gmail.com] Subject: Re: can not start tomcat and the jre_home var error I have config the manager by adding user username=admin password=000 roles=role1/ Did you remove the XML comment markers from around the list? Yes , I did . This is the file: tomcat-user.xml--- !-- role rolename=tomcat/ role rolename=role1/ user username=tomcat password=tomcat roles=tomcat/ user username=both password=tomcat roles=tomcat,role1/ user username=role1 password=tomcat roles=role1/ -- user username=admin password=000 roles=role1/ /tomcat-users --- BTW, is there a way to start tomcat with a terminal window which can show logs just like that of in the windows platform? For example, this is the window in win-platform:http://imagebin.org/87583 However in the LInux,after run the startup.sh,http://imagebin.org/87585 it just show some evn vars, it did not give some start information and etc... I would like it work as shown in the win-platform. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: can not start tomcat and the jre_home var error
Ok, it works, thanks for all of you . :) 2010/3/5 Caldarale, Charles R chuck.caldar...@unisys.com From: maven apache [mailto:apachemav...@gmail.com] Subject: Re: can not start tomcat and the jre_home var error Did you remove the XML comment markers from around the list? Yes , I did . Clearly, you did not remove them. This is the file: tomcat-user.xml--- !-- What does the above look like? role rolename=tomcat/ role rolename=role1/ user username=tomcat password=tomcat roles=tomcat/ user username=both password=tomcat roles=tomcat,role1/ user username=role1 password=tomcat roles=role1/ -- ^^^ ||| And that? user username=admin password=000 roles=role1/ /tomcat-users BTW, is there a way to start tomcat with a terminal window which can show logs just like that of in the windows platform? Use the catalina.sh script. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Feature request: startup.bat: -title option needed
2009/12/30 LiuYan 刘研 lovet...@21cn.com When running muitiple tomcat instances in same windows OS, the title of all tomcat/DOS window are all Tomcat, it's a little hard to distinguish which window is which tomcat. Not exactly sure what you are meaning. Did you mean that you have installed more than one tomcat or you just installed one tomcat but you want to start more than one tomcat instances? for example: bin\startup.bat -title Tomcat Server 1 - XXX bin\startup.bat -title Tomcat Server 2 - YYY bin\startup.bat -title Tomcat Server 3 - ZZZ ... Then I can distinguish these servers from the title of tomcat/DOS window in task bar. Thanks! -- View this message in context: http://old.nabble.com/Feature-request%3A-startup.bat%3A--title-option-needed-tp26963401p26963401.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Feature request: startup.bat: -title option needed
2009/12/30 LiuYan 刘研 lovet...@21cn.com Hi maven: Thanks for your response. How to run multiple tomcat instances is not what I concerned. I setup three Tomcat 5.0.x instances one Tomcat 6.0.x in one windows OS in our production environment for some weired reasons. And I can running multiple tomcat instances from one tomcat installation copy by tweaking CATALINA_BASE environment variable before startup.bat (learning tomcat clustering these days). I just want to distinguish these tomcat servers from title of tomcat window. Currently I modified catalina.bat, changed set _EXECJAVA=start Tomcat %_RUNJAVA% to set _EXECJAVA=start %TOMCAT_TITLE% %_RUNJAVA% Why not set the title directly by using [set _EXECJAVA=start Tomcat Server1 %_RUNJAVA%] ? and execute set TOMCAT_TITLE=Server1/Server2/Server3/... before running startup.bat, it's a trick, but it is not an official solution, and it's not suitable for creating a windows shortcut (pass TITLE via command line option) maven apache wrote: 2009/12/30 LiuYan 刘研 lovet...@21cn.com When running muitiple tomcat instances in same windows OS, the title of all tomcat/DOS window are all Tomcat, it's a little hard to distinguish which window is which tomcat. Not exactly sure what you are meaning. Did you mean that you have installed more than one tomcat or you just installed one tomcat but you want to start more than one tomcat instances? for example: bin\startup.bat -title Tomcat Server 1 - XXX bin\startup.bat -title Tomcat Server 2 - YYY bin\startup.bat -title Tomcat Server 3 - ZZZ ... Then I can distinguish these servers from the title of tomcat/DOS window in task bar. Thanks! -- View this message in context: http://old.nabble.com/Feature-request%3A-startup.bat%3A--title-option-needed-tp26963401p26963401.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/Feature-request%3A-startup.bat%3A--title-option-needed-tp26963401p26963650.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Feature request: startup.bat: -title option needed
2009/12/30 LiuYan 刘研 lovet...@21cn.com Hi maven: Thanks for your response. How to run multiple tomcat instances is not what I concerned. I setup three Tomcat 5.0.x instances one Tomcat 6.0.x in one windows OS in our production environment for some weired reasons. And I can running multiple tomcat instances from one tomcat installation copy by tweaking CATALINA_BASE environment variable before startup.bat (learning tomcat clustering these days). I just want to distinguish these tomcat servers from title of tomcat window. Currently I modified catalina.bat, changed set _EXECJAVA=start Tomcat %_RUNJAVA% to set _EXECJAVA=start %TOMCAT_TITLE% %_RUNJAVA% Why not set the title directly by [set _EXECJAVA=start Tomcat Server1 %_RUNJAVA%]? and execute set TOMCAT_TITLE=Server1/Server2/Server3/... before running startup.bat, it's a trick, but it is not an official solution, and it's not suitable for creating a windows shortcut (pass TITLE via command line option) maven apache wrote: 2009/12/30 LiuYan 刘研 lovet...@21cn.com When running muitiple tomcat instances in same windows OS, the title of all tomcat/DOS window are all Tomcat, it's a little hard to distinguish which window is which tomcat. Not exactly sure what you are meaning. Did you mean that you have installed more than one tomcat or you just installed one tomcat but you want to start more than one tomcat instances? for example: bin\startup.bat -title Tomcat Server 1 - XXX bin\startup.bat -title Tomcat Server 2 - YYY bin\startup.bat -title Tomcat Server 3 - ZZZ ... Then I can distinguish these servers from the title of tomcat/DOS window in task bar. Thanks! -- View this message in context: http://old.nabble.com/Feature-request%3A-startup.bat%3A--title-option-needed-tp26963401p26963401.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- View this message in context: http://old.nabble.com/Feature-request%3A-startup.bat%3A--title-option-needed-tp26963401p26963650.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: remote debug
2009/11/13 Pid p...@pidster.com On 13/11/2009 02:33, maven apache wrote: 2009/11/12 Christopher Schultzch...@christopherschultz.net -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 11/11/2009 8:33 PM, maven apache wrote: Thanks for your attention. Actually I did not modify the catalina.bat directly , I create a new bat named debug.bat in the same directory, the content of the debug.bat is : --- cd %CATALINE_HOME%/bin This is not spelled correctly. It should be CATALINA_HOME, not CATALINE_HOME. set JPDA_ADDRESS=1044 set JPDA_TRANSPORT=dt_socket This is the default JPDA_TRANSPORT when using Tomcat's startup scripts. set CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044 startup --- Then I start the tomcat with the debug.bat. It's tough to tell where the lines end due to word wrapping, but it looks like this script doesn't do anything but set environment variables. Is the startup word actually on a separate line from the set CATALINA_OPTS line? I'll assume so, otherwise nothing would happen. Note that you could have put these settings into bin/setenv.sh and it would be called before calling catalina.bat. Finally, Tomcat allows you to specify the JPDA_* environment variables so that you don't then have to re-specify everything in CATALINA_OPTS. Try deleting your debug.bat file and instead put this into your CATALINA_BASE/bin/setenv.bat file: set JPDA_ADDRESS=1044 set CATALINA_OPTS=-server -Xnoagent -Djava.compiler=none Note that catalina.bat will auto-build the following command-line arguments when starting up the JVM, given my above settings: - -Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n Now, you have to start Tomcat like this: %CATALINA_BASE%\bin\catalina.bat jpda start This should start Tomcat using all the JPDA options. If you don't use jpda start, then all the JPDA_* environment variables are useless. I can see why you ended up specifying everything in CATALINA_OPTS: because Tomcat was otherwise ignoring all your settings. After you get Tomcat started, you'll need to verify that the JPDA options were actually enabled. If they were, you should have something listening on port 1044: C:\Tomcat netstat -a -o | find 1044 If the above command shows something like this: TCP127.0.0.1:1044 Krang:0 LISTENING332 Then JPDA has properly started and is listening on that port. If not, try running the netstat command without the | find part to see if that's failing (I tried adding -b argument and I got a requires elevation error, so the find of course didn't work). If there's nothing listening on port 1044, then your JPDA configuration is broken and you should re-post with your current progress. If it's listening, then you have a problem with your debugger and/or firewall issues. Since the subject of this thread is remote debug, I suspect you are trying to debug over a network. What is the relationship between the server and the client? Are there firewalls involved? Does JPDA bind to 127.0.0.1 or to 0.0.0.0 (or some other IP address)? If it binds to 127.0.0.1, then you'll need an ssh tunnel or something to turn a remote connection into a localhost one. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkr8LgUACgkQ9CaO5/Lv0PDznwCcDKN6CgOYuBYOaOsLnANxBcpE LacAn1oX3+2oOk5BEBiY20jL54juaN2L =LdC4 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thanks for your detailed information. I check it with my own configuration and found that the connection is established ,however I did not know since there is no message,so I try to connect the server side again, so I got the connect failed error And now I can connect it ,since I found each time I after I connect the tomcat start window will show a message in the below: Listening for transport at ...1044. That to say I think the connect of the debug is successful, and I have add breakpoints in the servlet,so I open a browser and enter: http://localhost:9000/helloServlet or If you have a Connector (in server.xml) configured on port 9000 then examine the catalina.out and the other log files for information. I enter http://localhost:9000; I can get the tomcat welcome page,but I got a 404 error when I entered http://localhost:9000/MT-web; And I found under the catalina-home/webapp there is no folder named MT-web
Re: remote debug
I am a litter confusing. If I deploy by myself,that to say I copy the F:\mavenTest\MT-Parent\MT-web\targetMT-web.war to the tomcat install directory: C:\tomcat6.0\webapp, what does the eclipse debugger do ? Without the IDE debugger I also can visit my page by http://localhost:9000/MT-web/helloServet; Now I add some breakpoints in a servlet under the MT-server(a dependency of MT-web) and I want it hangs up in the breakpoint when I request the servelt such as http://localhost:9000/MT-web/helloServet;
Re: remote debug
2009/11/12 Christopher Schultz ch...@christopherschultz.net -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 11/11/2009 8:33 PM, maven apache wrote: Thanks for your attention. Actually I did not modify the catalina.bat directly , I create a new bat named debug.bat in the same directory, the content of the debug.bat is : --- cd %CATALINE_HOME%/bin This is not spelled correctly. It should be CATALINA_HOME, not CATALINE_HOME. set JPDA_ADDRESS=1044 set JPDA_TRANSPORT=dt_socket This is the default JPDA_TRANSPORT when using Tomcat's startup scripts. set CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044 startup --- Then I start the tomcat with the debug.bat. It's tough to tell where the lines end due to word wrapping, but it looks like this script doesn't do anything but set environment variables. Is the startup word actually on a separate line from the set CATALINA_OPTS line? I'll assume so, otherwise nothing would happen. Note that you could have put these settings into bin/setenv.sh and it would be called before calling catalina.bat. Finally, Tomcat allows you to specify the JPDA_* environment variables so that you don't then have to re-specify everything in CATALINA_OPTS. Try deleting your debug.bat file and instead put this into your CATALINA_BASE/bin/setenv.bat file: set JPDA_ADDRESS=1044 set CATALINA_OPTS=-server -Xnoagent -Djava.compiler=none Note that catalina.bat will auto-build the following command-line arguments when starting up the JVM, given my above settings: - -Xdebug -Xrunjdwp:transport=dt_socket,address=1044,server=y,suspend=n Now, you have to start Tomcat like this: %CATALINA_BASE%\bin\catalina.bat jpda start This should start Tomcat using all the JPDA options. If you don't use jpda start, then all the JPDA_* environment variables are useless. I can see why you ended up specifying everything in CATALINA_OPTS: because Tomcat was otherwise ignoring all your settings. After you get Tomcat started, you'll need to verify that the JPDA options were actually enabled. If they were, you should have something listening on port 1044: C:\Tomcat netstat -a -o | find 1044 If the above command shows something like this: TCP127.0.0.1:1044 Krang:0 LISTENING332 Then JPDA has properly started and is listening on that port. If not, try running the netstat command without the | find part to see if that's failing (I tried adding -b argument and I got a requires elevation error, so the find of course didn't work). If there's nothing listening on port 1044, then your JPDA configuration is broken and you should re-post with your current progress. If it's listening, then you have a problem with your debugger and/or firewall issues. Since the subject of this thread is remote debug, I suspect you are trying to debug over a network. What is the relationship between the server and the client? Are there firewalls involved? Does JPDA bind to 127.0.0.1 or to 0.0.0.0 (or some other IP address)? If it binds to 127.0.0.1, then you'll need an ssh tunnel or something to turn a remote connection into a localhost one. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkr8LgUACgkQ9CaO5/Lv0PDznwCcDKN6CgOYuBYOaOsLnANxBcpE LacAn1oX3+2oOk5BEBiY20jL54juaN2L =LdC4 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thanks for your detailed information. I check it with my own configuration and found that the connection is established ,however I did not know since there is no message,so I try to connect the server side again, so I got the connect failed error And now I can connect it ,since I found each time I after I connect the tomcat start window will show a message in the below: Listening for transport at ...1044. That to say I think the connect of the debug is successful, and I have add breakpoints in the servlet,so I open a browser and enter: http://localhost:9000/helloServlet or http://localhost:1044/helloServlet ,but none of them can open the page, and the IDE did not turn to the class where I have add the breakpoints.
Re: remote debug
2009/11/11 Christopher Schultz ch...@christopherschultz.net -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 11/10/2009 2:18 AM, maven apache wrote: hi: I am so sorry to ask this problem again but I do can not make it work. I have seen the faq, and the doc pages,also I go to the goole to search but .. I am using tomcat6.0.zip,and my project is managed by maven,so the web module I do not know how to debug,although I know how to debug a common dynamic web project and add breakpoints . But the web module is not a common web project.I have no idea. Someone tell me I can use remote debug for the web module ,however when I try to connect the server,it can not connect . So I want to know if the remote debug can be used for the web module in maven,if it is,how to config the debug? It's not at all clear what you are doing, here. If you are using some kind of Maven-specific webapp deployment, I would ask the Maven folks if they have any ideas. Yes, I send to the maven maillist,and they suggest me try the remote debug, but nomatter how to config the tocmat6.0,I can not connect it through the IDE,please check the annex. Tomcat.jpg, elcipse.jpg and the conn.jpg My tomcat is 6.0.zip/ - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkr52l0ACgkQ9CaO5/Lv0PB5twCgt7kekyiZoXcfcRkaYWqAiSqR a+YAoKgbZ6wBEKY0O2UXzFnO8zHRadgh =Aua2 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: remote debug
Please read the following: http://catb.org/~esr/faqs/smart-questions.html Fine , I organized the problem I asked again: 1 related to maven. My project is created by eclipse IDE(through the m2eclipse), and managed by maven. It contains three modules: module MT-server, MT-io and MT-webapps. The MT-webapps is a web module which is to be deployed under the tomcat(see annex project-struct.jpg). Under the directory MT-webapp\src\main\webapp\WEB-INFO\, I config the web.xml with a servlet named MTServlet under the MT-server module. Now I want to add some breadpoints in the MTServlet to debug. But the MT-webapps module is not a common dynamic web project,so I can not found the debug on server meun. I have try my best to found the resolution through friends,search enginer and so on but got nothing. Then I post it to the maven maillist, they tell me I should use the remote debug. 2 realated to tocmat So I start to config remot debug in tomcat . After modify the catalina.bat,and start it ,I can not connet it through the IDE(eclipse),but I just followed the faq,so I post it to this maillist. The annex tomcat.jpg is the start infomation when I start the tomcat with debug modal,the eclipse.jpg is the configuration in my IDE to connect, and the conn.jpg is the error message I got . I hope someone can check them and give some advise.Thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: remote debug
2009/11/12 Christopher Schultz ch...@christopherschultz.net -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 11/11/2009 9:52 AM, maven apache wrote: So I start to config remot debug in tomcat . How do you start Tomcat? Using bin\startup.bat? After modify the catalina.bat Okay, you are using bin\startup.bat, then? You ought to be able to use environment variables to affect this and not actually change catalina.bat, but it's okay to do that, too. Please post the changes you made to catalina.bat. Thanks for your attention. Actually I did not modify the catalina.bat directly , I create a new bat named debug.bat in the same directory, the content of the debug.bat is : --- cd %CATALINE_HOME%/bin set JPDA_ADDRESS=1044 set JPDA_TRANSPORT=dt_socket set CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044 startup --- Then I start the tomcat with the debug.bat. Also, please confirm that you start Tomcat by using bin\startup.bat. If you use Eclipse to start Tomcat, it might be ignoring that configuration. I think so , I start the tomcat manually. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkr7MZIACgkQ9CaO5/Lv0PDSzQCeIhaqMMi6pj2xmGzWk7jkAt/c 4VEAn1yUnfwMJJZBRWvyyHT4t8dGkmsr =J582 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
remote debug
hi: I am so sorry to ask this problem again but I do can not make it work. I have seen the faq, and the doc pages,also I go to the goole to search but .. I am using tomcat6.0.zip,and my project is managed by maven,so the web module I do not know how to debug,although I know how to debug a common dynamic web project and add breakpoints . But the web module is not a common web project.I have no idea. Someone tell me I can use remote debug for the web module ,however when I try to connect the server,it can not connect . So I want to know if the remote debug can be used for the web module in maven,if it is,how to config the debug? Thanks.
remote debug
Hi: I have a project and want to use the remote debug manner,my web container is tomcat of version of 5.5,I have seen the faq in wiki of tomcat. I follow the instruction: -- %CATALINA_HOME%\bin\tomcat6w.exe //ES//tomcat6 Select the Java tab in the properties dialog box, Add the following two lines to the Java Options text box: -Xdebug -Xrunjdwp:transport=dt_socket,address=192.168.2.10:1044,server=y,suspend=n after the configuration I restart the tomcat. then in my eclipse EE I open the debug configuration dialog,create a new remote java application,in the connection properties I set : host:192.168.2.10 port:1044 Then I click applay--debug.However a error dialog comes out which tell me: Failed to connect to remote VM. Connection refused. Connection refused: connect I wonder why? I have tried to Set environment variables JPDA_ADDRESS=1044 and JPDA_TRANSPORT=dt_socket,but it does not work also. Anyone can give me some advise? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: remote debug
2009/11/4 Caldarale, Charles R chuck.caldar...@unisys.com From: maven apache [mailto:apachemav...@gmail.com] Subject: remote debug my web container is tomcat of version of 5.5 %CATALINA_HOME%\bin\tomcat6w.exe //ES//tomcat6 One of the above two statements is wrong. Which version of Tomcat are you really using?\ I am using apache-tomcat-5.5.27(. Failed to connect to remote VM. Connection refused. Connection refused: connect What version of Windows are you using? I can get JMX/JPDA working with a Tomcat service on XP, but not on Vista (haven't tried it on Win7 yet). JMX/JPDA works with Tomcat started from a command prompt on both XP and Vista. (The .bat scripts are only in the Tomcat .zip download, not the .exe, for some inexplicable reason.) Win xp with sp3. That's to say if I want to use the remote debug ,I should use the tomcat.zip? Should I uninstall the tomcat I am using? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: remote debug
2009/11/5 Caldarale, Charles R chuck.caldar...@unisys.com From: maven apache [mailto:apachemav...@gmail.com] Subject: Re: remote debug %CATALINA_HOME%\bin\tomcat6w.exe //ES//tomcat6 One of the above two statements is wrong. Which version of Tomcat are you really using?\ I am using apache-tomcat-5.5.27(. Then how it is possible you're fiddling with tomcat6w.exe, which is part of Tomcat 6.0, not 5.5? I post wrong. the command I use in command line is : %CATALINA_HOME%\bin\tomcat5w.exe //ES//tomcat5 That's to say if I want to use the remote debug ,I should use the tomcat.zip? Should I uninstall the tomcat I am using? I would uninstall the .exe version. You can create the service with the service.bat script from the .zip download. In a word,I have two choice: 1 use the tomcat.zip of version 5.5 or 6.x. 2 use the tomcat.exe of version 6.x? isn't it? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: remote debug
2009/11/5 Caldarale, Charles R chuck.caldar...@unisys.com From: maven apache [mailto:apachemav...@gmail.com] Subject: Re: remote debug In a word,I have two choice: 1 use the tomcat.zip of version 5.5 or 6.x. 2 use the tomcat.exe of version 6.x? The version of Tomcat doesn't matter, although unless you have a compelling reason to use an older level, I would go with the current 6.0.20 zip file. Generally, things are easier to debug when starting Tomcat via the .bat scripts rather than as a service, partly since you get to see in a command window if there are any startup errors. Create a setenv.bat script in Tomcat's bin directory to hold any command-line parameters you want to set. Once you're ready to try Tomcat as a service, install it with the service.bat script, and use the tomcat6w.exe program to set additional options and start/stop the service. No point in trying to use the tomcat6.exe program directly - it's too hard. Thanks for your reply. I used 5.5 rather than 6.0 because I heard that 6.0 is much different with 5.5 in configuration(such as the port and ect..),I will have a try with the 6.0.zip.Thank you again :). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
tomcat shut down normally
Hi all:I am working with a web service using the tomcat,however I met some problems recently. The tomcat shut down when my application work wrongly. I intend to call some command in my web application by the Runtime class,and I create a new class which extends the Thread to get the Error stream,if the error is not null so there must be something wrong when call the command ,then I want to throw a exception which I have defined,but this is not impossible ,since in the run method one can not tho throw his own exception. So I can just throw the RuntimeException. In my thought,when I throw the RuntimeException ,my application can be down,but the tomcat should not shut down! The fact is that once error occurs(for example ,the command is wrong),the tomcat is shut down itself. I wonder someone can give a advise. The following is my thread class to get the error stream: final class ThreadError extends Thread { private static Logger LOGGER = Logger.getLogger(ThreadError.class); private Process ps; private String cid; public ThreadError(Process ps, String cid) { this.ps = ps; this.cid = cid; } /** * Run the command. */ public void run() { try { java.io.BufferedReader reader = new java.io.BufferedReader( new java.io.InputStreamReader(this.ps.getErrorStream())); String line = ; try { while ((line = reader.readLine()) != null) { System.err.println(this.cid + |ERROR| + line); LOGGER.warn(this.cid + |ERROR| + line); } } finally { reader.close(); if (this.ps.exitValue() != 0) { throw new RuntimeException( this.cid+ |ERROR|Execution failure, there might be an error in your command. [exit code= + this.ps.exitValue() + ]); / in fact in the above line If I did not throw the RuntimeException ,the tomcat also shutdown. } } } catch (java.io.IOException ioe) { ioe.printStackTrace(); } } } -