Re: Tomcat 4 as a service in Windows and Classpath Question
Here is some information on the program that creates the tomcat service in Windows... http://www.alexandriasc.com/software/JavaService/documentation.html Mark - Original Message - From: Longley, Andrew [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, April 03, 2003 10:52 AM Subject: RE: Tomcat 4 as a service in Windows and Classpath Question What I've figured out is that you can hack the registry and modify the java.class.path parameter. Alternatively, there is a syntax for installing the service where you can specify the classpath when you install the service (or you could uninstall and re-install). How to hack the registry: use regedit to edit key HKLM\SYSTEM\CurrentControlSet\Services\Apache Tomcat 4.1\Parameters\JVM Option Number 0 (assuming your service is called Apache Tomcat 4.1 and that your JVM Option Number 0 parameter data begins with -Djava.class.path...) Double-click the parameter and edit the classpath at will. How to install a new service: open a command prompt and use syntax %CATALINA_HOME%\bin\tomcat.exe -install Apache Tomcat 4.1 %JAVA_HOME%\jre\bin\client\jvm.dll -Xmx512m -Xms256m -Djava.class.path=%CATALINA_HOME%\bin\bootstrap.jar -Dcatalina.home=%CATALINA_HOME% -start org.apache.catalina.startup.BootstrapService -params start -stop org.apache.catalina.startup.BootstrapService -params stop -err %CATALINA_HOME%\logs\stderr.log (all on one line, and obviously modifying the -Djava.class.path to whatever you need but not losing the bootstrap.jar) If you install multiple Tomcats on one box as services, you will need a different server.xml file for each to specify different ports. I *believe* the syntax for this is to edit the service in the Services control panel, and add an Additional Parameter of the form -config conf\server.xml Hope that helps. If anyone else has more good information, please add. Andrew Longley -Original Message- From: Ernesto Echeverria [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 8:40 AM To: [EMAIL PROTECTED] Subject: Tomcat 4 as a service in Windows and Classpath Question I've recently installed Tomcat 4.1 as a service in a Windows 2000 environment. In Linux, if I ever need to extend the CLASSPATH variable, I can do that easily in the scripts provided. However, I'm not clear how to do this in Windows when Tomcat was installed as a service. What is the correct way to extend CLASSPATH, and if the service needs to be reinstalled, what would be the command in order not to loose the default settings, plus the extra paths? Thanks in Advance. - 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 Woes
Jake - you are a genius! I reverted back to 1.4.0_03 and the memory leak problem seems to have gone away. I am heavily dependent on StringBuffers for generating XML, so this bug was really causing problems. Thanks for your time! Mark - Original Message - From: Jacob Kjome [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:28 AM Subject: Re: Memory Woes Possibly this StringBufffer.toString() memory leak bug in j2sdk1.4.1? What JDK do you use? j2sdk1.4.0 doesn't suffer from this issue... http://developer.java.sun.com/developer/bugParade/bugs/4724129.html Jake At 03:05 PM 3/30/2003 -0500, you wrote: Actually, this is 100% servlet-powered... no JSP pages are used. Anyone else know of any issues? Mark - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 28, 2003 8:17 AM Subject: Memory Woes Hello, Has anyone had any memory issues when running Tomcat in a production environment where it stays up for weeks? I have a webapp that is fairly intense, using the Struts framework (which is great, by the way!) with streaming data to sockets and database logging to mySQL. I have several of these apps running in one Tomcat installation. My problem is that memory usage keeps steadily creeping up on me until I start getting the dreaded java.lang.OutOfMemoryError (or something like that). I bumped up the memory settings for the JVM memory settings, which simply delays the problem, but it still happens. (-Xmx... ) I have also profiled the application, and found that after garbage collection all of my objects go back to the original usage levels (as far as instances). None of them are continually appending to a string or anything like that... mainly just state information. I'm not sure where to go from here - having to occasionally restart Tomcat once a month is not a workable solution for me. Any advice would be GREATLY appreciated! Mark - 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: Memory Woes
Actually, this is 100% servlet-powered... no JSP pages are used. Anyone else know of any issues? Mark - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 28, 2003 8:17 AM Subject: Memory Woes Hello, Has anyone had any memory issues when running Tomcat in a production environment where it stays up for weeks? I have a webapp that is fairly intense, using the Struts framework (which is great, by the way!) with streaming data to sockets and database logging to mySQL. I have several of these apps running in one Tomcat installation. My problem is that memory usage keeps steadily creeping up on me until I start getting the dreaded java.lang.OutOfMemoryError (or something like that). I bumped up the memory settings for the JVM memory settings, which simply delays the problem, but it still happens. (-Xmx... ) I have also profiled the application, and found that after garbage collection all of my objects go back to the original usage levels (as far as instances). None of them are continually appending to a string or anything like that... mainly just state information. I'm not sure where to go from here - having to occasionally restart Tomcat once a month is not a workable solution for me. Any advice would be GREATLY appreciated! Mark - 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: different clients using the same instance of a bean
I used all servlets, so I'm not an expert at doing this in jsp, but I can give you the concepts that I would pursue: 1. Create a bean with a Hashtable or some structure to hold references to all your state beans. 2. Create a bean that contains your data, methods, etc. that you want to share between users. 3. When a user logs in, get THE instance of the application-scope 'manager' bean. 4. From this 'manager' bean, you can get a reference to the state bean that the user needs, by name. 5. The manager bean then either returns the reference to the bean from its Hashtable if it exists, and if it doesn't, it creates a new one with the name requested. The getAttribute() simply returns a reference to the object requested by name, otherwise it returns null... that is why if it returns null, the code below uses setAttribute() to create an instance of the object and assign a name to reference it by. I'm not sure why they made it so difficult to understand, but if I remember right the getServletContext() means that you are getting application-scope. I don't remember off the top of my head what to use if you need page-level and session-level scope (I have it in a book somewhere). Does that help? I think this is essentially what Leandro was referring to earlier as well. Mark - Original Message - From: Michael Ni [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 4:39 PM Subject: Re: different clients using the same instance of a bean I copied some code I picked up from a website about application and session scope. Can someone explain how setAttribute and getAttribute works? what do the actual parameters do? also when i use jsp useBean, i usually have a name, which is the name of my instance. Where in servlet code does it use that name? mike ps pls look at code below jsp:useBean class=foo.Counter scope=application / The servlet equivalent of the above useBean action is: foo.Counter counter = (foo.Counter)getServletContext().getAttribute(counter); if (counter == null) { counter = new foo.Counter(); getServletContext().setAttribute(counter, counter); } -- jsp:useBean id=counter class=foo.Counter scope=session / The servlet equivalent of the above useBean action is: HttpSession session = request.getSession(true); foo.Counter counter = (foo.Counter)session.getValue(counter); if (counter == null) { counter = new foo.Counter(); session.putValue(counter, counter); } _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - 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 allocations with java TomCat
If you are using the Windows service, this link gives you all the information you need to know: http://www.alexandriasc.com/software/JavaService/documentation.html Specifically, you add your JAVA_OPTS to the 'JVM Option Number n' registry settings, then make sure that you change 'JVM Option Count ' to reflect the number of options you will then have. Good luck! Mark - Original Message - From: Francisco José Arnau Vives [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 6:11 AM Subject: Memory allocations with java TomCat Dear users: I usually run tomcat over a linux machine. I need improve my normal memory requirements because I generate very large reports. I use in the initialization script 'export JAVA_OPTS=-Xmx1024m' and I solve most of the problems in Linux. The problem that I have now is that I have installed TomCat over a Windows Machine as service and I don't know how can provide more memory requirements to the java environment. Can anybody help me? - 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: different clients using the same instance of a bean
How will your application know which bean to direct a certain user to? Maybe if you give a little more insight into why you are trying to accomplish this, someone will think of a solution. For my application, I have an application-scope bean that acts as the 'manager' of a group of state beans, which are shared by different users. It controls the life of them, along with access. Mark - Original Message - From: Michael Ni [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 3:38 PM Subject: different clients using the same instance of a bean How do I have groups of different clients from different browsers use the same instance of a bean. I'm not talking about application scope. Application scope is everyone using the same instance of a bean. I'm talking about bob and joe using one instance of bean A and ken and barbie using another instance of bean B while all clients are using different computers. Someone suggested servletcontext to me but I think that refers to application scope. I was looking into session id but its depreciated in the new java formats. I dont understand how setAttribute and getAttribute works. is anyone knowledgable in this subject and can direct me in the right direction? mike _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - 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: Help with tomcat/j2se install on linux RH7.3
Try going to the command line and typing: service tomcat4 start Mark - Original Message - From: Chris Hale [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 8:34 PM Subject: Help with tomcat/j2se install on linux RH7.3 Looking for assistance getting Tomcat and J2SE installed on my Linux = RH7.3 system. I think I got J2SE 1.4.1_02 installed, as well as Tomcat = 4.1.18. But when I open my browser for the system and look at port 8080, = nothing. I also don't see anything running as far as a process. As you can = probably tell, I'm quite the newbie at this. I need to have this installed so = our web folks can install some .jsp pages (see http://www.peaknetworks.com). We're moving to a new server and need to support their jsp development. If you can provide me some guidance as to where to start, look, what to = do, etc, I'd appreciate it. I am running Apache 1.3.27. If you need any other info, let me know. Thanks, Chris -- Chris Hale Peak Networks 16 Cassie Lane Merrimack, NH 03054 http://www.peaknetworks.com 800-PEAK-987 [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: Help with tomcat/j2se install on linux RH7.3
When I installed Tomcat, it installed the service for me, I think (I'm no expert on Linux). Were you logged in using an account that had the administrative rights to install a service when you installed Tomcat? If not, maybe try reinstalling it, but under the root account or an administrator account. There is probably a way to add the service manually, but since you are starting from scratch, maybe the reinstall would be easier for you... Mark - Original Message - From: Chris Hale [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 9:51 AM Subject: RE: Help with tomcat/j2se install on linux RH7.3 I get a error message stating the service isn't found - no man entry for service either. How do I add the tomcat4 to a possible service? Chris -- Chris Hale Peak Networks 16 Cassie Lane Merrimack, NH 03054 http://www.peaknetworks.com 800-PEAK-987 [EMAIL PROTECTED] -Original Message- From: Mark Pease [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 8:43 AM To: Tomcat Users List Subject: Re: Help with tomcat/j2se install on linux RH7.3 Try going to the command line and typing: service tomcat4 start Mark - Original Message - From: Chris Hale [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 8:34 PM Subject: Help with tomcat/j2se install on linux RH7.3 Looking for assistance getting Tomcat and J2SE installed on my Linux = RH7.3 system. I think I got J2SE 1.4.1_02 installed, as well as Tomcat = 4.1.18. But when I open my browser for the system and look at port 8080, = nothing. I also don't see anything running as far as a process. As you can = probably tell, I'm quite the newbie at this. I need to have this installed so = our web folks can install some .jsp pages (see http://www.peaknetworks.com). We're moving to a new server and need to support their jsp development. If you can provide me some guidance as to where to start, look, what to = do, etc, I'd appreciate it. I am running Apache 1.3.27. If you need any other info, let me know. Thanks, Chris -- Chris Hale Peak Networks 16 Cassie Lane Merrimack, NH 03054 http://www.peaknetworks.com 800-PEAK-987 [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: System.out.println?
If you are running under windows, stdout - Original Message - From: Jackson, Stephen [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 1:17 PM Subject: RE: System.out.println? logs/catalina.out -Original Message- From: Amitabh Shukla [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 1:15 PM To: [EMAIL PROTECTED] Subject: System.out.println? Hi, I am using System.out.println on my servlet. I am using Apache Tomcat server. I want to know where does the System.out.println output goes? Does it write to some file- stderr or stdout? Please let me know, Thanks, Amit. __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - 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: broken links
If you are running on Linux, I believe the paths are case-sensistive... Are you typing it EXACTLY the same? Mark - Original Message - From: Bharadwaj [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, March 13, 2003 2:00 PM Subject: broken links sir, good day. we have a problem. we are using tomcat 3.2.4 we always get a problem of 404 file not found exception when the file does exists in the required path. we had tried clearing the cache, but still this problem continues. i would appreciate and error from you on this regard. thanking you, regards, raja bharadwaj m.s. - 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: Model View Controller with JSP
Hi Jan, I think you are out of luck with a straight JSP unless you incorporate Applets to stream the data to. When you request a JSP page, it is dynamically generated from the server, but it still follows the HTTP method of a simple request, which returns the page and the 'connection' is terminated. I would recommend either Java Applets, or doing your app in Macromedia Flash and taking advantage of the XMLSockets talking to a servlet. This method would 'push' the data out to the clients as soon as it is updated. Or, if you can 'poll' the server for updates (ie it doesn't have to be updated immediately), you can simply have your applet or Flash app occasionally request a certain JSP page for new data. Mark - Original Message - From: Jan Behrens [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, March 14, 2003 5:48 AM Subject: Model View Controller with JSP hi list, i am trying to figure out a way to use the model-view-controller paradigm to dynamicaly reload a jsp page when the underlying object has been changed by another user. i would like to achive this without having to use a separate servlet however... any ideas, tips or links would be very much appreciated regards jan - 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]