Null printed in jsp getProperty fields
Hello everyone. I can't imagine that this isn't a question that has been asked a great many times, but I can't find the answer anywhere. We're using multiple tomcat 4.1.30 servers in a production environment for a commercial website, and we would like to move up to the latest stable version. However, when testing our application in tomcat 5.0+, we have noticed that jsp pages that use the jsp:getProperty / method to display session data print the word null in every field that has a null value. Although I haven't read about this, I'm guessing it is part of the Sun's application server standard. I've been told that WebLogic does the same thing, but that there is a configuration setting to repress displaying the word null. Is there such a setting for tomcat? If not, what is the best way to keep from printing null in every field that has a null value? I know we could do it through javascript, but it just seems like a change this big, after years of not having this behaviour, there must be some way to prevent it from happening at the application server level. Can someone point me in the right direction? I've googled for the answer, but any search with null and tomcat in it returns a lot of pages about unrelated problems. Thanks, --Michael Molloy = Michael Molloy Senior Software Engineer Ncycles Software Solutions 901.756.2705
RE: Null printed in jsp getProperty fields
Thanks for the pointer. I have not investigated JSTL, and I will look into it further. Can anyone give me a link that explains the reasons behind this behaviour? Now that I'm aware that it can't be turned off, I'm very curious as to why it was coded this way. Thanks, --Michael -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 7:55 AM To: Tomcat Users List Subject: Re: Null printed in jsp getProperty fields There is no setting to turn this off. [But if you use JSTL - null get supressed for you.] -Tim Michael Molloy wrote: Hello everyone. I can't imagine that this isn't a question that has been asked a great many times, but I can't find the answer anywhere. We're using multiple tomcat 4.1.30 servers in a production environment for a commercial website, and we would like to move up to the latest stable version. However, when testing our application in tomcat 5.0+, we have noticed that jsp pages that use the jsp:getProperty / method to display session data print the word null in every field that has a null value. Although I haven't read about this, I'm guessing it is part of the Sun's application server standard. I've been told that WebLogic does the same thing, but that there is a configuration setting to repress displaying the word null. Is there such a setting for tomcat? If not, what is the best way to keep from printing null in every field that has a null value? I know we could do it through javascript, but it just seems like a change this big, after years of not having this behaviour, there must be some way to prevent it from happening at the application server level. Can someone point me in the right direction? I've googled for the answer, but any search with null and tomcat in it returns a lot of pages about unrelated problems. - 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: Null printed in jsp getProperty fields
Thanks for the information. So it seems that for years, Tomcat was simply hiding the null string, but they no longer do so. Is that correct? Thanks, --Michael -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 9:01 AM To: Tomcat Users List Subject: Re: Null printed in jsp getProperty fields Per the spec: The conversion to String is done as in the println methods, i.e. the toString method of the object is used for Object instances, and the primitive types are converted directly. And in the javadocs for print(String): Print a string. *If the argument is null then the string null is printed.* -Tim Michael Molloy wrote: Thanks for the pointer. I have not investigated JSTL, and I will look into it further. Can anyone give me a link that explains the reasons behind this behaviour? Now that I'm aware that it can't be turned off, I'm very curious as to why it was coded this way. Thanks, --Michael -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 7:55 AM To: Tomcat Users List Subject: Re: Null printed in jsp getProperty fields There is no setting to turn this off. [But if you use JSTL - null get supressed for you.] -Tim Michael Molloy wrote: Hello everyone. I can't imagine that this isn't a question that has been asked a great many times, but I can't find the answer anywhere. We're using multiple tomcat 4.1.30 servers in a production environment for a commercial website, and we would like to move up to the latest stable version. However, when testing our application in tomcat 5.0+, we have noticed that jsp pages that use the jsp:getProperty / method to display session data print the word null in every field that has a null value. Although I haven't read about this, I'm guessing it is part of the Sun's application server standard. I've been told that WebLogic does the same thing, but that there is a configuration setting to repress displaying the word null. Is there such a setting for tomcat? If not, what is the best way to keep from printing null in every field that has a null value? I know we could do it through javascript, but it just seems like a change this big, after years of not having this behaviour, there must be some way to prevent it from happening at the application server level. Can someone point me in the right direction? I've googled for the answer, but any search with null and tomcat in it returns a lot of pages about unrelated problems. - 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: Null printed in jsp getProperty fields
Thanks very much. --Michael -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 9:42 AM To: Tomcat Users List Subject: Re: Null printed in jsp getProperty fields IIRC - it was doing it correct in 4.0.4 - then in 4.1 - it was changed and but too many release cycles went by before discover and it was decided to keep the bug since a minor upgrade would cause major bugs for many deployments. Since 5.X is a major upgrade - it was an easy decision to revert back to the correct behavior. -Tim Michael Molloy wrote: Thanks for the information. So it seems that for years, Tomcat was simply hiding the null string, but they no longer do so. Is that correct? Thanks, --Michael -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 9:01 AM To: Tomcat Users List Subject: Re: Null printed in jsp getProperty fields Per the spec: The conversion to String is done as in the println methods, i.e. the toString method of the object is used for Object instances, and the primitive types are converted directly. And in the javadocs for print(String): Print a string. *If the argument is null then the string null is printed.* -Tim Michael Molloy wrote: Thanks for the pointer. I have not investigated JSTL, and I will look into it further. Can anyone give me a link that explains the reasons behind this behaviour? Now that I'm aware that it can't be turned off, I'm very curious as to why it was coded this way. Thanks, --Michael -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 7:55 AM To: Tomcat Users List Subject: Re: Null printed in jsp getProperty fields There is no setting to turn this off. [But if you use JSTL - null get supressed for you.] -Tim Michael Molloy wrote: Hello everyone. I can't imagine that this isn't a question that has been asked a great many times, but I can't find the answer anywhere. We're using multiple tomcat 4.1.30 servers in a production environment for a commercial website, and we would like to move up to the latest stable version. However, when testing our application in tomcat 5.0+, we have noticed that jsp pages that use the jsp:getProperty / method to display session data print the word null in every field that has a null value. Although I haven't read about this, I'm guessing it is part of the Sun's application server standard. I've been told that WebLogic does the same thing, but that there is a configuration setting to repress displaying the word null. Is there such a setting for tomcat? If not, what is the best way to keep from printing null in every field that has a null value? I know we could do it through javascript, but it just seems like a change this big, after years of not having this behaviour, there must be some way to prevent it from happening at the application server level. Can someone point me in the right direction? I've googled for the answer, but any search with null and tomcat in it returns a lot of pages about unrelated problems. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat oddities
My company is in the deployment stage of a project that uses tomcat to serve information from an oracle database to about 25 people. When the app goes live, there will be about 150 people connected at any one time. Tomcat 4.1.12 is running behind Apache on Windows 2000 on a single cpu box, and Oracle is running on a separate Windows 2000 2-way box. (Windows was the client decision, not ours.) Issue One We're seeing two serious issues, the first of which happens about once a day, sometimes more. When there are several users on the system, maybe up to 15, there is a freeze during which no one can get any responses back from Tomcat. This period usually lasts from 5 to 15 minutes, after which the system returns to normal and everything zips along. We've tuned queries, so we don't think that is the problem. There may still be a rogue query out there causing problems, but we think it's unlikely. Besides, I don't know why that would stop everyone, which is what's happening. Another possibility that we've discussed is that tomcat is simply using all of the memory and everything basically stops until GC occurs. This seems the most likely to me, but I wanted to ask the group. I don't know what the page file size is, nor do we have access to the server so we can't check task manager. Can anyone think of any other possibilities? Issue Two We've had two reports where a user has had data from an old session show up in his/her current session. For example, I wrote a class that stores information from 14 different JSPs. The object is put into the user's session. In these two occasions, the user entered a new record using these screens saved the data to the database. The user took an hour lunch break, which would have been long enough to timeout (set at 20 minutes), returned, and queried a different record. Some of the data from the previous record showed up in the holder class in his/her current session and was saved to the database. Any idea what that could be? The only thing I can think of is that IE is doing some data caching mixing things up a bit. Any suggestions will be greatly appreciated. We really need to get this figured out quickly. Thanks --Michael Molloy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
One other freaky thing
Our application is running on a server in Pennsylvania. A user there was working as well as a user in Tennessee. The user in Tennessee got an error on a page, hit her back key, and the user in Pennsylvania's screen showed up on the Tennessee user's screen. The people in Tennessee are connected to the Pennsylvania system via a frame relay. Everything is contained within each user's session, so this should never happen. The application has been under development for a year now, and this has never happened before. Some kind of weird bug that we shouldn't worry about, or something that someone else has encountered? Thanks for any help, --Michael Molloy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Application slow starting up
2002-11-14 10:11:30 ContextConfig[/examples]: Configured an authenticator for method FORM 2002-11-14 10:11:30 StandardManager[/examples]: Seeding random number generator class java.security.SecureRandom 2002-11-14 10:11:30 StandardManager[/examples]: Seeding of random number generator has been completed 2002-11-14 10:11:30 ContextListener: contextInitialized() 2002-11-14 10:11:30 SessionListener: contextInitialized() 2002-11-14 10:11:30 StandardWrapper[/examples:default]: Loading container servlet default 2002-11-14 10:11:30 StandardWrapper[/examples:invoker]: Loading container servlet invoker 2002-11-14 10:11:30 HostConfig[localhost]: Deploying web application directory ROOT 2002-11-14 10:11:30 StandardHost[localhost]: Installing web application at context path from URL file:C:\VVPROD\tomcat\webapps\ROOT 2002-11-14 10:11:30 WebappLoader[]: Deploying class repositories to work directory C:\VVPROD\tomcat\work\Standalone\localhost\_ 2002-11-14 10:11:30 StandardManager[]: Seeding random number generator class java.security.SecureRandom 2002-11-14 10:11:30 StandardManager[]: Seeding of random number generator has been completed 2002-11-14 10:11:30 StandardWrapper[:default]: Loading container servlet default 2002-11-14 10:11:30 StandardWrapper[:invoker]: Loading container servlet invoker 2002-11-14 10:11:30 HostConfig[localhost]: Deploying web application directory tomcat-docs 2002-11-14 10:11:30 StandardHost[localhost]: Installing web application at context path /tomcat-docs from URL file:C:\VVPROD\tomcat\webapps\tomcat-docs 2002-11-14 10:11:30 WebappLoader[/tomcat-docs]: Deploying class repositories to work directory C:\VVPROD\tomcat\work\Standalone\localhost\tomcat-docs 2002-11-14 10:11:30 StandardManager[/tomcat-docs]: Seeding random number generator class java.security.SecureRandom 2002-11-14 10:11:30 StandardManager[/tomcat-docs]: Seeding of random number generator has been completed 2002-11-14 10:11:30 StandardWrapper[/tomcat-docs:default]: Loading container servlet default 2002-11-14 10:11:30 StandardWrapper[/tomcat-docs:invoker]: Loading container servlet invoker 2002-11-14 10:11:30 HostConfig[localhost]: Deploying web application directory webdav 2002-11-14 10:11:30 StandardHost[localhost]: Installing web application at context path /webdav from URL file:C:\VVPROD\tomcat\webapps\webdav 2002-11-14 10:11:30 WebappLoader[/webdav]: Deploying class repositories to work directory C:\VVPROD\tomcat\work\Standalone\localhost\webdav 2002-11-14 10:11:31 StandardManager[/webdav]: Seeding random number generator class java.security.SecureRandom 2002-11-14 10:11:31 StandardManager[/webdav]: Seeding of random number generator has been completed 2002-11-14 10:11:31 StandardWrapper[/webdav:default]: Loading container servlet default 2002-11-14 10:11:31 StandardWrapper[/webdav:invoker]: Loading container servlet invoker --- Michael Molloy [EMAIL PROTECTED] wrote: ATTACHMENT part 1 application/zip x-unix-mode=0644; name=Application.zip __ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting.yahoo.com -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Re: Application slow starting up
Nevermind. Turned out to be a query doing a full table scan on a table with 40,000,000 rows. Don't understand why the log doesn't show our print statements before it does, but oh well. Thanks for all suggestions. --Michael On Thursday, November 14, 2002, at 01:35 AM, Robert L Sowders wrote: [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Application slow starting up
Hey guys gals. We're using tomcat 4.1.12 on Windows connecting to an oracle database on another machine. We've got our app setup in the webapps directory, and everything works fine on our development boxes our QA box (mix of OS X, wintel, and Sun) . However, at the client site running on a Dell dual processor w/Windows 2000, the application takes about 18 minutes to start. Once it gets going, it's fine, but it takes far too long to start up. In the web.xml file, there is one servlet that uses the load-on-startup parameter with a value of 0. However, the hang happens before that servlet is initialized. I know that because I put some print statements in the init() function, and those lines do not show up in the log until after the 18 minutes of startup. Once the first one prints, the rest print as quickly as you would expect. If we remove our application from the webapps directory, tomcat starts up quickly, just as it normally does. Just to restate, this is only happening on one box. Unfortunately, it's the box at the client site. Any suggestions are appreciated. Thanks --Michael -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
To synchronize or not?
I've working on an application that will be used by 150 people concurrently. When Tomcat starts up, I've got a servlet that creates a class that contains about 800 html input tag hints. For example, when a user clicks into an input field, the hint for that field displays in the status bar of their browser. Everytime a user logs in, s/he gets a LoginBean class. This class has a reference to the HintBean class. All of the html pages have forms that include in their tags a getProperty such as the following: jsp:getProperty name=loginBean property=childFirstName / The relevant parts of LoginBean are as follows: public LoginBean(HintBeant hints) { this.hints = hints; } public String getChildFirstName() { return hints.get(childFirstName); } So, everyone has their own class with the specific getters for each text field hint, but all of those getters point to a single class (HintBean) that is in the application scope. All of the hints are stored in a HashMap inside the HintBean, so the above method just calls HashMap.get(String s) to return the hint. My question is, should I make HintBean.get(String s) synchronized? Or is there no chance that anyone will get the wrong text? And if not, why not? Thanks for any help. --Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
JSP question
I'm working on a web application that will be used by about 150 people concurrently. One of the requirements is to show text field hints in the status bar whenever the mouse passes over a text field. All of the hints are stored in the database. I need to write a class that will be available at the application level that returns some javascript along with the correct hint for whatever field the mouse is currently over. Since there are over 1000 fields in this web application, I'm looking for alternatives to writing a class with a get method for each field. What would work very well is if I could pass an argument in a getProperty call. For example, jsp:getProperty name=testBean property=hintText value=firstName / That way, I could store the values in a hashtable and just get whatever one was requested. Of course, I can't do that. I also can't set a property then immediately call get property to get the one I just requested in the set since the class is going to be shared by all users. Can anyone suggest a way to do this? I feel sure there must be a way, but I can't think of it. Thanks --Michael
Loadbalancing question--Please help if you can
This is the 2nd load balancing question I've asked of the group in the last week, and I haven't received a single response. I've looked on the web in the archives, but can't find an answer. Is anyone actually using the load balancing in 3.3a? I'm sure that there are some. My company would like to use Tomcat for a lot of future work, but I've got to get the load balancing working before we can commit to it 100%. If someone has some insight into the problem I describe below, please let me know. Maybe it's as simple as I'm testing incorrectly, but if that's the case, someone please point me in the right direction. Thanks --Michael On Monday 04 March 2002 12:16, you wrote: Been working with the loadbalancing in 3.3a, and I've *almost* got it. The last hurdle seems to be splitting the requests between 2 different computers. In my workers.properties file, I've got two workers set up, one of which is going to localhost (local) and the other (remote) to a remote machine. For localhost, I set worker.local.lbfactor=100 and the remote machine I set as worker.remote.lbfactor=1 And I set the load balancing worker as follows: worker.loadbalancer.balanced_workers=remote, local The problem is that when I bring up multiple browsers, every single one is sent to the remote machine (the default page on each machine is different). If I switch the order from remote, local to local, remote every request is sent to the local machine, and none reach the remote. When I changed the order in the balanced_workers line, I also switched the lbfactors so that the remote machine should get the majority of requests, but it doesn't get any. I'm running Tomcat 3.3a on SuSE 7.2 as my localhost and Tomcat 3.3a on Windows 2000 as my remote. Running Apache 1.3.22 on my linux box to funnel the http requests to the tomcat load balancing worker. The mod_Jk module is mod_jk-3.3-ap13-noeapi.so. Any suggestions? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Loadbalancing question
Been working with the loadbalancing in 3.3a, and I've *almost* got it. The last hurdle seems to be splitting the requests between 2 different computers. In my workers.properties file, I've got two workers set up, one of which is going to localhost (local) and the other (remote) to a remote machine. For localhost, I set worker.local.lbfactor=100 and the remote machine I set as worker.remote.lbfactor=1 And I set the load balancing worker as follows: worker.loadbalancer.balanced_workers=remote, local The problem is that when I bring up multiple browsers, every single one is sent to the remote machine (the default page on each machine is different). If I switch the order from remote, local to local, remote every request is sent to the local machine, and none reach the remote. When I changed the order in the balanced_workers line, I also switched the lbfactors so that the remote machine should get the majority of requests, but it doesn't get any. I'm running Tomcat 3.3a on SuSE 7.2 as my localhost and Tomcat 3.3a on Windows 2000 as my remote. Running Apache 1.3.22 on my linux box to funnel the http requests to the tomcat load balancing worker. The mod_Jk module is mod_jk-3.3-ap13-noeapi.so. Any suggestions? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Got some questions about load balancing in 3.3a
I've got some questions about load balancing with Tomcat 3.3a. First of all, the Tomcat-Workers-How-To that comes with 3.3a says that the workers.properties file contains working entries for an Ajp12, Ajp13, and a load balancing worker. However, it also says that the tomcat workers to be used for load balancing should not appear in the worker.list property, but they do in the default workers.properties file. Should they or should they not be in that list? Also, if I want to load balance using a remote machine, what configuration changes need to be made to the tomcat config files on that remote machine? Is it as simple as changing the remote worker port to match the port on the host machine? For example, Computer host workers.properties excerpt: worker.test.port=10001 worker.test.host=192.168.0.43 worker.test.type=ajp13 worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=ajp12, ajp13, test Computer remote (192.168.0.43) workers.properties excerpt worker.test.port=10001 worker.test.host=localhost worker.test.type=ajp13 I'm really confused at this point. I tried this the other day and couldn't get the host machine to communicate with the remote machine. Can someone offer some insight? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
How-To on load balancing?
Someone a few weeks ago posted a link to a how to on setting up load balancing with Tomcat 4.02b or something like that. I can't find the link and was wondering if that person could repost it. Thanks a lot. --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Redirect after session expires?
I've got an application that builds menus when a user logs in and sticks the menus in an object which I then put inside the session. All subsequent jsps get their menu from that object in the session. However, when their session expires and they try to access a jsp, they get a NullPointerException, as expected. How can I catch that error and redirect them to the logon page? Or is their some other way to handle it? Is there a better way than putting some if else statements in the jsp to check the session for the menu object? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Redirect after session expires?
Well, we're trying to keep as much logic out of the jsps as possible, so if there is a setting for web.xml or something to foward all pages that throw exceptions to a certain url, that's what I'm looking for. I appreciate your suggestion, and if that's what we need to do, we'll do it, but I'd like to know about any other possibilities, also. Thanks --Michael On Wed, 13 Feb 2002 15:37:53 + David Cassidy [EMAIL PROTECTED] wrote: is there a session.isInvalid() method ? If so ... :) D Michael Molloy wrote: I've got an application that builds menus when a user logs in and sticks the menus in an object which I then put inside the session. All subsequent jsps get their menu from that object in the session. However, when their session expires and they try to access a jsp, they get a NullPointerException, as expected. How can I catch that error and redirect them to the logon page? Or is their some other way to handle it? Is there a better way than putting some if else statements in the jsp to check the session for the menu object? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Redirect after session expires?
I will check it out. Thanks very much for the information. --Michael On Wed, 13 Feb 2002 10:57:09 -0600 Christopher K. St. John [EMAIL PROTECTED] wrote: Michael Molloy wrote: ... if there is a setting for web.xml or something to foward all pages that throw exceptions to a certain url, that's what I'm looking for. In web.xml: error-page exception-type MyException /exception-type location /myexception.html /location /error-page the servlet spec[1] has a complete description in section SRV.9.9.2. [1] http://java.sun.com/products/servlet/download.html -- Christopher St. John [EMAIL PROTECTED] DistribuTopia http://www.distributopia.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Free Load Testing Tool
Your best response will probably come from a search on google.com for free load testing tools --Michael On Friday 25 January 2002 11:40 am, you wrote: Hi, Can anyone please let me know some Load Testing Tools, to test a JSP application, which are there for Free. Also their reliability (if possible) as compared to Webload as 10. Thanks, Sumit. The information contained in this e-mail and any files transmitted with it may be privileged and confidential. If the reader of this message, regardless of the address or routing, is not an intended recipient, you are hereby notified that you have received this transmittal in error and any review, use, distribution, dissemination or copying is strictly prohibited. If you have received this message in error, please delete this e-mail and all files transmitted with it from your system and notify the sender by reply e-mail or by calling 1-888-338-6076. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Help giving Tomcat more memory
I'm still experiencing the memory leak with JSPs that I asked about yesterday, and I'm trying to give Tomcat more memory, but it's apparently not working. I changed the following line in tomcat.bat.:startServer from %_STARTJAVA% %TOMCAT_OPTS% -Djava.security.policy . . . to %_STARTJAVA% -Xms 256m -Xmx 384m %TOMCAT_OPTS% -Djava.security.policy . . . However, Tomcat ran out of memory around 78MB. What am I doing wrong? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Help giving Tomcat more memory
I'll give that a try. Thanks. --Michael On Thursday 24 January 2002 09:03 am, you wrote: No space and capital M works for me (i.e. -Xms256M -Xmx384M), but I'm not sure what is required. Randy -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 8:47 AM To: Tomcat Subject: Help giving Tomcat more memory I'm still experiencing the memory leak with JSPs that I asked about yesterday, and I'm trying to give Tomcat more memory, but it's apparently not working. I changed the following line in tomcat.bat.:startServer from %_STARTJAVA% %TOMCAT_OPTS% -Djava.security.policy . . . to %_STARTJAVA% -Xms 256m -Xmx 384m %TOMCAT_OPTS% -Djava.security.policy . . . However, Tomcat ran out of memory around 78MB. What am I doing wrong? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Help giving Tomcat more memory
Okay, I tried Randy's suggestion below, no spaces and a capital M, but the application still ran out of memory around 79 megs (Windows 2000 Server). I'm fiddling around with a simple java program on my linux box trying to figure this out. My main method is public static void main(String args[]) { while(true); } I then start the program with java -Xms145M -Xmx160M test If I understand this correctly, the initial heap size should be 145 megs. However, looking at my processes, there is only about 7200K allocated for the program. Why doesn't it start out at 145? That is the same behaviour I'm seeing on the Win2K machine with Tomcat. It ignores the initial heap size I'm specifying and starts around 16MB, and then dies around 78. Am I misunderstanding how the -Xms and -Xmx flags work? Thanks --Michael On Thursday 24 January 2002 08:57 am, you wrote: I'll give that a try. Thanks. --Michael On Thursday 24 January 2002 09:03 am, you wrote: No space and capital M works for me (i.e. -Xms256M -Xmx384M), but I'm not sure what is required. Randy -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 8:47 AM To: Tomcat Subject: Help giving Tomcat more memory I'm still experiencing the memory leak with JSPs that I asked about yesterday, and I'm trying to give Tomcat more memory, but it's apparently not working. I changed the following line in tomcat.bat.:startServer from %_STARTJAVA% %TOMCAT_OPTS% -Djava.security.policy . . . to %_STARTJAVA% -Xms 256m -Xmx 384m %TOMCAT_OPTS% -Djava.security.policy . . . However, Tomcat ran out of memory around 78MB. What am I doing wrong? Thanks --Michael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Pooling database connections: best practices?
Also DbConnectionPool at www.javaexchange.com. Don't know about the one mentioned below, but the one at JavaExchange is free. Working very well for me. --Michael On Thursday 24 January 2002 10:56 am, you wrote: just use a 3rd party component. check out the www.bitmechanic.com JDBC-Pool. have a nice day -reynir -Original Message- From: Sean LeBlanc [mailto:[EMAIL PROTECTED]] Sent: 24. janĂșar 2002 16:00 To: [EMAIL PROTECTED] Subject: Pooling database connections: best practices? I'm just wondering what kind of best practices are recommended for pooling database connections - with Tomcat and perhaps JSP/Servlets in general. Thanks, Sean LeBlanc -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Serious memory leak w/JSP pages?
Hi Philip. Thanks for the tip. I *think* my problem was caused by using JMeter as my testing tool. While it seems to work very well for stress testing, I didn't see any way to tell it to respond with the session id, therefore Tomcat was creating a new session with each request. I believe that was causing my out of memory errors. I'm currently testing 200 threads with another tool that tracks sessions, and Tomcat is holding steady around 32 megs for about 2.5 hours now, much longer than I got with JMeter. Thanks --Michael On Thursday 24 January 2002 01:41 pm, you wrote: I experienced something similar using java build 1.3.1_b24. The symptoms were messages like: Exception in thread CompileThread0 java.lang.OutOfMemoryError: requested 268,435,468 bytes. This seems to be caused by a bug in the hotspot optimizer where it is optimizing loops by rolling them out and allocating ungodly amount of memory. This happens after a period of time because the hotspot optimizer is not invoked until a certain number of invocations of a method (~1). See bug# 4490177. This has supposedly been fixed in the 1.3.1_02 version of the java VM. I am still running 1.3.1_b24 until I move up to 1.4.x. My work around until then is to run the VM with hotspot compilation turned off using the -Xint option. java -Xint Perhaps this is helpful. --- Philip Smith desk: 916.854.7021 [EMAIL PROTECTED] -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 7:49 AM To: [EMAIL PROTECTED] Subject: Serious memory leak w/JSP pages? Testing Tomcat 3.3a on Mandrake 8.1 with Sun JDK 1.3.1_02. 450 MHz Celeron w/192 MB RAM. Tried the same test with 4.0.1 with the same results. There appears to be a memory leak when calling JSPs. For example, I start Tomcat standalone and use JMeter on a different machine to create 50 threads calling a JSP that simply prints out some environment information. After about 45 minutes, Tomcat runs out of memory stops accepting connections. A servlet that uses a PrintWriter to print the same information out to the calling browser can run indefinitely with no appreciable increase in memory consumption. I have had the same result with other servlets JSPs as well, and on Windows 2000 Server, also. Does anyone have any suggestions for fixing this? Setting a page directive with session=false seems to prevent the memory leak, but we need to use sessions in our application. I wonder if I'm missing something. I tried the identical JSP under Resin, and it ran for hours without any increase in memory. If Tomcat can't serve JSPs for an hour under a moderate load without running out of memory, that seems to be a pretty big issue. Again, I hope I've missed something important that will fix this. --Michael __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Serious memory leak w/JSP pages?
I'm currently using Microsoft's free tool, Web Application Stress Tool. Free and it seems to be working pretty well. It requires NT or 2000, so if you don't have either of those, a search at Google.com will give you a pretty big list of open source unix/linux ones. I downloaded several different ones at home last night that didn't require Windows. Good luck, --Michael On Thursday 24 January 2002 02:51 pm, you wrote: Hi Micheal, could you tell which Tool. Regards -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 13:50 To: Tomcat Users List Subject: Re: Serious memory leak w/JSP pages? Hi Philip. Thanks for the tip. I *think* my problem was caused by using JMeter as my testing tool. While it seems to work very well for stress testing, I didn't see any way to tell it to respond with the session id, therefore Tomcat was creating a new session with each request. I believe that was causing my out of memory errors. I'm currently testing 200 threads with another tool that tracks sessions, and Tomcat is holding steady around 32 megs for about 2.5 hours now, much longer than I got with JMeter. Thanks --Michael On Thursday 24 January 2002 01:41 pm, you wrote: I experienced something similar using java build 1.3.1_b24. The symptoms were messages like: Exception in thread CompileThread0 java.lang.OutOfMemoryError: requested 268,435,468 bytes. This seems to be caused by a bug in the hotspot optimizer where it is optimizing loops by rolling them out and allocating ungodly amount of memory. This happens after a period of time because the hotspot optimizer is not invoked until a certain number of invocations of a method (~1). See bug# 4490177. This has supposedly been fixed in the 1.3.1_02 version of the java VM. I am still running 1.3.1_b24 until I move up to 1.4.x. My work around until then is to run the VM with hotspot compilation turned off using the -Xint option. java -Xint Perhaps this is helpful. --- Philip Smith desk: 916.854.7021 [EMAIL PROTECTED] -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 7:49 AM To: [EMAIL PROTECTED] Subject: Serious memory leak w/JSP pages? Testing Tomcat 3.3a on Mandrake 8.1 with Sun JDK 1.3.1_02. 450 MHz Celeron w/192 MB RAM. Tried the same test with 4.0.1 with the same results. There appears to be a memory leak when calling JSPs. For example, I start Tomcat standalone and use JMeter on a different machine to create 50 threads calling a JSP that simply prints out some environment information. After about 45 minutes, Tomcat runs out of memory stops accepting connections. A servlet that uses a PrintWriter to print the same information out to the calling browser can run indefinitely with no appreciable increase in memory consumption. I have had the same result with other servlets JSPs as well, and on Windows 2000 Server, also. Does anyone have any suggestions for fixing this? Setting a page directive with session=false seems to prevent the memory leak, but we need to use sessions in our application. I wonder if I'm missing something. I tried the identical JSP under Resin, and it ran for hours without any increase in memory. If Tomcat can't serve JSPs for an hour under a moderate load without running out of memory, that seems to be a pretty big issue. Again, I hope I've missed something important that will fix this. --Michael __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: How to prevent a .jsp from being accessed directly?
Bob, I thought I had tried all combinations, but I apparently I had tried them all except the right one. Thanks for your help. --Michael -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 30, 2001 4:50 PM To: [EMAIL PROTECTED] Subject: RE: How to prevent a .jsp from being accessed directly? Don't include the www in your url-pattern rather if you directory structure is Tomcat | -- webapps | -- mywebapp | -- jsps selectroster.jsp another.jsp another2.jsp you would include url-pattern/jsps/selectroster.jsp/url-pattern What version of tomcat are you using? What is your environment? Bob -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 30, 2001 4:44 PM To: [EMAIL PROTECTED] Subject: RE: How to prevent a .jsp from being accessed directly? I've tried several variations, from your suggestion below to including the entire url (www. . . .). I'll take another look at it. Thanks --Michael -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 30, 2001 4:29 PM To: [EMAIL PROTECTED] Subject: RE: How to prevent a .jsp from being accessed directly? You may want to try setting the url pattern relative to the root i.e. url-pattern/dir1/subdir1/selectroster.jsp/url-pattern Bob -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Monday, January 29, 2001 7:41 PM To: Tomcat Subject: How to prevent a .jsp from being accessed directly? I'm using the following web.xml file inside a servlet context (/opt/tomcat/webapps/staging/WEB-INF/web.xml). However, it's not preventing direct access to the jsp file, which is what I'm hoping to achieve. I got this from the O'Reilly Javaserver Pages book, but it's not working. Any suggestions? Thanks --Michael web-app servlet servlet-nameRosterServlet/servlet-name servlet-classRosterServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameRosterServlet/servlet-name url-pattern/process/url-pattern /servlet-mapping security-constraint web-resource-collection web-resource-nameno-access/web-resource-name url-patternselectroster.jsp/url-pattern /web-resource-collection auth-constraint role-namenobody/role-name /auth-constraint /security-constraint /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
How to prevent a .jsp from being accessed directly?
Since no one responded, does that mean there's nothing wrong with the xml below? It's still not working. Any suggestions would be welcome. --Michael -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Monday, January 29, 2001 7:41 PM To: Tomcat Subject: How to prevent a .jsp from being accessed directly? I'm using the following web.xml file inside a servlet context (/opt/tomcat/webapps/staging/WEB-INF/web.xml). However, it's not preventing direct access to the jsp file, which is what I'm hoping to achieve. I got this from the O'Reilly Javaserver Pages book, but it's not working. Any suggestions? Thanks --Michael web-app servlet servlet-nameRosterServlet/servlet-name servlet-classRosterServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameRosterServlet/servlet-name url-pattern/process/url-pattern /servlet-mapping security-constraint web-resource-collection web-resource-nameno-access/web-resource-name url-patternselectroster.jsp/url-pattern /web-resource-collection auth-constraint role-namenobody/role-name /auth-constraint /security-constraint /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: How to prevent a .jsp from being accessed directly?
I've tried several variations, from your suggestion below to including the entire url (www. . . .). I'll take another look at it. Thanks --Michael -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 30, 2001 4:29 PM To: [EMAIL PROTECTED] Subject: RE: How to prevent a .jsp from being accessed directly? You may want to try setting the url pattern relative to the root i.e. url-pattern/dir1/subdir1/selectroster.jsp/url-pattern Bob -Original Message- From: Michael Molloy [mailto:[EMAIL PROTECTED]] Sent: Monday, January 29, 2001 7:41 PM To: Tomcat Subject: How to prevent a .jsp from being accessed directly? I'm using the following web.xml file inside a servlet context (/opt/tomcat/webapps/staging/WEB-INF/web.xml). However, it's not preventing direct access to the jsp file, which is what I'm hoping to achieve. I got this from the O'Reilly Javaserver Pages book, but it's not working. Any suggestions? Thanks --Michael web-app servlet servlet-nameRosterServlet/servlet-name servlet-classRosterServlet/servlet-class load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameRosterServlet/servlet-name url-pattern/process/url-pattern /servlet-mapping security-constraint web-resource-collection web-resource-nameno-access/web-resource-name url-patternselectroster.jsp/url-pattern /web-resource-collection auth-constraint role-namenobody/role-name /auth-constraint /security-constraint /web-app - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]