JVM config for tomcat5.5
Hi, I wanted to know where java_home is set for Tomcat when it's installed as a service since I can't find any .bat/.sh files in my tomcat folder. Thanks -- View this message in context: http://www.nabble.com/JVM-config-for-tomcat5.5-tp19583097p19583097.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jstack and Tomcat 6 on Windows
- Original Message - From: Brian Clark [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, September 20, 2008 12:58 AM Subject: Re: jstack and Tomcat 6 on Windows Thanks everyone for their suggestions. Unfortunately, that doesn't help me with my particular issue. I have a memory leak in one of my apps, and when the system runs out of memory, it stops responding to new requests. I have a script that will detect this condition and automatically restart Tomcat. I was hoping to add a jstack command to this script to give me a thread dump prior to restarting Tomcat to give me better troubleshooting information. Your solution would work under normal circumstances, but I don't know how to script a ctrl+break. ;-) Oh... I dont know if trying to find the issue on production server is going to be easy... Out Of Mem ... scary start praying that it is, one of your apps... Normally JMeter and a quiet system is the easiet way to find which one is the problem... The later JDK's 6 do what you looking for... google for JHAT... here ... http://java.sun.com/javase/6/docs/technotes/tools/share/jhat.html Notice the HeapDumpOnOutOfMemoryError java option... And also check out JMX, JConsole you may find all that useful... esp the force heap garbage collection option. Another rough guide is runs the various web-apps thru the browser... and watch the window handles... not the memory... If that keeps sliding up... thats the bad webapp... trouble with all the Java monitoring stuff is that unless a GC is done (at least twice), what you looking at doesnt mean much I've never tried the JHat stuff... but they made it because OOM errors are a nightmare... let us know if JHat is the thing we all being waiting for ;) Good Luck ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JVM config for tomcat5.5
jaki wrote: Hi, I wanted to know where java_home is set for Tomcat when it's installed as a service since I can't find any .bat/.sh files in my tomcat folder. Thanks http://tomcat.apache.org/tomcat-6.0-doc/setup.html - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jstack and Tomcat 6 on Windows
Thanks everyone for their suggestions. Unfortunately, that doesn't help me with my particular issue. I have a memory leak in one of my apps, and when the system runs out of memory, it stops responding to new requests. I have a script that will detect this condition and automatically restart Tomcat. I was hoping to add a jstack command to this script to give me a thread dump prior to restarting Tomcat to give me better troubleshooting information. Your solution would work under normal circumstances, but I don't know how to script a ctrl+break. ;-) OK... I couldnt resist giving it a little go... JHat is exactly what you looking for... http://weblogs.java.net/blog/jfarcand/archive/2006/02/using_mustangs.html Well done Sun... its exactly what I've been looking for... Let the server run a little do a dump, run the server and then from the browser to the HIST option... The highest non Sun class... webapp class... is going to be the bad guy ;) Damn thats nice... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JVM config for tomcat5.5
Thanks for pointing that out. I was trying to retrieve java.home used by tomcat using a java program. I could go with sys.getProperty(java.home), but the value returned doesn't always have to match with java.home local to tomcat. So it seems peeking into the registry is the only way forward for me. But not the best way since I want the program to be OS independent. So, if there are other suggestions kindly help me with them. Mark Thomas-18 wrote: jaki wrote: Hi, I wanted to know where java_home is set for Tomcat when it's installed as a service since I can't find any .bat/.sh files in my tomcat folder. Thanks http://tomcat.apache.org/tomcat-6.0-doc/setup.html - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/JVM-config-for-tomcat5.5-tp19583097p19584898.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
question
Hi everyone, I resolved my first problem: I'm working on Windows XP ( and not Win 98), but I'm a beginner in Tomcat and my problem is that when I compile my servlet class the compiler doesn't find the package javax.servlet.ServletException and javax.servlet.http.*. I don't know where is the probleme, Have I to import this pakage manually (it doesn't exist in the java 1.5 core ??). thank u for your precious help.
Re: question
Jojo Nadir ha scritto: Hi everyone, I resolved my first problem: I'm working on Windows XP ( and not Win 98), but I'm a beginner in Tomcat and my problem is that when I compile my servlet class the compiler doesn't find the package javax.servlet.ServletException and javax.servlet.http.*. I don't know where is the probleme, Have I to import this pakage manually (it doesn't exist in the java 1.5 core ??). You are right, the package javax.servlet.http in not in java2. You can find it in the /lib/ subdirectory of tomcat in servlet-api.jar You must include that jar file in you classpath. If you are using javac from command line you can use the -cp option. Edoardo - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat Custom Connector
Hi again, (I posted a similar question to this in the dev mailing list because I misunderstood the aim of that mailing list). During these last few weeks I did a lot of research on how connectors work in Tomcat and I can understand most of it now. However I have a small issue. I noticed that the Request class in the Coyote package does not inherit from the ServletRequest interface. This made me wonder if internally tomcat actually maps the type of Request object to another type of Request object of type ServletRequest (at first). I therefore decided to check the code of the CoyoteAdapter inside the Catalina package. Here I found that in the service() method first a Request object of type HttpServlet is tried to retrieved from the Request object created in the Coyote package. If this is not found then it is created. Therefor I feel that in order to develop a protocol handler completly http independent then I will need to also develop my own implementation of Adapter! Is this right? If so how would I tell tomcat to use my Adapter version? Also howcome this type of design. I am sure that there must be a reason behind it. However why isn't the Request object created of type HttpServlet or some other type within the Coyote package rather then leave it to the CoyoteAdapter within the Catalina package. Thanks and Regards, Simon J. From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: RE: Tomcat Custom Connector Date: Tue, 17 Jun 2008 10:41:54 +0200 Hi Bill, Thanks again for your reply. Your comments are very helpfull :) I will definitly have other questions in the future but for now I think I can move forward :) Thanks again, Simon J. To: users@tomcat.apache.org From: [EMAIL PROTECTED] Subject: Re: Tomcat Custom Connector Date: Fri, 13 Jun 2008 19:51:35 -0700 The Adapter is set in the initialize method of the Connector (http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/connector/Connector.html). You can pretty much just trust that Tomcat will give you an Adapter instance before the first request comes through, since that is the contract. Yes, the current implementation only will give you an instance of CoyoteAdapter, but programming your ProtocolHandler around this is dangerous, since the contract only promises an instance of Adapter. The Adapter is the bridge between your ProtocolHandler and the Tomcat Servlet Container. Once you hand off your Request and Response objects to the Adapter, you can trust that Tomcat will handle all of the Servlet-Spec parts by itself, including finding the Servlet to send the request to. At that point, you are only responsible for communicating with the client over the wire via the InputBuffer and OutputBuffer interfaces. For example, the various AJP/1.3 Connectors (http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/coyote/ajp/AjpProcessor.html) convert the message into AJP/1.3 format before sending it over the wire to Apache httpd. Once you have figured out how to initialize the Request and Response objects to look enough like the wire protocol was HTTP, the rest is really pretty easy :). For non-HTTP protocols (e.g. trying to make Tomcat look like an FTP server), this is the hard part. Simon Aquilina [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, I have checked the code in Tomcat again, and although it is very confusing I feel I did understand something here and there :) However I have a question - where is the adapter being set? No Adapter is being initialized in the 'JIoEndPoint', 'Http11Protocol' and 'Http11Processor'. I also checked the 'server.xml' file and this is not being set! From the API documentation I found out the 'CoyoteAdapter'; so is this the default being used for Tomcat? Is it the CoyoteAdapter which is responsible to find the servlet for which the request is? or? Thanks for any comments, Simon J. To: users@tomcat.apache.org From: [EMAIL PROTECTED] Subject: Re: Tomcat Custom Connector Date: Tue, 3 Jun 2008 19:17:03 -0700 AFAIK, there isn't a lot of documentation. But there isn't that much too it. You need to implement a ProtocolHandler (http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/coyote/ProtocolHandler.html) This class is responsible for managing the transport (e.g. ServerSocket) and request threads (but the various EndPoint classes in org.apache.tomcat.util.net may simplify this aspect for you). For best results, this class may implement ActionHook as well (http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/coyote/ActionHook.html). When a new request comes in, it is the ProtocolHandler's job to initialize a Request (http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/coyote/Request.html) and a Response (http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/coyote/Response.html) objects for
Tomcat 5.5 / Windows / procrun ?
Hi. I have Tomcat 5.5 running on a variety of platforms, among them Windows XP (my laptop) and Windows 2003 server. For the Windows installation, until now I have been using the Windows Service Installer from the Tomcat 5.5 download page, and it works fine. But could someone shed some light on the following puzzle ? A recent discussion on this list triggered my curiosity, and as a result I bumped into several things : - the installer for Windows installs a version of Tomcat 5.5 devoid of the usual startup.sh/bat, catalina.sh/bat etc.. and instead just installs a couple of files in Tomcat_home\bin, of which a tomcat5.exe (which seems to be the Tomcat executable), and a tomcat5w.exe which is the Windows GUI allowing to configure the Tomcat service.. - the ImagePath Registry entry for the Tomcat 5.5 Service shows this : C:\Tomcat5.5\bin\tomcat5.exe //RS//Tomcat5 - On the Tomcat 5.5 download page, in addition to the installer, there also exists a Tomcat 5.5 zip file. That one seems to contain the full complement of usual files of Tomcat, including Tomcat_home\bin, plus the tomcat5.exe and tomcat5w.exe which are also in the installer package. It also contains a file service.bat which is described nowhere, but seesm to be related to the procrun item of which question below. The Tomcat 5.5 and Tomcat 6 on-line documentation, setup page, section for Windows, only seem to mention the Installer package. There is a link on both the 5.5 and 6.0 Windows setup sections, pointing to a Windows Service HowTo, which leads to a page mentioning procrun 1.0, but in the same breath indicating that it is now obsolete. Digging further, I found a link to the Apache Commons project Daemon, which seems to include this procrun for Windows, and also a jsvc for Unix. The page there relative to procrun, (http://commons.apache.org/daemon/procrun.html) apart from being relatively difficult to read, seems interesting and seems to match the way my Windows Tomcat 5.5 instances are really installed and running. (See registry line above). But I found nowhere a link to download this procrun in binary form. I also did not find any link there pointing to any other version of procrun... On the other side of things, this same Apache Commons Daemon project also covers a jsvc, which seems to be a wrapper allowing to run Tomcat as a daemon under Unix/Linux. I believe I have seen mentions of this jsvc in some Tomcat documents (or in this forum ?), but at any rate my Tomcat Debian Linux systems seem to run Tomcat 5.5 as daemon perfectly fine, without seeming to use this jsvc module. So I wonder what it is used for. What I kind of piece together of all this is as follows : - the packagers of Tomcat 5.5 and Tomcat 6 for Windows use this procrun program (in whatever version, but probably not 1.0), to take the java JVM executable and make it into a Windows service which runs Tomcat. This Windows Service executable is named tomcat5.exe in the msi distribution. (Or else this tomcat5.exe is not really java packaged as a service, but just a stub pointing to an installed Java jvm dll). Anyway the result is packaged, together with the other Tomcat components, into a Windows Service Installer package which is the one on the Tomcat download page. - the documentation of this procrun (or whatever is related to it for Tomcat), on the Tomcat site, is out-of-date and does not match the version of procrun that is being used above. - the procrun program is a general utility that allows to take any Java program (or any program ?) and turn it into a Windows service. It thus seems to be something like the old srvany workhorse, but a bit more sophisticated. But this procrun program does not seem to be available for download in binary form. - and I don't have a clue as to what jsvc may be for. Thanks André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JVM config for tomcat5.5
Tomcat requires Java (at least SDK; but JDK won't harm) to be installed. On my machine I usually set: JAVA_HOME to the installation path for jdk/sdk e.g. /usr/java/jdk1.6.0_07 CATALINA_HOME to the installation path for /usr/apache-tomcat-6.0.16. Hope this helps. -Original Message- From: jaki [mailto:[EMAIL PROTECTED] Sent: 20 September 2008 08:55 To: users@tomcat.apache.org Subject: JVM config for tomcat5.5 Hi, I wanted to know where java_home is set for Tomcat when it's installed as a service since I can't find any .bat/.sh files in my tomcat folder. Thanks -- View this message in context: http://www.nabble.com/JVM-config-for-tomcat5.5-tp19583097p19583097.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Information from ESET NOD32 Antivirus, version of virus signature database 3457 (20080919) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, version of virus signature database 3458 (20080921) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]