Getting Apache JBoss/Tomcat working.
Hello All, I am currently trying to get apache to talk to JBoss/Tomcat. Basically My Apache server is on the internet and the JBoss/Tomcat (application) server is behind a firewall. I'm trying to use the Apache Tomcat connector (mod_jk). However I can't seem to get things working. If anyone could point me to some examples, I would appreciate it. Here are some errors from my log 's. [error] jk_ajp_common.c (1851): can't resolve tomcat address localhost [error] jk_ajp_common.c (1854): invalid host and port machinename 8009 [error] jk_worker.c (158): validate failed for Corporate [error] jk_worker.c (256): failed to create worker Corporate What's this really mean? Thanks for any thought's and or suggestions. V/R Brian __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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]
mod_jk.so
Hello All, I'm looking for some insite into the mod_jk. We have an apache web server on the outside, a firewall and jboss on the inside (windows machines). I'm trying to configure mod_jk , however it's begining to look fruitless(sorry, just been trying this for a few days). Anyway, mod_jk loads just fine, according to my logs. (As I don't get any errors) However I can't access the war files on the JBoss machine. Does anyone have detailed instructions you could point me too, or even a tool/utility I can use to help me figure out what it is I'm missing? Thanks for any help. Brian __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: mod_jk.so
Yes as a matter of fact. However I started modifying the instead of getting the sample working first. After re-reading and re-doing much, I now get an error message in my browser, that permission is denied. I feel closer, but am lost as to this error. Any Ideas? Thanks, B --- Martin Gainty [EMAIL PROTECTED] wrote: did you setup your workers.properties? http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss M- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: Brian [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 20, 2006 1:31 PM Subject: mod_jk.so Hello All, I'm looking for some insite into the mod_jk. We have an apache web server on the outside, a firewall and jboss on the inside (windows machines). I'm trying to configure mod_jk , however it's begining to look fruitless(sorry, just been trying this for a few days). Anyway, mod_jk loads just fine, according to my logs. (As I don't get any errors) However I can't access the war files on the JBoss machine. Does anyone have detailed instructions you could point me too, or even a tool/utility I can use to help me figure out what it is I'm missing? Thanks for any help. Brian __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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]
Mod_jk
Hello all, Ok, I've gotten the mod_jk to work internally. But, What I want to do is have an apache box forward request through a firewall to a jboss application box, then have jboss return through the firewall to the apache box. How do I accomplish this? Thanks for any thought's. Brian __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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]
mod_jk port issue
I'm using mod_jk. I currently have it working in a dev environment. Apache Web server --- jboss application server. I need to move to Production: Apache -- [FireWall] -- jboss When I first tried this everything failed. We opened port 8009 on the FW to allow incoming traffic and outgoing traffic. However when we return from jboss, the traffic is on anything but the 8009 port. How do I configure the returning traffic? Any help would be appreciated. Thanks, Brian __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: mod_jk port issue
Thanks David, So are you suggesting that the something weird is on the Jboss configuration side? Thanks, B --- David Rees [EMAIL PROTECTED] wrote: On 9/25/06, Brian [EMAIL PROTECTED] wrote: I'm using mod_jk. I currently have it working in a dev environment. Apache Web server --- jboss application server. I need to move to Production: Apache -- [FireWall] -- jboss When I first tried this everything failed. We opened port 8009 on the FW to allow incoming traffic and outgoing traffic. However when we return from jboss, the traffic is on anything but the 8009 port. How do I configure the returning traffic? The returning traffic comes back on the same socket as the request was made on. Normally with a firewall you only need to define a rule to allow the mod_jk Apache - jboss traffic on whatever mod_jk port you have configured. If it's not working, there's something else weird going on as the firewall was blocking the return traffic you wouldn't be able to establish a socket connection at all. -Dave - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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]
In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
Hi, First of all, I'm using Tomcat 6.0.29 (the latest as of September 2010), Struts and other technologies not relevant here. My website runs fine 99% of the time, but several times per day I get an error in my Tomcat Log, so it is an sporadic issue. I don't know the reason. My code is separated in model/view/controller, given that I'm using Struts, so my code has been correctly separated in layers. This error happens in several JSP pages. As far as I can understand, Tomcat generates a Java class (a servlet) for every JSP (well, everybody know that I guess). When my problem arrises, an exception is being thrown when the corresponding generated servlet tries to run the _jspService() method that uses a lot of out.write() methods to send the output to the response. An exception is being thrown for some reason, and then my log gets the error trace. Anybody knows what is going on? What does response has been commited mean? I have a theory: Maybe it means that in the java code that the container generated for my JSP, at least one out.write() method has already been used, which means that It already has started to send html code to the browser. Am I right? Again, this is a sporadic issue, which drives me crazy! This is the error in the log: --- Sep 21, 2010 3:18:42 PM org.apache.jasper.runtime.JspFactoryImpl internalGetPageContext SEVERE: Exception initializing page context java.lang.IllegalStateException: Cannot create a session after the response has been committed Which session is my code creating? where? Why is this sporadic? at org.apache.catalina.connector.Request.doGetSession(Request.java:2377) at org.apache.catalina.connector.Request.getSession(Request.java:2097) at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:83 3) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr apper.java:216) at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRe quest.java:547) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr apper.java:216) at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRe quest.java:547) at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWr apper.java:216) at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRe quest.java:547) at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRe quest.java:493) at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:1 46) at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:12 4) at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryIm pl.java:107) at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java: 63) at org.apache.jsp.WEB_002dINF.pages.utility.Error_jsp._jspService(Error_jsp.jav a:49) -- This is the JSP page where all my JSP pages redirect when something goes wrong at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 77) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:646) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch er.java:551) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher .java:488) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:9 68) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:621) at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:820) at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:791) at org.apache.jsp.WEB_002dINF.pages.ProductsForModel_jsp._jspService(ProductsFo rModel_jsp.java:1137) --- In this case, the problem happened in my page ProductsForModel.jsp at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 77) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
RE: In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
Wow. This is what I call Premium Support! I was thinking about writing en email to you, Mark, since I was studying the Tomcat source code and saw your name there. But thought it would be too direct to write to you. I'm honored to receive your response, really :-) Thanks for the commited explanation, but I still have a doubt: Where in my code do I commit? I don't do it explicitly, so it is happening at some point automatically but I don't know exactly where/when. If a full buffer is not the cause, what is it for the commit to happen? In which method/class does it happen? I will raise the 8K capacity in the buffer, just in case that is the problem. That would explain why this problem appears to be randomic. If just some pages are too big, that would make the buffer to be full, and then everything in the sequence you described would happen. I don't explicitly disable the session creation in my JSPs, so that is not the problem. I don't call any flushing method either. I still have another doubt: According to your sequence, in step 2 my page is commited (Maybe because of a full buffer, maybe any other reason I don't imagine). OK. But in step 3 (something goes wrong), I guess you are talking about these two lines in my log: at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:791) - This takes care of that at org.apache.jsp.WEB_002dINF.pages.ProductsForModel_jsp._jspService(ProductsFo rModel_jsp.java:1137) Here something goes wrong, and an Exception is being thrown It is clear that something goes wrong in my ProductsForModel.jps page (actually, in the java code generated for it), so an Exception is being thrown and PageContextImpl.handlePageException() takes care of it. But what exception? Is it the java.lang.IllegalStateException: Cannot create a session after the response has been committed? Or is it another one? I guess it is another one, and that the cannot create... exception is being thrown after that, when executing the service method in the java code that correspoonds to the JSP error page to which I redirect. But how can I know what exception raised in my ProductsForModel.jps page? It seems that since the code in the JSP error page didnt work (because of its own exception), it didn't do its job: to explain what went wrong in the ProductsForModel.jps page. Thanks a lot! -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Thursday, September 23, 2010 01:11 PM To: Tomcat Users List Subject: Re: In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed On 23/09/2010 07:42, Brian wrote: What does response has been commited mean? I have a theory: Maybe it means that in the java code that the container generated for my JSP, at least one out.write() method has already been used, which means that It already has started to send html code to the browser. Am I right? Again, this is a sporadic issue, which drives me crazy! committed means that the HTTP headers have been written to the client and no further headers can be sent (note: creating a session requires sending a cookie header to the client - this will be important in a bit). Output is buffered (I think 8k by default - might be 4k) by default so you can still add headers even after some content has been written. JSPs create sessions by default unless you explicitly disable this. I suspect the sequence is: 1. Your page starts processing 2. The page is committed (either it calls flush or the output fills the buffer so it has to flush) 3. Something goes wrong 4. Redirect to error JSP 5. Error JSP tries to create a session 6. Response has been committed so session can't be created 7. You get the error you are seeing If step 3 occurs before step 2 then everything will work as the response won't have been committed. 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
Why an email list, and not a forum?
Hi, Just a thought: Why is this support taking place in an email list, instead aof a web based forum?
RE: Why an email list, and not a forum?
But what if you just want to receive responses to your question, instead of receiving all the emails that is being writen? Mail lists are an old method. Web based forums are more efficient. And even forums (such are the ones powered by phpBB) are not the latest solution. -Original Message- From: michel [mailto:compu...@videotron.ca] Sent: Thursday, September 23, 2010 07:27 PM To: Tomcat Users List Subject: Re: Why an email list, and not a forum? web based means that people have to keep checking a website, instead of having the information sent to them as it happens ... like having pizza home delivered. Michel - Original Message - From: Brian bbprefix-m...@yahoo.com To: users@tomcat.apache.org Sent: Thursday, September 23, 2010 8:19 PM Subject: Why an email list, and not a forum? Hi, Just a thought: Why is this support taking place in an email list, instead aof a web based forum? - 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: In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
On 23/09/2010 12:01, Brian wrote: Thanks for the commited explanation, but I still have a doubt: Where in my code do I commit? I don't do it explicitly, so it is happening at some point automatically but I don't know exactly where/when. If a full buffer is not the cause, what is it for the commit to happen? In which method/class does it happen? As soon as the buffer is full or you flush the response. OK, thanks. I will increase the buffer to 16k, maybe then to 32K, and so on until I see that the problem is gone. I will raise the 8K capacity in the buffer, just in case that is the problem. That would explain why this problem appears to be randomic. If just some pages are too big, that would make the buffer to be full, and then everything in the sequence you described would happen. I don't explicitly disable the session creation in my JSPs, so that is not the problem. I don't call any flushing method either. You need to explicitly disable session generation in your error JSP. That will ensure the sequence never happens. Now that is an very interesting idea! I didn't think of that (as if I thought about everything else, he he). I will add a directive so that error page won't use sessions. Then I will compare the container-generated java code to the one using sessions, to see what am I missing. I guess I'm not missing anything, unless I use the session in my code in that page. It is clear that something goes wrong in my ProductsForModel.jps page (actually, in the java code generated for it), so an Exception is being thrown and PageContextImpl.handlePageException() takes care of it. But what exception? Is it the java.lang.IllegalStateException: Cannot create a session after the response has been committed? Or is it another one? Yep, the broken error JSP is hiding the exception. Another option is to remove the error handling JSPs. But If I remove the JSP than handles the errors (I mean, if I take out the directive that declares that page in the other pages), how will I know if something goes wrong in my pages? Correct me if I'm wrong, but I think that only the user will see the error in his browser, but the log will not be populated with the information of what went wrong. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Why an email list, and not a forum?
Yes, but I still think that forums are better, a more modern way to give and ask for support. If I have time to see other people's questions, I can go to the forum and read the postings (and answer them, if I can), it is very easy. And I also learn reading other people's questions. I enjoy that. But when I'm busy in other issues, I don't like when my emails gets full of entries. I just think web-based is better than email-based. -Original Message- From: michel [mailto:compu...@videotron.ca] Sent: Thursday, September 23, 2010 07:54 PM To: Tomcat Users List Subject: Re: Why an email list, and not a forum? I like that questions that I never though of asking can arrive in my email and I can see some great new-to-me topics and I try to answer when I can (not often, but I do try to help because I am so grateful when people help me out). - Original Message - From: Hassan Schroeder hassan.schroe...@gmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, September 23, 2010 8:39 PM Subject: Re: Why an email list, and not a forum? On Thu, Sep 23, 2010 at 5:33 PM, Brian bbprefix-m...@yahoo.com wrote: But what if you just want to receive responses to your question, instead of receiving all the emails that is being writen? Or to put it another way -- what if you only want to be a taker, without any intention of participating in a community of users and giving back when you can? I'm sure there's a name for that. Mail lists are an old method. Web based forums are more efficient. And even forums (such are the ones powered by phpBB) are not the latest solution. What *is* the latest solution*, then, in your opinion? -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
Hi Mark, I applied your advice. I added a directive to my error page, so it wont create a session variable, and therefore won't try to create a session if it does exist (%@ page session=false%). Well, IT WORKED! I got rid of the java.lang.IllegalStateException: Cannot create a session after the response has been committed exception, which I have seen in my log for months or maybe years! Now the previous thing that went wrong is able to show its details in the log. What is that? A Struts tag that tries to output the content of a bean that is not present even though it should (this is the Struts tag: bean:write name=TEXT-NoteNoShippingFees/). That bean should always be present, because it is created in the previous Struts action. How can it be missing SOMETIMES, if it is not the only bean that is being created in the previous action, and others of these beans that are created in the action are present in the page? I guess it has something to do with the buffer that gets full sometimes, or am I wrong? What do you think? In fact, I have had LOTs of problems with beans that dissappear even though they should be present because they were created in the previous actions. I have been dealing with these randomic problem for YEARS, and I applied just a patch for that (If the bean is not present, redirect to the home page instead of showing an error message and dumping a trace in the log). That was just a workaround, and not a clean solution. I will try now to use a buffer with 16K, to see if that will solve this. Brian -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Thursday, September 23, 2010 02:51 PM To: Tomcat Users List Subject: Re: In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed On 23/09/2010 12:01, Brian wrote: Thanks for the commited explanation, but I still have a doubt: Where in my code do I commit? I don't do it explicitly, so it is happening at some point automatically but I don't know exactly where/when. If a full buffer is not the cause, what is it for the commit to happen? In which method/class does it happen? As soon as the buffer is full or you flush the response. I will raise the 8K capacity in the buffer, just in case that is the problem. That would explain why this problem appears to be randomic. If just some pages are too big, that would make the buffer to be full, and then everything in the sequence you described would happen. I don't explicitly disable the session creation in my JSPs, so that is not the problem. I don't call any flushing method either. You need to explicitly disable session generation in your error JSP. That will ensure the sequence never happens. It is clear that something goes wrong in my ProductsForModel.jps page (actually, in the java code generated for it), so an Exception is being thrown and PageContextImpl.handlePageException() takes care of it. But what exception? Is it the java.lang.IllegalStateException: Cannot create a session after the response has been committed? Or is it another one? Yep, the broken error JSP is hiding the exception. Another option is to remove the error handling JSPs. 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
RE: Why an email list, and not a forum?
At least someone thinks the same way I do! From: m.h.g.emme...@dnb.nl [mailto:m.h.g.emme...@dnb.nl] Sent: Friday, September 24, 2010 12:48 AM To: Tomcat Users List Subject: Re: Why an email list, and not a forum? I agree. A forum would be more practical. It is much easier reading all postings on a topic. I find myself clearing my tomcat users list inbox every morning, while on forums I visit I check out the new or updated topics. The forums these days let you subscribe to topics or complete forums and send you a notification when a new topic gets started or updated. regards, Milko Brian bbprefix-m...@yahoo.com 24-09-2010 02:19 Please respond to Tomcat Users List users@tomcat.apache.org To users@tomcat.apache.org cc Subject Why an email list, and not a forum? Hi, Just a thought: Why is this support taking place in an email list, instead aof a web based forum? Please consider the environment before printing this email. De informatie verzonden met dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Indien u als niet-geadresseerde dit bericht ontvangt, wordt u verzocht direct de afzender hierover te informeren en het bericht te vernietigen. Gebruik van informatie door onbevoegden, openbaarmaking of vermenigvuldiging is verboden en kan leiden tot aansprakelijkheid. De afzender is niet aansprakelijk in geval van onjuiste overbrenging van het e-mailbericht en/of bij ontijdige ontvangst daarvan. The information transmitted is confidential and intended only for the person or entity to whom or which it is addressed. If you are not the intended recipient of this communication, please inform us immediately and destroy this communication. Unauthorised use, disclosure or copying of information is strictly prohibited and may entail liability. The sender accepts no liability for improper transmission of this communication nor for any delay in its receipt.
RE: [OT] In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
Hi Christoper, -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, September 24, 2010 08:44 AM To: Tomcat Users List Subject: Re: [OT] In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 9/24/2010 2:22 AM, Brian wrote: Well, IT WORKED! Excellent. Now the previous thing that went wrong is able to show its details in the log. What is that? A Struts tag that tries to output the content of a bean that is not present even though it should (this is the Struts tag: bean:write name=TEXT-NoteNoShippingFees/). How is the bean declared in the page? Or, is it declared in one page and used in another? The previous Struts actions places it in the session object. That bean should always be present, because it is created in the previous Struts action. Where is it stored? Remember that there are 4 scopes (in increasing order of specificity): application, session, request, and page. If your page is looking in request scope, but the bean is in the session, it won't be found. Or, alternatively, if you store a bean in the request and issue a redirect, then the bean has likely been discarded. It is stored in the session, just because I wanted to avoid the problems that happen when you redirect. That means that the bean will consume memory while the session is alive (instead of just for the time the request or response is alive), but memory is not a big issue here. That makes me think that the buffer full, then flushed is maybe the reason why the bean dissappears somehow. I have increased the buffer from 8k to 64k, and I will keep an eye on the log to see if it still happens. How can it be missing SOMETIMES, if it is not the only bean that is being created in the previous action, and others of these beans that are created in the action are present in the page? I guess it has something to do with the buffer that gets full sometimes, or am I wrong? What do you think? You'll have to give us more details. Note that this is not a Struts forum, though many of us (including myself) have Struts experience and would be glad to help. Technically, you ought to start a new thread since you're asking about a new subject (this helps people find answers to their questions when searching the archives). You are right. If the problem still exists, I will seach for a solution in another source dedicated to Struts. This is no more related to Tomcat directly. In fact, I have had LOTs of problems with beans that dissappear even though they should be present because they were created in the previous actions. I have been dealing with these randomic problem for YEARS, and I applied just a patch for that (If the bean is not present, redirect to the home page instead of showing an error message and dumping a trace in the log). That was just a workaround, and not a clean solution. I will try now to use a buffer with 16K, to see if that will solve this. Could you also be experiencing session timeouts that aren't properly handled? Does your application use any kind of authentication and authorization? If not, you could easily be seeing visitors with expired sessions accessing actions that expect the session to be in a certain state. The sessions expire if 2 hours have passed, and if that happens, the system forwards them to another page. I mean, in my programming I already considered what should happen if the session suddenly expired, and it should not arrive to this point. Thanks! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
Hi Wesley, -Original Message- From: Wesley Acheson [mailto:wesley.ache...@gmail.com] Sent: Friday, September 24, 2010 10:44 AM To: Tomcat Users List Subject: Re: [OT] In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed On Fri, Sep 24, 2010 at 5:29 PM, Brian bbprefix-m...@yahoo.com wrote: Hi Christoper, The sessions expire if 2 hours have passed, and if that happens, the system forwards them to another page. I mean, in my programming I already considered what should happen if the session suddenly expired, and it should not arrive to this point. Thanks! You can't be sure that's whats happening though. The browser can make its own rules with session cookies. Unlikely but possible for the cookies to be deleted sometimes. Some people may not accept session cookies in the first place. That is interesting. I think I need to study that subject... Oh, regarding people not accepting cookies: Struts then mantains a jsessionid in the URL. Are you encoding the urls for sessions too? Where's the bean being set in an Interceptor, in a filter, on an earlier page in the session? Is it possible that you've missed a route to the pages which should always have this bean? I use Struts. All my URLs are actions (.do). So for all of them, a java code is executed, whish creates the bean and stores it in the session. Is it possible that people are directly navigating to the page that throws the error (say via a bookmark, or got a cached search engine result)? I already considered that in my programming, years ago. If they do, it doesn matter. The actions still execute given that they access a .do and not a .jsp, and the bean gets created immediately before, before the JSP is sent to the response. And if other beans that should be present (because they should have been created, if they followed a regular path of actions in my site) are not present, the client is redirected to the home page. That certainly happens a lot, given that my site gets thousands of request from the crawlers such as GoogleBot! And they do whatever they want, certainly. My advise would be (assuming you have an access log enabled that contains the session id). Look at the access log. Try to figure out the route the person took through your site. How long between page views? Was there some detail that they entered in the bean which was unserialiasble etc. GOOD IDEA! I will do it! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat Consultant
This company LOOKS like specialists: http://www.mulesoft.com/tomcat-support -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, September 24, 2010 12:58 PM To: Tomcat Users List Subject: Re: Tomcat Consultant -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 9/24/2010 1:25 PM, tdelesio wrote: My fortune 500 company is testing a pilot for switching over a J2EE web app over from Web Sphere application server to Tomcat and we are looking for a consultant to setup a crusted production instance of tomcat. Wait... are you testing it? If so, then you don't need anyone to set it up, do you? By crusted, did you mean trusted? Does anyone have any recommendations for a top notch consulting firm that could provide these services? I'm sure that any of the big-5 consulting companies would be very happy to take way more money than is necessary to set up an instance of Tomcat for you. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyc5o4ACgkQ9CaO5/Lv0PAjugCgiACwh5crjW+HXMKbzAWc+ A27 dC4AoJjm6Dgs7FbMPrD3VBBdZl48VXas =vADj -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: [OT] In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed
Well... I must say that it looks like you are really an expert! I need to check again my app in order to be able to respond all your questions. I started it 5 years ago, so there are a lot of details that I programmed long time ago, and once they seemed to work fine, I gradually forgot about them. But... for now, it SEEMS that the dissapearing beans issue is not happening anymore. However, it takes more time to be sure. Maybe I have been like lucky, and they will happen anytime soon. At least the can't create session if response has been commited has been solved totally. That is great!!! -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, September 24, 2010 12:11 PM To: Tomcat Users List Subject: Re: [OT] In org.apache.catalina.connector.Request.doGetSession, java.lang.IllegalStateException: Cannot create a session after the response has been committed -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 9/24/2010 11:29 AM, Brian wrote: -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, September 24, 2010 08:44 AM Where is it stored? Remember that there are 4 scopes (in increasing order of specificity): application, session, request, and page. If your page is looking in request scope, but the bean is in the session, it won't be found. Or, alternatively, if you store a bean in the request and issue a redirect, then the bean has likely been discarded. It is stored in the session, just because I wanted to avoid the problems that happen when you redirect. Are you sure that the user is hanging-on to the session? If the client doesn't support cookies, are you properly issuing a redirect? (If you use Struts's ActionForward with redirect=true in S1 or if you use a result type=redirect in S2 then you should be okay). That makes me think that the buffer full, then flushed is maybe the reason why the bean dissappears somehow. Very unlikely: the bean is put into the session far earlier than the error occurs, and the session shouldn't be damaged by anything like what you describe. Could you also be experiencing session timeouts that aren't properly handled? Does your application use any kind of authentication and authorization? If not, you could easily be seeing visitors with expired sessions accessing actions that expect the session to be in a certain state. The sessions expire if 2 hours have passed, and if that happens, the system forwards them to another page. How is that done? Not the forward... the detection of session expiration. I mean, in my programming I already considered what should happen if the session suddenly expired, and it should not arrive to this point. But it might end up there anyway :) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyc25YACgkQ9CaO5/Lv0PC81gCgo/rUKOR7kbFCpShpxaKDfb 65 a6IAmwfqbITWH7w54XGfc2mtVj3/RZHH =tD97 -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: Tomcat Consultant
-Original Message- From: Jorge Medina [mailto:cerebrotecnolog...@gmail.com] Sent: Friday, September 24, 2010 02:43 PM To: Tomcat Users List Subject: Re: Tomcat Consultant Hey, you don't need a Big-5 consulting company. Esto si que sonó gracioso. Aca en Peru, Arthur Andersen (QEPD) tenia a unos 3 socios, uno de los cuales se llamaba JORGE MEDINA. :-D You need a a couple of experts: a networking guy and a Tomcat guy. But anyway, I'm sure a Fortune 500 have the money to overpay one of the Big-5. Now, from my understanding, Tomcat is only a web app container while Websphere is an application server. Therefore, depending on your application you may not be able to migrate it to Tomcat, but rather to Glassfish. Glassfish is also an application server. -Jorge On Fri, Sep 24, 2010 at 1:57 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 9/24/2010 1:25 PM, tdelesio wrote: My fortune 500 company is testing a pilot for switching over a J2EE web app over from Web Sphere application server to Tomcat and we are looking for a consultant to setup a crusted production instance of tomcat. Wait... are you testing it? If so, then you don't need anyone to set it up, do you? By crusted, did you mean trusted? Does anyone have any recommendations for a top notch consulting firm that could provide these services? I'm sure that any of the big-5 consulting companies would be very happy to take way more money than is necessary to set up an instance of Tomcat for you. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyc5o4ACgkQ9CaO5/Lv0PAjugCgiACwh5crjW+HXMKbzAWc+ A27 dC4AoJjm6Dgs7FbMPrD3VBBdZl48VXas =vADj -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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat Consultant
That is true sometimes. I was hired by Arthur Andersen (RIP), they sent me to an SAP crash-course, the tipe of course that shows you zillions of Powerpoint slides and you get out of the course with tons of doubts. Then they sent me directly to a proyect, and I bet they billed a lot for my time. I was introduced as an experienced SAP consultant. -Original Message- From: michel [mailto:compu...@videotron.ca] Sent: Friday, September 24, 2010 07:35 PM To: Tomcat Users List Subject: Re: Tomcat Consultant I once worked for a consulting company that wasn't a big 5, but had some pretty good contact. They hired me out of Montreal on Friday, had me in Denver on Sunday and spending 2 weeks in a training center so I could become an instant 'expert' they could hire out for big $$$ on different projects. Then I spent 3 months at home while they tried to get some contacts, and then got canned when they couldn't, then the guys who hired me got canned ... I can't figure out how these companies can get away with this nonsense. - Original Message - From: Martin Gainty mgai...@hotmail.com To: Tomcat Users List users@tomcat.apache.org Sent: Friday, September 24, 2010 8:13 PM Subject: RE: Tomcat Consultant triple your budget when the big 5 consultant steps out a lamberghini in a 1000 brooks brothers suit add 25% to the rate if he looks younger than zuckerberg BTW: big 5 consultants only speak english or hindi..you'll need a hindi translator for spanish how about unisys??? Saludos Cordiales desde EEUU Martin Gainty __ No altere ni interrumpa por favor esta transmisión. Gracias Date: Fri, 24 Sep 2010 15:55:28 -0400 Subject: Re: Tomcat Consultant From: cerebrotecnolog...@gmail.com To: users@tomcat.apache.org I should have copyrights on my name. LOL On Fri, Sep 24, 2010 at 3:49 PM, Brian bbprefix-m...@yahoo.com wrote: -Original Message- From: Jorge Medina [mailto:cerebrotecnolog...@gmail.com] Sent: Friday, September 24, 2010 02:43 PM To: Tomcat Users List Subject: Re: Tomcat Consultant Hey, you don't need a Big-5 consulting company. Esto si que sonó gracioso. Aca en Peru, Arthur Andersen (QEPD) tenia a unos 3 socios, uno de los cuales se llamaba JORGE MEDINA. :-D You need a a couple of experts: a networking guy and a Tomcat guy. But anyway, I'm sure a Fortune 500 have the money to overpay one of the Big-5. Now, from my understanding, Tomcat is only a web app container while Websphere is an application server. Therefore, depending on your application you may not be able to migrate it to Tomcat, but rather to Glassfish. Glassfish is also an application server. -Jorge On Fri, Sep 24, 2010 at 1:57 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 To whom it may concern, On 9/24/2010 1:25 PM, tdelesio wrote: My fortune 500 company is testing a pilot for switching over a J2EE web app over from Web Sphere application server to Tomcat and we are looking for a consultant to setup a crusted production instance of tomcat. Wait... are you testing it? If so, then you don't need anyone to set it up, do you? By crusted, did you mean trusted? Does anyone have any recommendations for a top notch consulting firm that could provide these services? I'm sure that any of the big-5 consulting companies would be very happy to take way more money than is necessary to set up an instance of Tomcat for you. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyc5o4ACgkQ9CaO5/Lv0PAjugCgiACwh5crjW+HXMKbzAWc+ A27 dC4AoJjm6Dgs7FbMPrD3VBBdZl48VXas =vADj -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 - 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 - To unsubscribe, e-mail: users-unsubscr
JSESSIONID weakness Severity in Tomcat 6.0.29?
Hi, I'm using Tomcat 6.0.29. In my site, I'm using a security certificate from http://www.securitymetrics.com www.securitymetrics.com, which has been invalidated today argumenting the following reason: Description: JRun JSESSIONID weakness Severity: Potential Problem CVE: CVE-2004-1478 http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2004-1478 CVE-2004-2182 http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2004-2182 Impact: Several vulnerabilities in JRun server could allow an intruder to view arbitrary files, execute arbitrary code, or list directories on the server. Background: JRun is a Java application server from Macromedia. It runs on both Unix and Windows NT/2000 systems, and can act as a standalone server or connect with Apache, IIS or Netscape web servers. ColdFusion is a web application development Solution which can run with or without a web application server. Resolution For JRun 2.3.3, apply the patches referenced in Macromedia Product Security Bulletins [http://www.adobe.com/devnet/security/se curity_zone/asb00-28.html http://www.adobe.com/devnet/security/security_zone/asb00-28.html ] 00-28 and [http://www.adobe.com/devnet/security/se curity_zone/asb00-29.html http://www.adobe.com/devnet/security/security_zone/asb00-29.html ] 00-29. For JRun 3.0 and 3.1, install the cumulative patch referenced in Macromedia Product Security Bulletin [http://www.adobe.com/devnet/security/se curity_zone/mpsb04-08.html http://www.adobe.com/devnet/security/security_zone/mpsb04-08.html ] 04-08. For JRun 4.0, install the cumulative patch referenced in Macromedia Product Security Bulletin [http://www.adobe.com/devnet/security/se curity_zone/mpsb05-13.html http://www.adobe.com/devnet/security/security_zone/mpsb05-13.html ] 05-13 and the patches in Adobe Product Security Bulletin [http://www.adobe.com/support/security/b ulletins/apsb07-05.html http://www.adobe.com/support/security/bulletins/apsb07-05.html ] 07-05 and [http://www.adobe.com/support/security/b ulletins/apsb09-12.html http://www.adobe.com/support/security/bulletins/apsb09-12.html ] 09-12. For ColdFusion MX 6.0 and 6.1, install the patch referenced in Macromedia Product Security Bulletin [http://www.adobe.com/devnet/security/se curity_zone/mpsb04-09.html http://www.adobe.com/devnet/security/security_zone/mpsb04-09.html ] 04-09 and the patch in Adobe Product Security Bulletin [http://www.adobe.com/support/security/b ulletins/apsb07-05.html http://www.adobe.com/support/security/bulletins/apsb07-05.html ] 07-05. Bulletins can be found in the [http://www.adobe.com/support/security/ ] Macromedia Security Zone. Vulnerability Details: Service: http [More] I'm not using Jrun, but I guess the vulnerability applies also to Tomcat 6.0.29 so they treated me as if I was using Jrun with that vulnerability. Does anybody know what should I do to solve this now? I guess they are talking about this issue (please read issue # 2): http://www.developer.com/java/web/article.php/3904871/Top-7-Features-in-Tomc at-7-The-New-and-the-Improved.htm Brian
RE: JSESSIONID weakness Severity in Tomcat 6.0.29?
Hi Mark, Do you understand exactly what vulnerability are they talking about? For some reason, they have determined that I have it, even though I'm not using Jrun but they wrongly assume I am. What do you mean exactly with app managing its own authentication? Sorry if it is a dumb question. I found this on Google, and now that I read it I realize they are quoting you! :-) http://www.developer.com/java/web/article.php/3904871/Top-7-Features-in-Tomc at-7-The-New-and-the-Improved.htm Is this the same subject? Thanks a lot for your response! -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Sunday, October 10, 2010 02:46 PM To: Tomcat Users List Subject: Re: JSESSIONID weakness Severity in Tomcat 6.0.29? On 10/10/2010 20:32, Brian wrote: I'm not using Jrun, but I guess the vulnerability applies also to Tomcat 6.0.29 so they treated me as if I was using Jrun with that vulnerability. That guess has no basis in fact. Does anybody know what should I do to solve this now? There is nothing to fix unless you are running an app that is vulnerable (possible if the app manages its own authentication). If you are, fix your app. I guess they are talking about this issue (please read issue # 2): http://www.developer.com/java/web/article.php/3904871/Top-7-Features-i n-Tomcat-7-The-New-and-the-Improved.htm Did you look at the Tomcat 6.0.x change log? Go read the entries for 6.0.21. 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
RE: JSESSIONID weakness Severity in Tomcat 6.0.29?
Mark, I'm not using either basic or form. I developed my own solution, which works great for me. Assuming that the session fixation is my problem, what would you suggest me to do? Is there any web page on the internet that explains the issue? -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Sunday, October 10, 2010 03:09 PM To: Tomcat Users List Subject: Re: JSESSIONID weakness Severity in Tomcat 6.0.29? On 10/10/2010 20:59, Brian wrote: Hi Mark, Do you understand exactly what vulnerability are they talking about? No. It doesn't make much sense to me at the minute. I'd ask for more specific information. For some reason, they have determined that I have it, even though I'm not using Jrun but they wrongly assume I am. Looks like it so far. It all depends how they are detecting the vulnerability. It could be a false positive but there isn't enough information to tell. What do you mean exactly with app managing its own authentication? Sorry if it is a dumb question. If you use Tomcat's authentication (BASIC, FORM, etc) then Tomcat will change the session ID on authentication and therefore protect against session fixation. If the app has its own authentication mechanism it is possible that the session ID will not be changed on authentication creating the possibility for a session fixation attack. I found this on Google, and now that I read it I realize they are quoting you! :-) http://www.developer.com/java/web/article.php/3904871/Top-7-Features-i n-Tomc at-7-The-New-and-the-Improved.htm Is this the same subject? Yep, although that is looking at Tomcat 7. The session fixation protection (along with a handle of other things originally developed for Tomcat 7) got back-ported to Tomcat 6. 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
RE: JSESSIONID weakness Severity in Tomcat 6.0.29?
I must say you are right :-( But I will solve it! :-) -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Sunday, October 10, 2010 06:44 PM To: Tomcat Users List Subject: RE: JSESSIONID weakness Severity in Tomcat 6.0.29? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: JSESSIONID weakness Severity in Tomcat 6.0.29? I'm not using either basic or form. I developed my own solution, which works great for me. Apparently not, or you wouldn't have gotten the bad security review. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: JSESSIONID weakness Severity in Tomcat 6.0.29?
Thanks! It was as easy as Googling the subject, but I didn't know what was exactly the name of it. -Original Message- From: Ken Bowen [mailto:kbo...@als.com] Sent: Sunday, October 10, 2010 05:52 PM To: Tomcat Users List Subject: Re: JSESSIONID weakness Severity in Tomcat 6.0.29? Google session fixation -- http://en.wikipedia.org/wiki/Session_fixation On Oct 10, 2010, at 6:24 PM, Brian wrote: Mark, I'm not using either basic or form. I developed my own solution, which works great for me. Assuming that the session fixation is my problem, what would you suggest me to do? Is there any web page on the internet that explains the issue? -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Sunday, October 10, 2010 03:09 PM To: Tomcat Users List Subject: Re: JSESSIONID weakness Severity in Tomcat 6.0.29? On 10/10/2010 20:59, Brian wrote: Hi Mark, Do you understand exactly what vulnerability are they talking about? No. It doesn't make much sense to me at the minute. I'd ask for more specific information. For some reason, they have determined that I have it, even though I'm not using Jrun but they wrongly assume I am. Looks like it so far. It all depends how they are detecting the vulnerability. It could be a false positive but there isn't enough information to tell. What do you mean exactly with app managing its own authentication? Sorry if it is a dumb question. If you use Tomcat's authentication (BASIC, FORM, etc) then Tomcat will change the session ID on authentication and therefore protect against session fixation. If the app has its own authentication mechanism it is possible that the session ID will not be changed on authentication creating the possibility for a session fixation attack. I found this on Google, and now that I read it I realize they are quoting you! :-) http://www.developer.com/java/web/article.php/3904871/Top-7- Features -i n-Tomc at-7-The-New-and-the-Improved.htm Is this the same subject? Yep, although that is looking at Tomcat 7. The session fixation protection (along with a handle of other things originally developed for Tomcat 7) got back-ported to Tomcat 6. 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 - 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: JSESSIONID weakness Severity in Tomcat 6.0.29?
To be honest with you, I was not familiar with the options available in the container itself. I am still not familiar indeed. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Sunday, October 10, 2010 07:41 PM To: Tomcat Users List Subject: RE: JSESSIONID weakness Severity in Tomcat 6.0.29? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: JSESSIONID weakness Severity in Tomcat 6.0.29? It was as easy as Googling the subject, but I didn't know what was exactly the name of it. More seriously: is there a particular reason you chose to roll your own security mechanism, rather than using a proven, container-managed one? - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: JSESSIONID weakness Severity in Tomcat 6.0.29?
Hi Mark, Well, it seems that www.securitymetrics.com got crazy! They already told me that they made some changes in their system, and now they are having problems (bugs). I was just asking myself: How can their automatized procedure know if I am vulnerable to the session fixation problem, if it doesnt know a valid user+password, so it is not being able to actually login to my system? Anyway, something good came from this: I realized that actually my system was not safe to session fixation. After the login process, it was not invalidating the session and creating a new one. Now it is. I just had to program the system to save the attributes, invalidadte the current session, create a new one, and recreate the attributes. Fortunately, Tomcat generates a new session ID for the new session. It seems that it was not happening in the previous versions of Tomcat and in other containers (according to what I have read in some forums), but now it is. Thanks for all your help! -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Sunday, October 10, 2010 03:09 PM To: Tomcat Users List Subject: Re: JSESSIONID weakness Severity in Tomcat 6.0.29? On 10/10/2010 20:59, Brian wrote: Hi Mark, Do you understand exactly what vulnerability are they talking about? No. It doesn't make much sense to me at the minute. I'd ask for more specific information. For some reason, they have determined that I have it, even though I'm not using Jrun but they wrongly assume I am. Looks like it so far. It all depends how they are detecting the vulnerability. It could be a false positive but there isn't enough information to tell. What do you mean exactly with app managing its own authentication? Sorry if it is a dumb question. If you use Tomcat's authentication (BASIC, FORM, etc) then Tomcat will change the session ID on authentication and therefore protect against session fixation. If the app has its own authentication mechanism it is possible that the session ID will not be changed on authentication creating the possibility for a session fixation attack. I found this on Google, and now that I read it I realize they are quoting you! :-) http://www.developer.com/java/web/article.php/3904871/Top-7-Features-i n-Tomc at-7-The-New-and-the-Improved.htm Is this the same subject? Yep, although that is looking at Tomcat 7. The session fixation protection (along with a handle of other things originally developed for Tomcat 7) got back-ported to Tomcat 6. 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
Tomcat 6.0.29 using more and more RAM until it collapses?
Hi, In my Linux machine, I'm using the JVM version 1.6.0_11-b03. On top of that, I only run Tomcat 6.0.29. On that Tomcat installation, I'm running a couple of sites, both of them use exactly the same code, actually it is the same WAR. So they are two apps, but we could consider them as one. The problem is that the RAM usage in the server starts to grow day by day, until Tomcat stops (freezes? hungs?) and my two sites stop working. According to the OS (Linux), it is the Tomcat process that is taking up all that amount of RAM. When I restart Tomcat, it starts fine again, but starts to grow in memory usage day by day again, until it crashes. I don't think my app is taking all this RAM, because when I restart it, the RAM usage doesn't go down. It does only if I restart Tomcat itself, instead of my app running there. It seems like if Tomcat is leaving garbage in the JVM or something like that. According to the Tomcat manager application, in the server status page, the JVM total memory value grows all the time. In this very moment, for example, it says this: Free memory: 178.94 MB Total memory: 565.58 MB Max memory: 692.25 MB. The total memory value is the one that starts growing when Tomcat starts. Does anybody know what should I do to solve this? Thanks!
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Ben, I'm using Apache Commons DBCP (http://commons.apache.org/dbcp/) and I think I'm using it properly. After I perform a SQL sentence, I close the objects (result set, then its statement). I also check what is going on in my DBMS (MySQL), and it shows a normal amount of connections. -Original Message- From: Ben Souther [mailto:b...@souther.us] Sent: Thursday, November 11, 2010 02:06 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? The most common cause of this, that I've seen is the failure to properly close all database connections. If you're using the container managed connection pooling, it is possible that restart your app won't free the ram consumed by any orphaned connections. Without seeing everthing you're doing everything else would be a guess. -Ben On Thu, 2010-11-11 at 13:54 -0500, Brian wrote: Hi, In my Linux machine, I'm using the JVM version 1.6.0_11-b03. On top of that, I only run Tomcat 6.0.29. On that Tomcat installation, I'm running a couple of sites, both of them use exactly the same code, actually it is the same WAR. So they are two apps, but we could consider them as one. The problem is that the RAM usage in the server starts to grow day by day, until Tomcat stops (freezes? hungs?) and my two sites stop working. According to the OS (Linux), it is the Tomcat process that is taking up all that amount of RAM. When I restart Tomcat, it starts fine again, but starts to grow in memory usage day by day again, until it crashes. I don't think my app is taking all this RAM, because when I restart it, the RAM usage doesn't go down. It does only if I restart Tomcat itself, instead of my app running there. It seems like if Tomcat is leaving garbage in the JVM or something like that. According to the Tomcat manager application, in the server status page, the JVM total memory value grows all the time. In this very moment, for example, it says this: Free memory: 178.94 MB Total memory: 565.58 MB Max memory: 692.25 MB. The total memory value is the one that starts growing when Tomcat starts. Does anybody know what should I do to solve this? Thanks! - 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: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Chuck, Yes, in a Finally block. This is what I do: void closeRsStmt(ResultSet resultSet) { //Close the connection, so it goes back to the pool Statement stmt=null; Connection conn=null; try { if (resultSet!=null ) { stmt = resultSet.getStatement(); resultSet.close(); } } catch (SQLException ex) { } try { if (stmt!=null ) { conn=stmt.getConnection(); stmt.close(); } } catch (SQLException ex) { } try { if (conn!=null) { conn.close(); } } catch (SQLException ex) { } resultSet = null; stmt = null; conn = null; } -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Thursday, November 11, 2010 02:32 PM To: Tomcat Users List Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? After I perform a SQL sentence, I close the objects (result set, then its statement). In a finally block? If not, you'll leave them open when an exception occurs. - 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: mailto:users-unsubscr...@tomcat.apache.org users-unsubscr...@tomcat.apache.org For additional commands, e-mail: mailto:users-h...@tomcat.apache.org users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
-Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thursday, November 11, 2010 02:39 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 11/11/2010 2:26 PM, Brian wrote: I'm using it properly. After I perform a SQL sentence, I close the objects (result set, then its statement). http://blog.christopherschultz.net/index.php/2009/03/16/properly-handling- pooled-jdbc-connections/ I will read this link, thanks!! I also check what is going on in my DBMS (MySQL), and it shows a normal amount of connections. Good. That's unlikely to be the problem, then. That is what I think too. I see, on average, about 30-40 connections in MySQL using its Workbench tool. And that looks fine, that corresponds to the way I configured the pool. But I must say that I hadn't always used the pool. In the past I used to use just one connection, and in many methods I had forgot to close the resultset. You can imagine how much my app crashed! I couldn't even sleep at night! Then I fixed my app so it closes every result set it created, then the statement, and then close the connection so it goes back to the pool. Since that day, my app stopped crashing that often. Now it still crashes, but less often. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
-Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Thursday, November 11, 2010 02:55 PM To: Tomcat Users List Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? Yes, in a Finally block. This is what I do: I presume you mean you call your closeRsStmt() method in a finally block, since there certainly aren't any finally clauses in what you published. Oh, yes, I forgot to clarify that. I call that method (that I showed in my last email) from the finally block that is present after all my pieces of code that use SQL. Your mechanism is a bit suspect, since closing any outer components depends on the retrieval of the outer from an inner. If that fails for any reason, you've left things active. You know what? You are right! I will check my logic again. Maybe I should start putting some messages in the log, inside the catch blocks that are empty. Maybe you are right, and those pieces of code are failing, but my catch block doesn't do anything about it, not even leaving something in the log. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Thanks for the link. I will read it asap. -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, November 11, 2010 03:01 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 11/11/2010 19:55, Caldarale, Charles R wrote: From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? Yes, in a Finally block. This is what I do: I presume you mean you call your closeRsStmt() method in a finally block, since there certainly aren't any finally clauses in what you published. Your mechanism is a bit suspect +1 Erm, yes. This would be better: http://marc.info/?l=tomcat-userm=128937911023178w=2 p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
It seems that it is my app the source of the problem. I guess I was in denial. :-( I haven't ever heard of Jconsole before, but I will install it ASAP and do what you adviced me. Thanks a lot! -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, November 11, 2010 03:06 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 11/11/2010 18:54, Brian wrote: I don't think my app is taking all this RAM, because when I restart it, the RAM usage doesn't go down. It does only if I restart Tomcat itself, instead of my app running there. Yes, this is a classic sign of a problem with the app. Reboot Tomcat, restart your app a couple of times (this bit is important). Connect to the Tomcat instance using JConsole, navigate the MBeans, to Catalina Hosts (your hostname), then select the Operations tab, under which you'll see a button called findReloadContextMemoryLeaks. Push the button. It will return a list of app names if Tomcat can detect ones with memory leaks. NB No results doesn't necessarily mean your app isn't leaking. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Pid, I did it, but shows no results. Anyway, it was nice to learn about Jconsole. Now I wonder what is the tool I could use to inspect the objets inside my app, and see which ones are using all the memory. -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, November 11, 2010 03:06 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 11/11/2010 18:54, Brian wrote: I don't think my app is taking all this RAM, because when I restart it, the RAM usage doesn't go down. It does only if I restart Tomcat itself, instead of my app running there. Yes, this is a classic sign of a problem with the app. Reboot Tomcat, restart your app a couple of times (this bit is important). Connect to the Tomcat instance using JConsole, navigate the MBeans, to Catalina Hosts (your hostname), then select the Operations tab, under which you'll see a button called findReloadContextMemoryLeaks. Push the button. It will return a list of app names if Tomcat can detect ones with memory leaks. NB No results doesn't necessarily mean your app isn't leaking. p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Great advice, thanks I'm using it right now, and I'm also using www.yourkit.com as a trial. My problem is in the Tenured/Gen area. There is where most of the RAM is getting used. Now I need to fin out what Tenured/Gen is about -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Friday, November 12, 2010 03:49 AM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 12/11/2010 05:54, Brian wrote: Hi Pid, I did it, but shows no results. Anyway, it was nice to learn about Jconsole. Now I wonder what is the tool I could use to inspect the objets inside my app, and see which ones are using all the memory. Try VisualVM, another JDK6 tool, but a more recent version is available: http://visualvm.dev.java.net/ There are extra plugins available from the Tools menu. You can use profiling on local JVM processes to see which classes are using memory, CPU time. Or take a series of heap dump and import, examine them. p -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Thursday, November 11, 2010 03:06 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 11/11/2010 18:54, Brian wrote: I don't think my app is taking all this RAM, because when I restart it, the RAM usage doesn't go down. It does only if I restart Tomcat itself, instead of my app running there. Yes, this is a classic sign of a problem with the app. Reboot Tomcat, restart your app a couple of times (this bit is important). Connect to the Tomcat instance using JConsole, navigate the MBeans, to Catalina Hosts (your hostname), then select the Operations tab, under which you'll see a button called findReloadContextMemoryLeaks. Push the button. It will return a list of app names if Tomcat can detect ones with memory leaks. NB No results doesn't necessarily mean your app isn't leaking. p - 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: Tomcat 6.0.29 using more and more RAM until it collapses?
I found the problem and this time it wasn't my fault! :-) I used a profiler (www.yourkit.com) and took a snapshot of all the objects in the JVM. I found that tons of RAM is being used by images of my delivered http responses. I mean, I have thousands of static HTML pages in my site. It seems that Tomcat is saving their content in the memory, as a cache, in thousands of objects. That was the hardest part, to find out that. Now I wonder where do I configure Tomcat to stop doing this, or at least to reduce the cache. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Thursday, November 11, 2010 02:11 PM To: Tomcat Users List Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: Tomcat 6.0.29 using more and more RAM until it collapses? I don't think my app is taking all this RAM It is. when I restart it, the RAM usage doesn't go down. Classic symptom of a webapp leaking memory due to holding onto It seems like if Tomcat is leaving garbage in the JVM or something like that. Nope - it's your webapp. Does anybody know what should I do to solve this? Fix your webapp(s). Start with a heap profiler, and look to see what's consuming the space. The problem may also include memory leaks outside of the heap, such as failing to close files, or starting and forgetting about auxiliary threads. Start reading here: http://wiki.apache.org/tomcat/FAQ/Memory http://wiki.apache.org/tomcat/OutOfMemory http://wiki.apache.org/tomcat/MemoryLeakProtection - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Mark, Besides using Tomcat to serve my app (which itself serves about 600,000 diferent URLs), I also use it to serve static pages (HTML pages stored in the hard disk). I don't know if Tomcat is caching my dinamically generated pages (maybe it is), but for now I would love to stop the cache that stores the static ones. Those static pages are in their own WARs, so they have nothing to do with the java code in my app. Where do I configure Tomcat to stop caching the static pages in memory? This is definitely my problem, I can see clearly the pages in my memory snapshot, and when I let Google crawl my site with more speed, my site (and Tomcat itself, I guess) crashes sooner. -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, November 12, 2010 01:19 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 12/11/2010 18:13, Brian wrote: I found the problem and this time it wasn't my fault! :-) I wouldn't be so sure about that just yet. I used a profiler (www.yourkit.com) and took a snapshot of all the objects in the JVM. I found that tons of RAM is being used by images of my delivered http responses. I mean, I have thousands of static HTML pages in my site. It seems that Tomcat is saving their content in the memory, as a cache, in thousands of objects. Tomcat's static content cache is 10MB per web application by default. I suspect something else is holding on to those references. Where to the GC roots trace to? That was the hardest part, to find out that. Now I wonder where do I configure Tomcat to stop doing this, or at least to reduce the cache. You need to confirm what is holding on to those references first. 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
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Well, maybe you can help me to make an interpretation. I'm using Yourkit, and this this what I see. The most RAM is used by byte arrays. If I choose this entry in the list of classes, below you will see a list of objects. If you choose the first one and check the content (400kb), it is the image of a static HTML page. I really don't know how to find out to which classes do these bytes belong to, or their relationship with the garbage collector, but I can see that they use a lot of RAM. -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, November 12, 2010 01:38 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 12/11/2010 18:30, Brian wrote: Hi Mark, Besides using Tomcat to serve my app (which itself serves about 600,000 diferent URLs), I also use it to serve static pages (HTML pages stored in the hard disk). I don't know if Tomcat is caching my dinamically generated pages (maybe it is), but for now I would love to stop the cache that stores the static ones. Those static pages are in their own WARs, so they have nothing to do with the java code in my app. Where do I configure Tomcat to stop caching the static pages in memory? This is definitely my problem, I can see clearly the pages in my memory snapshot, and when I let Google crawl my site with more speed, my site (and Tomcat itself, I guess) crashes sooner. You are missing the point. It is highly unlikely the 10MB per webapp cache is causing problems given that you previously states that there are only two WAR files here. So I'll ask my question again: Where to the GC roots for those objects trace to? Mark - To unsubscribe, e-mail: mailto:users-unsubscr...@tomcat.apache.org users-unsubscr...@tomcat.apache.org For additional commands, e-mail: mailto:users-h...@tomcat.apache.org users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Oh, I think I found what you were asking, the path to the GC root: org.apache.naming.resources.FileDirContext$FileResource org.apache.naming.resources.CacheEntry org.apache.naming.resources.CacheEntry[XXX] org.apache.naming.resources.ResourceCache org.apache.naming.resources.ProxyDirContext etc etc etc -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, November 12, 2010 01:38 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 12/11/2010 18:30, Brian wrote: Hi Mark, Besides using Tomcat to serve my app (which itself serves about 600,000 diferent URLs), I also use it to serve static pages (HTML pages stored in the hard disk). I don't know if Tomcat is caching my dinamically generated pages (maybe it is), but for now I would love to stop the cache that stores the static ones. Those static pages are in their own WARs, so they have nothing to do with the java code in my app. Where do I configure Tomcat to stop caching the static pages in memory? This is definitely my problem, I can see clearly the pages in my memory snapshot, and when I let Google crawl my site with more speed, my site (and Tomcat itself, I guess) crashes sooner. You are missing the point. It is highly unlikely the 10MB per webapp cache is causing problems given that you previously states that there are only two WAR files here. So I'll ask my question again: Where to the GC roots for those objects trace to? 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
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Byte[401494] = {10,10,10,10,.} This contains the whole 400KB HTML code binaryContent oforg.apache.naming.resources.FileDirContext$FileResource resource of org.apache.naming.resources.CacheEntry [2]of org.apache.naming.resources.CacheEntry[6] Cache oforg.apache.naming.resources.ResourceCache Cache of org.apache.naming.resources.ProxyDirContext Value of java.util.Hashtable$Entry [20]ofjava.util.Hashtable$Entry[47] Table of java.util.Hashtable clBindings oforg.apache.naming.resources.DirContextURLStreamHandler [275 of java.lang.Object[640] elementData of java.util.Vector classes of org.apache.catalina.loader.StandardClassLoader contextClassLoader of java.lang.Thread [Stack Local, Thread] http-8080-52 native ID: xx -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, November 12, 2010 02:21 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 11/12/2010 2:12 PM, Brian wrote: Oh, I think I found what you were asking, the path to the GC root: org.apache.naming.resources.FileDirContext$FileResource org.apache.naming.resources.CacheEntry org.apache.naming.resources.CacheEntry[XXX] org.apache.naming.resources.ResourceCache org.apache.naming.resources.ProxyDirContext etc etc etc That etc. is important information. Keep going. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkzdk40ACgkQ9CaO5/Lv0PCbeQCgvQIBv7AHHN4kuQMiZaN17h pu oSoAnRK4VoH++sZS4/13dqLQmUXO95ki =Ev1I -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: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Chris, I saved your email and hadn't replied yet. Here are my responses, thanks! -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thursday, November 11, 2010 02:39 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? Brian, On 11/11/2010 1:54 PM, Brian wrote: I don't think my app is taking all this RAM, because when I restart it, the RAM usage doesn't go down. That doesn't necessarily mean that your webapp isn't using all that heap space: it's very easy for a webapp to do something foolish and cause all of it's used memory to stay active even after a webapp restart. Yes, now I know that. I disagree with Ben's comment about database connections: there are faster ways to bust your heap than leaking database connections. If you /are/ using Tomcat's container-managed DataSource (which I highly recommend), you should enable all of the abandoned resource tracking features to help fix any resource leaks that you may have there. Well, the database relation with my code is not the problem, I'm using a pool and it works great. I don’t know for what else should I use the DataSource. I agree with Chuck's assessment, but there may be some questions we can ask to help lead you down the right path when using tools such as memory profilers. 0. What kind of OOME are you suffering? Please post any messages that you get when your heap busts. Specifically, is this a regular heap exhaustion or a PermGen exhaustion? Good question, but I can't answer that. I think I lost my logs. :-( I will search for them again. But I could use the profiler now and responde whatever you would like to ask about how is it behaving now. 1. Are you seeing any messages in catalina.out when you undeploy of the form your webapp likely has a memory leak? Tomcat 6.0.x has some nice checks on undeploy to see if your webapp is leaking some specific things like threads, etc. Yeah, I have seen those lately. 2. Are you re-starting your webapp a lot while Tomcat remains running? Failure to perform some clean-up during webapp unload can cause your entire set of classes loaded in the old webapp to stay in the PermGen space forever. No, I don’t restart them frequently. But I do redeploy them frequently, in the past I did it deleting the WAR in the directly and uploading a new one, now I'm suing the Tmocat Manager do undeploy and deploy again. 3. Are you using any caching mechanism in your webapp? Perhaps it needs to be tuned. You should probably check out what's in your application scope: you may have things you didn't expect. I do have some caches in my objects. For example, the ir an object called BrandsManager which has methods like getBrands(), getBrand(int id), insertBrand and so on. The getBrands() method goes to the database only the first time, and then creates a LinkedList with the data. But I don't think this kind of caching is the problem, they consume a minimal amount of memory. 4. Are you using HttpSession for anything bulky? It's possible that you are leaking memory with lots of sessions. When a webapp is stopped, though, all session should be purged and if you have session persistence, they should all come back and take up the same amount of memory. This is a long-shot, but low-hanging fruit. No, I don’t store anything big in the sessions. I just store some strings in them. Nothing serious. How do I know if I have session persistence? You can get a lot of mileage out of a tool like jmap which comes with the JDK (and JRE?): you can get a heap histogram and look at things that are taking up a lot of space. If you find that you have several tens of megabytes of foo.bar.Baz classes, then you can look at your app to see where you heavy uses of those classes are. I'm already using yourkit, which I guess is even better. To understand #2 a bit better, see Mark's presentation from this year's ApacheCon NA: http://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks- 60mins.pdf I will now!! It's worth a read to understand how simple things like using a logging library can cause PermGen exhaustion after several webapp redeploy operations. Well, I'm using the Tomcat log indeed. And I also saw a lot of memory being used by that! But more memory is being used by the cached static pages, so I guess I should start with that. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Ok, I will do that now! I have taken another snapshot of the JVM a few minutes ago. Now I also see that 160MB are being used by org.apache.jasper.runtime.BodyContextImpl. This contains images of my DYNAMIC pages! This is the path: Org.apache.jasper.runtime.BodyContentIml [1] of org.apache.jasper.runtime.BodyContentImpl[2] Outs of org.apache.jasper.runtime.PageContextImpl [0] of javax.servlet.jsp.PageContext[8] Pool of org.apache.jasper.runtime.JspFactoryImpl$PageContextPool Value of java.lang.ThreadLocal$ThreadLocalMap$Entry [8] of java.lang.ThreadLocal$ThreadLocalMap$Entry[16] Table of java.lang.ThreadLocal$ThreadLocalMap threadLocals of java.lang.Thread [Stack Local, Thread] http-8080-18 native ID: XX -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, November 12, 2010 02:19 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 12/11/2010 19:12, Brian wrote: Oh, I think I found what you were asking, the path to the GC root: org.apache.naming.resources.FileDirContext$FileResource org.apache.naming.resources.CacheEntry org.apache.naming.resources.CacheEntry[XXX] org.apache.naming.resources.ResourceCache org.apache.naming.resources.ProxyDirContext etc etc etc OK, that is indeed Tomcat's static file cache. Given you only have two WARs and the default cache size is 10MB per WAR I am struggling to see how this could be causing an OOME. Anyway, the settings for this are on the Context element. The simplest way to disable static file caching everywhere is to add the following to the Context element in CATALINA_BASE/conf/context.xml cachingAllowed=false 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
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Chris, I will answer everything here: - In my Heap Memory, the Eden Space is barely used (10MB right now). The survivor space is even less used (1MB right now). But the Tenured Gen space has 120MB right now! In fact, when my JVM start to eat houndreds of MB, most of that goes to the Tenured Gen. Why is that? I would like to know. The perm gen is using 22MB right now, which is not a lot so I guess it is normal. - From now on, when I stop an application, I will check if that left a memory leak. I guess I can do that with the new buton on the Tmcat Manager. - I suspect what is the problem when I stop my app: It is a website, so about 30 humans on average are making requests at any time, and the crawlers (specially Googlebot) are doing it as well. Maybe if I stop it when a request was coming, that makes the licking because maybe some class loaders are doing somethin while I'm asking to stop the app. What do you think about this? - I will check the WebappClassLoader issue, thanks for the tip. -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, November 12, 2010 03:44 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 11/12/2010 3:02 PM, Brian wrote: -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thursday, November 11, 2010 02:39 PM I agree with Chuck's assessment, but there may be some questions we can ask to help lead you down the right path when using tools such as memory profilers. 0. What kind of OOME are you suffering? Please post any messages that you get when your heap busts. Specifically, is this a regular heap exhaustion or a PermGen exhaustion? Good question, but I can't answer that. I think I lost my logs. :-( I will search for them again. But I could use the profiler now and responde whatever you would like to ask about how is it behaving now. I think you already answered this elsewhere: you're filling-up your Tenured generation and/or PermGen. Keep an eye on PermGen: if it's filling up after your 60 URLs (that's a /lot/ IMO) have all been hit, then you might have a redeployment problem. 1. Are you seeing any messages in catalina.out when you undeploy of the form your webapp likely has a memory leak? Tomcat 6.0.x has some nice checks on undeploy to see if your webapp is leaking some specific things like threads, etc. Yeah, I have seen those lately. Read them, and try to fix them. ;) 2. Are you re-starting your webapp a lot while Tomcat remains running? Failure to perform some clean-up during webapp unload can cause your entire set of classes loaded in the old webapp to stay in the PermGen space forever. No, I don t restart them frequently. But I do redeploy them frequently, in the past I did it deleting the WAR in the directly and uploading a new one, now I'm suing the Tmocat Manager do undeploy and deploy again. Semantics. You are stopping your webapp and starting it again, with or without an update to the WAR file. It's actually the ungraceful webapp stop that kills you, not the fact that you start up again or whether it's a restart or a redeploy. If your webapp doesn't clean-up, the WebappClassLoader can stay in memory forever. In fact, that's a good test: search your memory snapshot for instances of WebappClassLoader. There's a boolean in each one (active I think) that tells you if it's active. Force a couple of full GCs, then see how many of them are still around. If you have more than 1+webapp count (I think you get one for free plus one for each webapp deployed) then the old, undeployed webapps are still sitting around in memory. If that's the case, then you are filling-up your PermGen with useless java.lang.Class instances. I'm not sure how Tomcat expires it's caches, but it might also be keeping those cached static files around with the WebappClassLoader, too. Double whammy. 3. Are you using any caching mechanism in your webapp? Perhaps it needs to be tuned. You should probably check out what's in your application scope: you may have things you didn't expect. I do have some caches in my objects. For example, the ir an object called BrandsManager which has methods like getBrands(), getBrand(int id), insertBrand and so on. The getBrands() method goes to the database only the first time, and then creates a LinkedList with the data. But I don't think this kind of caching is the problem, they consume a minimal amount of memory. It's always a good idea to double-check. 4. Are you using HttpSession for anything bulky? It's possible that you are leaking memory with lots of sessions. When a webapp is stopped, though, all session should be purged and if you have session persistence
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Mark, Chris, and all the gurus, I haven't applied this change yet, but something good is happening: Right now, my Tomcat installation is running fine! So given that I havent made any changes to my code, I guess my problem is that sometimes when I stop my website, something goes wrong and not al the resources get liberated. I had noticed some warnings about that indeed. So I guess my problem was not the static/dynamic pages cache as I thought when using the profiler, or they way the DBMS is handled, or any other issue in my programming. As you said from the beginning, when you said that the 10MB cache should not be a problem. So now, given that right now the server is runnning fine, I guess I should concentrate on the problem that sometimes happen when stopping my website. -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, November 12, 2010 02:19 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 12/11/2010 19:12, Brian wrote: Oh, I think I found what you were asking, the path to the GC root: org.apache.naming.resources.FileDirContext$FileResource org.apache.naming.resources.CacheEntry org.apache.naming.resources.CacheEntry[XXX] org.apache.naming.resources.ResourceCache org.apache.naming.resources.ProxyDirContext etc etc etc OK, that is indeed Tomcat's static file cache. Given you only have two WARs and the default cache size is 10MB per WAR I am struggling to see how this could be causing an OOME. Anyway, the settings for this are on the Context element. The simplest way to disable static file caching everywhere is to add the following to the Context element in CATALINA_BASE/conf/context.xml cachingAllowed=false 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
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Leon, Thanks for your suggestion and sorry for responding so late. I had to take a break from this issue at least for a day. I had been working on this for 3 days in a row and barely sleeping at night, because of the crashes. As soon as I saw my installation not crashing, I needed to take a rest. I'm already using www.YourKit.com for now. It is not free, I guess I will not buy it finally if I totally solve my problem. But for now, while in the trial period, I'm using it and it is great! But as soon as it ends, I will definitely try Jmap/Jhat as you suggested. -Original Message- From: Leon Rosenberg [mailto:rosenberg.l...@gmail.com] Sent: Friday, November 12, 2010 04:27 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? Hello Brian, maybe I missed half of the communication, but from the other half I got the feeling that you are shooting in the dark. Heap dumps are hard to decipher especially if the internals seems to be unknown ;-) When hunting a memory leak I setup a cron job that performs the same task once an hour: jmap -heap:live pid file-with-timestamp.heap jmap -histo:live pid file- with-timestamp.histo the jmap histogramm contains all objects in your vm and their cumulated space. by comparing two of them taken in 30 or 60 minutes you can determine which objects are actually increasing numbers or size. With that knowledge analyzing heap dumps can be performed much faster and easier. Keep in mind that analyzing mem leaks that lead to outofmemory after the oome occured is twice as hard as shortly before . regards Leon P.S. I have a small tool that creates a diff of two subsequent histograms, i can share it if you need it. P.P.S. jmap is a standart java tool. Another standart java tool - jhat can theoretically analyze a heap dump based on a baseline heapdump taken previously. On Fri, Nov 12, 2010 at 9:44 PM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? Now I also see that 160MB are being used by org.apache.jasper.runtime.BodyContextImpl. There are a couple of system properties you can set to control this: org.apache.jasper.runtime.JspFactoryImpl.USE_POOL org.apache.jasper.runtime.JspFactoryImpl.POOL_SIZE Look here for the doc: http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html - 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 - 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: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Mark, This is interesting. I got a snapshot of the memory. I found just about 91 instances of this class (org.apache.jasper.runtime.BodyContentImpl). Just 91, so I guess the quantity of buffers at the same time is small, maybe they belong to a pool and the maximum quantity of objects in the pool is 100? I'm just guessing. Well, one of them was as big as 18MB! The second one almost the same about the first 10 of them where HUGE. Then the rest where more reasonable, between 1 and 50KB. How can a page in my site be as big as 18MB? It definitely can't happen. But for some reason, the buffer was that big in a certain point of time. I inspected the content of them, and they were not huge inside, just a few KB of HTML code inside and the rest was spaces or some invisible character. I mean, these instances of the class contained a huge array of chars, buf only the first hundreds/thousands of them contained HTML code, but given that the busfferSize variable contained a big value (18 millons), the object thought it had a huge full buffer containing real values. I guess something wrong happened, maybe an exception ocurred or I undeployed my app at that very moment (or something else went wrong) and this huge buffers got wrongly full of dummy characters and then stayed in the limbo, until the GB would delete them? Or now that I think more about it, they stayed in the memory to be reused again, being objects in a pool, their nextChar variable (a pointer) was reset to a small value, but their hugely increased internal array of chars was going to stay as big as the biggest they were... like you said. I will set the LIMIT_BUFFER value now, I guess that will solve it as you said. When the buffer gets cleared after it is being used every time, and the LIMIT value =true, the buffer will shrink to 512 bytes again, huh? That will be nice. :-) -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Saturday, November 13, 2010 07:21 AM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 12/11/2010 20:35, Brian wrote: Ok, I will do that now! I have taken another snapshot of the JVM a few minutes ago. Now I also see that 160MB are being used by org.apache.jasper.runtime.BodyContextImpl. This contains images of my DYNAMIC pages! That is sort of what I'd expect. A little background: Tag bodies have to be buffered. Jasper (Tomcat's JSP engine) uses a pool of buffers. Tag bodies are expected to be small. The buffer grows (but does not shrink) if the body is large. If you have a lot of tags that have large bodies then you can see an increase in memory usage in this area. To control this see org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER on http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html HTH, 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
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Chuck, Thanks for your explanations. My PermGen seems to be normal, low and steady. It seems that I solved my problems! So far, these are my conclutions: - Very often, when I restart/redeploy my app, some garbage is left in the memory. I don't know why, given that my code closes everything (relationships with the database, etc), unloads the JDBC drivers, etc. Now I'm restarting Tomcat very often, instead of just restarting/deploying my app. - The Tag bodies made some buffers to grow to huge objects. I have told Tomcat to decrease those buffers if they get bigger than the standard size (512 bytes), and now the problem seems to be gone! I wonder why isn't that LIMIT=true directive a standard. I bet millions of sites are having the same problem, and they don't even imagine what a memory profiler is, and how this can be happening. This problem was swallowing hundreds of MB! - I configured the Context so it wont use a cache for the static pages. At least for now, I made this to all the contexts. Maybe I will restore this capability to just my java app that doesn't have more than a few static resources, and keep it disabled for the 20 WARs full of static pages. This problem was also swallowing hundreds of MB! Brian -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Saturday, November 13, 2010 11:03 AM To: Tomcat Users List Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? the Eden Space is barely used (10MB right now). The survivor space is even less used (1MB right now). An object is normally created in Eden and will migrate to survivor if still reachable during the next minor GC. In most applications, the vast majority of objects become unreachable very quickly, and never make it to a survivor space. But the Tenured Gen space has 120MB right now! In fact, when my JVM start to eat houndreds of MB, most of that goes to the Tenured Gen. Once the survivor space fills up, long-lived objects migrate to tenured, where they stay until the application discards them. Very large objects may be initially allocated in tenured if they won't fit in Eden. Anything you see in tenured has either been around for quite some time or exceeds the Eden allocation threshold. The dead objects in tenured space won't be cleaned out until a major GC occurs; the JVM tries to minimize the number of those since they take quite a bit more time than a minor GC. You can force a major GC with the JConsole button. The perm gen is using 22MB right now, which is not a lot so I guess it is normal. A one-time look at the size of the PermGen isn't interesting; you need to see whether it increases over time, especially after restarting a webapp. If it does increase after a restart, that means the old instance of the webapp is still hanging around. - 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: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Chris, -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Monday, November 15, 2010 09:04 PM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 11/14/2010 1:30 AM, Brian wrote: It seems that I solved my problems! So far, these are my conclutions: - Very often, when I restart/redeploy my app, some garbage is left in the memory. I don't know why, given that my code closes everything (relationships with the database, etc), unloads the JDBC drivers, etc. Now I'm restarting Tomcat very often, instead of just restarting/deploying my app. The above is certainly compounding the issues below... - The Tag bodies made some buffers to grow to huge objects. I have told Tomcat to decrease those buffers if they get bigger than the standard size (512 bytes), and now the problem seems to be gone! I wonder why isn't that LIMIT=true directive a standard. I bet millions of sites are having the same problem, and they don't even imagine what a memory profiler is, and how this can be happening. This problem was swallowing hundreds of MB! Yes: hundreds of MBs of buffers for each webapp instance that is not cleanly undeployed can certainly bust your heap. I'm not entirely sure how Tomcat expects to free all those buffers (or simply relies on GC), but it's certainly possible that retaining some reference to a webapp-loaded object ends up keeping those buffers around forever, unable to free them. mmm OK, this is what I have understood so far: - The tag body buffers are stored in a growing array of chars. There is a pointer that know which of the chars is the last one being used. Initially, they are 512 chars, but if a bigger buffer is needed, the quantity of chars increases. But it never decreases. So if at one instant 1 million of chars are needed, the array will grow for that, but will never shrink even if the next use of the buffer is for a 10 characters value (I'm assuming that there is a pool of buffers to reuse, that the buffers are part of a pool). - Some some reason (I don't know why), sometimes Tomcat thinks that needs a huge buffer, so it makes the array to increase to millions of chars. I have no such big pages in my site, so I can't understand how can that happen, but it does. Then, the buffer stays with millions of chars, so the object uses millions of bytes. Do you think a leak has something to do with that? - I think Tomcat doesn't even expect to free those buffers as you say, but use them again and again instead, cause I THINK (correct me if I'm wrong) that they belong to a pool. So they just say like that forever. - Now that I set the flag, everytime Tomcat decides to empty the content of the buffer so it will be used again (emtpy=set the lastUsedCharPointer to cero), it sets it to a new array of 512 bytes if it was bigger that that. I don't know if this issue is retaled to the other one (leaks at undeployment). That isn't a standard option because in (most?) cases where the buffers are being constantly used, the performance increase is significant. Since your webapp is both misbehaving and being re-loaded often, you must use this workaround. Well, I don't know how can Tomcat think that a 8MB buffer is needed in my site for a page. That is the source of the problem. But even if its my fault somehow (leaks in my code), or just the planets aligned so this will happen, I think Tomcat should always think If the buffer got too big when I clear it, I will make it again to be 512 bytes. That just means creating a new array of chars. How much cost would that be? I don't mean to say that you are doing anything wrong, but our production webapps aren't undeployed for months at a time -- between releases. What is it that requires you to redeploy your webapp so often? I'm constantly developing, improving and correcting my site. - I configured the Context so it wont use a cache for the static pages. At least for now, I made this to all the contexts. Maybe I will restore this capability to just my java app that doesn't have more than a few static resources, and keep it disabled for the 20 WARs full of static pages. This problem was also swallowing hundreds of MB! Again, these caches might expect to die with the rest of the webapp. If they don't you'll certainly exhaust your heap after a couple of reloads. Well, given that I have about 20 WARs, these caches were using about 200MB of ram. Even if my app never leaks when redeploying and doesn't degenerate, or even if I would never stop my app, I don't like to spend 200MB in these caches. I could also limit the size of the caches, but I started trying to disable them, and my site still runs pretty fast without these caches now. I believe Chuck and Mark have both suggested that you simply fix your webapp's leaks
After manager says that there was a leak, how to use a profiler?
Hi, After the Tomcat manager warns that there was a leak with one app what was stopped or undeployed, how do I use the profiler to investigate that? I mean, that is the starting point to analize that? What should I look for? Brian
RE: After manager says that there was a leak, how to use a profiler?
Maybe my question sounded too vague and repetitive. What I meant is something like this Is the a class loader (or something like that) than I should start analyzing? I mean, is there a route I should follow in order to see which objects are stucked? If the Tomcat Manager knows that something got stucked in the memory, how does it know that? Is there a clue we should start?. -Original Message- From: Brian [mailto:bbprefix-m...@yahoo.com] Sent: Monday, November 15, 2010 10:58 PM To: users@tomcat.apache.org Subject: After manager says that there was a leak, how to use a profiler? Hi, After the Tomcat manager warns that there was a leak with one app what was stopped or undeployed, how do I use the profiler to investigate that? I mean, that is the starting point to analize that? What should I look for? Brian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hi Chuck, Now I think you must be right.It is not impossible that one of my pages is huge. They are dynamically created, so something could be wrong in my programming to deliver a huge page for some requests. Isn't there a log of all the requests? I have one running Maybe the log could show the size of the responses if that is possible, I could see what is the URL of the gigantic page and easily find the reason I will check that -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Monday, November 15, 2010 10:38 PM To: Tomcat Users List Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? sometimes Tomcat thinks that needs a huge buffer, so it makes the array to increase to millions of chars. I have no such big pages in my site This is the crux of the problem - you apparently *do* have something that requires such a large buffer. Don't know if it's nested JSPs, some kind of recursive include, or ???. Unfortunately, I'm not aware of any existing mechanism in Jasper that will log these exceptional allocations, so someone would have to put in some new logging code to catch the situation. The method that does this is reAllocBuff() at the end of org.apache.jasper.runtime.BodyContentImpl; the current algorithm usually just doubles the size of the buffer when the size of the current one is exceeded. It would be easy just to add a simple logging call (or even a print statement, temporarily) that includes a stack trace when some size threshold is exceeded. - 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: Tomcat 6.0.29 using more and more RAM until it collapses?
Well, I am using the valve indeed! I will check if it is showing the size of the responses. I guess I can find the huge pages easily there. I'm not using the trimSpaces flag. If I find it, I wont need to limit the buffer. That would be more elegant than having to do it. :-) But the other issue is that I still have to find the reason of the leak. I'm exploring YourKit for that. I guess I will find how to do it soon. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Tuesday, November 16, 2010 12:00 AM To: Tomcat Users List Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: Tomcat 6.0.29 using more and more RAM until it collapses? Isn't there a log of all the requests? Not by default, but you can enable the AccessLogValve in server.xml, that will display the request URI and the response size. However, if you have trimSpaces on for the JSP servlet, the size shown in the log will be the one after white space is removed - and odds are that it's white space eating up the buffer. - 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: After manager says that there was a leak, how to use a profiler?
Hi Mark, I read your information, which I will quote here: 1. Find an app that you can't reload without OOME 2. Get a profiler - I like Yourkit Full disclosure: they give ASF committers a free copy 3. Reload you app once 4. Use the profiler to look for instances of WebappClassLoader 5. Look for the one with the started attribute == false 6. Trace the GC roots for this instance 7. Fix whatever is hanging on to references to the instance - there should not be any Well, I'm using Yourkit as well. I reloaded the app twice, and I found 4 instances of WebappClassLoader. Two of them correspond to my two running apps, which is correct, and the other two correspond to the leaked apps. Both of them have an instance that have the started attribute with a false. Great, so I guess I'm in the right path to find the problem. Now I'm inspecting one of these objects with the started=false. If I choose the report of Paths from GC roots from it, I see LOTS of items! And all of them have the loader of indication. All the items are classes programmed by me, so I guess I'm guilty, and not the people that programmed Tomcat ;-) . They are DTOs, facades, Struts actionforms, etc. Why are all these classes in the list? What should I check about them? Why are they still loaded? I guess there is something missing in my programming. Maybe I should do something about all the objects that are still alive that correspond to all the loaded classes? Maybe I need to do something in the contextDestroyed() method in the ServletContextListener in my app, in order to destroy all the objects properly? Thanks a lot for your help! Brian -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Tuesday, November 16, 2010 04:37 AM To: Tomcat Users List Subject: Re: After manager says that there was a leak, how to use a profiler? On 16/11/2010 04:12, Brian wrote: Maybe my question sounded too vague and repetitive. What I meant is something like this Is the a class loader (or something like that) than I should start analyzing? I mean, is there a route I should follow in order to see which objects are stucked? If the Tomcat Manager knows that something got stucked in the memory, how does it know that? Is there a clue we should start?. http://markmail.org/message/fcbvwapt6afyndxn 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
RE: Tomcat 6.0.29 using more and more RAM until it collapses?
Hu Pid, Now that I looked, I did find something! Nov 15, 2010 8:37:28 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Nov 15, 2010 8:37:28 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Nov 15, 2010 8:37:28 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Nov 15, 2010 8:37:29 PM org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.manuals.common.utility.Log. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1531) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at com.manuals.model.utility.DatabaseObject.getStatement(DatabaseObject.java:434) at com.manuals.model.utility.DatabaseObject.getQueryResultSet(DatabaseObject.java:366) at com.manuals.model.utility.DatabaseObject.getQueryResultSet(DatabaseObject.java:326) And also this: ov 15, 2010 8:31:09 PM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated Nov 15, 2010 8:31:10 PM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated Nov 15, 2010 8:31:11 PM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated Nov 15, 2010 8:31:12 PM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated Nov 15, 2010 8:31:13 PM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated Nov 15, 2010 8:31:14 PM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated Nov 15, 2010 8:31:16 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Nov 15, 2010 8:31:20 PM org.apache.catalina.core.StandardContext stop INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/] has not been started Nov 15, 2010 8:31:21 PM org.apache.catalina.startup.HostConfig checkResources INFO: Undeploying context [] -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Tuesday, November 16, 2010 03:43 AM To: Tomcat Users List Subject: Re: Tomcat 6.0.29 using more and more RAM until it collapses? On 16/11/2010 05:08, Brian wrote: I still have to find the reason of the leak. Tomcat attempts to find notify you of potential memory leaks. You reported messages in your logs at app reload. Did you tell us what they are yet? p - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: After manager says that there was a leak, how to use a profiler?
All my JARs are in the shared directory that Tomcat has. I don't upload them in the WAR everytime I deploye again my app. Is that a problem? I have just read somewhere do it could actually be a problem, that when they are shared among the apps, bad things happen. I have basically two apps running, but are EXACTLY the same WAR, but they run in different domain names. So they use the same JARs, and do exactly the same. The other 20 WARs are just full of static HTML pages. -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Tuesday, November 16, 2010 04:37 AM To: Tomcat Users List Subject: Re: After manager says that there was a leak, how to use a profiler? On 16/11/2010 04:12, Brian wrote: Maybe my question sounded too vague and repetitive. What I meant is something like this Is the a class loader (or something like that) than I should start analyzing? I mean, is there a route I should follow in order to see which objects are stucked? If the Tomcat Manager knows that something got stucked in the memory, how does it know that? Is there a clue we should start?. http://markmail.org/message/fcbvwapt6afyndxn 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
RE: After manager says that there was a leak, how to use a profiler?
Thanks a lot for the info Konstantin. I will read it asap! -Original Message- From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] Sent: Monday, November 15, 2010 11:08 PM To: Tomcat Users List Subject: Re: After manager says that there was a leak, how to use a profiler? 2010/11/16 Brian bbprefix-m...@yahoo.com: Hi, After the Tomcat manager warns that there was a leak with one app what was stopped or undeployed, how do I use the profiler to investigate that? I mean, that is the starting point to analize that? What should I look for? E.g., using Eclipse MAT, [1] http://www.eclipse.org/mat/ [2] http://dev.eclipse.org/blogs/memoryanalyzer/2008/05/17/the-unknown- generation-perm/ Best regards, Konstantin Kolinko - 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
Placing JARs in ..../tomcat/shared/lib causes leaks when stopping apps?
Hi, I'm using Tomcat 6.0.29. I have two identical apps running at the same time. I mean, they use exactly the same WAR, but each one runs in a different web domain. When I stop/redeploy one of the apps, very often I get the famous leak problem, because of the webclassloader not being able to get collected by the garbage collector. etc etc etc. I'm placing all my library JARs in a common directory (../tomcat/shared/lib), and I set the catalina.properties file so Catalina knows this directory exists. Why did I do that? For two reasons: 1- uploading a WAR without all the support JARs is faster than with them, and I'm uploading my WARs very often, because I'm changing my app constantly. 2- I THOUGHT/THINK that placing the JARs in the same shared directory is better, because it takes less memory, and because after all there must be a reason why the shared directory option existed by default (at least until Tomcat 6.0.14 came out). And given that my two apps use exactly the same WAR, it made sense to me to place the JARs in the shared dir. Now I have read that this issue may be the reason of my problem with leaks. Something like this for each app, the webapploader pretendes to unload all the classes, and if they are shared it is not possible and then the leak happens. Is that true? Should I avoid using the shared lib directory? If so, for what was this option created for? Thanks, Brian
RE: Placing JARs in ..../tomcat/shared/lib causes leaks when stopping apps?
Thanks chuck, now I understand it. My JARs are the regular type of JAR, that doesn't have to be shared by all the apps for some reason. I didn't understand the real pourpose of that directory indeed. I will change it now. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Tuesday, November 16, 2010 11:06 PM To: Tomcat Users List Subject: RE: Placing JARs in /tomcat/shared/lib causes leaks when stopping apps? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: Placing JARs in /tomcat/shared/lib causes leaks when stopping apps? Something like this for each app, the webapploader pretendes to unload all the classes, and if they are shared it is not possible and then the leak happens. Well, the wording of the above is rather odd; there's no pretending going on, and nothing can unload a class directly - that's done only by GC after the class becomes unused. Is that true? Sort of. Should I avoid using the shared lib directory? In almost all cases, yes. It's safe to use the shared library when the classes placed therein truly are library functions (no persistent objects, no keeping of references to their callers), or when an object *must* be shared across multiple webapps. If so, for what was this option created for? To allow /objects/ to be shared across webapps, in the rare instance that it's necessary. Webapps are intended to be independent of one another, and any mingling of their content limits that independence severely - as you are observing. Keep the webapps separate; it's a lot easier on everyone concerned. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Placing JARs in ..../tomcat/shared/lib causes leaks when stopping apps?
Hi Mikolaj and Mark, Thanks for your help. I do know about aliases, but for some reason a couple of years ago I decided to keep each domain in a different context. And that reason was.hummm..like.. you know what? Either I forgot what the reason was (maybe because I have barely slept last night cause my website crashed), or there was no valid reason! As soon as I finish moving my JARs from the shared directory to the web-inf/lib directory and everything is OK, I will review that. Certaintly, if I don’t remember any valid reason to keep two contexts, I will start using just one! -Original Message- From: Mark Shifman [mailto:mark.shif...@yale.edu] Sent: Wednesday, November 17, 2010 08:30 AM To: Tomcat Users List Subject: Re: Placing JARs in /tomcat/shared/lib causes leaks when stopping apps? On 11/17/2010 02:43 AM, Mikolaj Rydzewski wrote: On Tue, 16 Nov 2010 22:55:10 -0500, Brian bbprefix-m...@yahoo.com wrote: I have two identical apps running at the same time. I mean, they use exactly the same WAR, but each one runs in a different web domain. [...] You should rather change your application to be aware of domain it runs in. Done that, there would be only one webapp deployed - no matter how many domains you need to handle. Perhaps you could give Brian a hint on how to do this. Would using aliases within the host do the trick? mas - 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: After manager says that there was a leak, how to use a profiler?
I'm doing it, thanks! -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Tuesday, November 16, 2010 04:27 PM To: Tomcat Users List Subject: RE: After manager says that there was a leak, how to use a profiler? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: After manager says that there was a leak, how to use a profiler? All my JARs are in the shared directory that Tomcat has. Is that a problem? Yes, that's a problem. You very likely have some references in the shared classes that point to objects of one webapp or the other - and that will prevent their every being garbage collected. Put the jars where they belong - in each webapp's WEB-INF/lib directory. Disk is cheap, instability isn't. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
FW: After manager says that there was a leak, how to use a profiler?
I will have to swallow my pride with this question. I bet this is a very easy issue, but for some reason I haven't found an answer. I moved my JARs from the .../tomcat/shared/lib directory to the web-inf/lib directory in the app itself, but it seems that the JARs there are not being discovered by Tomcat. This is what the log says: Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 730 ms Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.29 Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive ROOT.war Nov 17, 2010 3:46:56 PM org.apache.catalina.core.ApplicationContext log INFO: Marking servlet action as unavailable Nov 17, 2010 3:46:56 PM org.apache.catalina.core.ApplicationContext log SEVERE: Error loading WebappClassLoader context: delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: org.apache.catalina.loader.standardclassloa...@2eb0a3f5 org.apache.struts.action.ActionServlet java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1645) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1491) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10 95) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 4350) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7 91) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor t.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet threw load() exception java.lang.ClassNotFoundException: org.apache.struts.action.ActionServlet at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1645) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav a:1491) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:10 95) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 4350) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7 91) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:905) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:740) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:500) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at
RE: After manager says that there was a leak, how to use a profiler?
Hi Chuck, -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Wednesday, November 17, 2010 04:02 PM To: Tomcat Users List Subject: RE: After manager says that there was a leak, how to use a profiler? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: FW: After manager says that there was a leak, how to use a profiler? I moved my JARs from the .../tomcat/shared/lib directory to the web-inf/lib directory in the app itself It better be WEB-INF/lib; case matters (even on Windows). Yes, it is, I forgot to use the shift key. it seems that the JARs there are not being discovered by Tomcat. Access permissions? (Not likely if you're starting with a .war file.) That is not the problem, because as you said there is the WAR file that expands, and other files there (.jsp for example) are reachable Did you remove the jars from the shared library? (You must.) Yes, I did, even though I read somewhere that if the JAR files are found in WEB-INF/lib, they are read from there before the /shared/lib directory, if present at both places at the same time. What does your catalina.properties look like now? Taking out the comments, now this is the content: package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomca t.,org.apache.jasper.,sun.beans. package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.ap ache.tomcat.,org.apache.jasper. common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.hom e}/lib,${catalina.home}/lib/*.jar server.loader= shared.loader= tomcat.util.buf.StringCache.byte.enabled=true - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: FW: After manager says that there was a leak, how to use a profiler?
-Original Message- From: Pid [mailto:p...@pidster.com] Sent: Wednesday, November 17, 2010 04:02 PM To: Tomcat Users List Subject: Re: FW: After manager says that there was a leak, how to use a profiler? On 17/11/2010 20:56, Brian wrote: I will have to swallow my pride with this question. I bet this is a very easy issue, but for some reason I haven't found an answer. I moved my JARs from the .../tomcat/shared/lib directory to the web-inf/lib directory in the app itself, but it seems that the JARs there are not being discovered by Tomcat. This is what the log says: WEB-INF/lib or web-inf/lib? The first one, I made a mistake when typing the email. Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 730 ms Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Nov 17, 2010 3:46:56 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.29 Nov 17, 2010 3:46:56 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive ROOT.war Nov 17, 2010 3:46:56 PM org.apache.catalina.core.ApplicationContext log INFO: Marking servlet action as unavailable Nov 17, 2010 3:46:56 PM org.apache.catalina.core.ApplicationContext log SEVERE: Error loading WebappClassLoader context: delegate: false repositories: /WEB-INF/classes/ A war is a zip. You can open it using a zip util, or the jar command, to check that the files are actually where you think they are. E.g. jar -tf ROOT.war I did. All the files are where they should be, even the JAR files that are in WEB-INF/lib. The file expands correctly and all the files are being placed where they should be. It seems that the JARs inside ...WEB-INF/lib are not being discovered or used. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: FW: After manager says that there was a leak, how to use a profiler?
-Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Wednesday, November 17, 2010 06:46 PM To: Tomcat Users List Subject: RE: FW: After manager says that there was a leak, how to use a profiler? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: FW: After manager says that there was a leak, how to use a profiler? It seems that the JARs inside ...WEB-INF/lib are not being discovered or used. Hence the request to see your catalina.properties - which looks fine. What's in the Context elements for your webapps? If you're using anything other than the default (and implicit) Loader, that might affect how class searching is done. Also, if you have anything in the system classpath at Tomcat startup, that might also impact proceedings. Inside the Context there is nothing non-standard. Nothing about the loader indeed. It doesn't work either in the Tomcat installation at my production server, or the Tomcat local installation that my Eclipse uses when running the app. One interesting thing is happening though. Now it is showing the error messages in the log when I run it on Eclipse, but then IT WORKS! This is the context that Eclipse generated for the app, that shows all the error messages in the log: ?xml version=1.0 encoding=UTF-8 ? Context docBase=C:\Tomcat\webapps\VistaControlador reloadable=true source=org.eclipse.jst.jee.server:VistaControlador / - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: FW: After manager says that there was a leak, how to use a profiler?
I have notices several weird things: - Sometimes it runs, sometimes it doesn't - When I'm in Eclipse, if I already started the Tomcat server and it is running, if I ask to run it again, it does without any error messages in the log It looks like if it was a syncronization issue. Something like these: If nothing is running, it will wait when I ask it to start. But of something is already running, maybe it will run. And if it did run before at least once, maybe it will run next time I ask it. Makes sense? -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Wednesday, November 17, 2010 06:46 PM To: Tomcat Users List Subject: RE: FW: After manager says that there was a leak, how to use a profiler? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: FW: After manager says that there was a leak, how to use a profiler? It seems that the JARs inside ...WEB-INF/lib are not being discovered or used. Hence the request to see your catalina.properties - which looks fine. What's in the Context elements for your webapps? If you're using anything other than the default (and implicit) Loader, that might affect how class searching is done. Also, if you have anything in the system classpath at Tomcat startup, that might also impact proceedings. - 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 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: FW: After manager says that there was a leak, how to use a profiler?
Solved: I had several contexts in my server, in each one was already a WAR created days ago. I forgot about all these old WARs. Since I took off my JARs from the shared/lib directory, all these old WARs could not work because they didn't include the JARs inside. So basically I was trying to run the new WAR and it worked, but I was still watching in the log the output of the old WARs trying to deploy and work, but failing. -Original Message- From: Brian [mailto:bbprefix-m...@yahoo.com] Sent: Wednesday, November 17, 2010 11:35 PM To: 'Tomcat Users List' Subject: RE: FW: After manager says that there was a leak, how to use a profiler? I have notices several weird things: - Sometimes it runs, sometimes it doesn't - When I'm in Eclipse, if I already started the Tomcat server and it is running, if I ask to run it again, it does without any error messages in the log It looks like if it was a syncronization issue. Something like these: If nothing is running, it will wait when I ask it to start. But of something is already running, maybe it will run. And if it did run before at least once, maybe it will run next time I ask it. Makes sense? -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Wednesday, November 17, 2010 06:46 PM To: Tomcat Users List Subject: RE: FW: After manager says that there was a leak, how to use a profiler? From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: RE: FW: After manager says that there was a leak, how to use a profiler? It seems that the JARs inside ...WEB-INF/lib are not being discovered or used. Hence the request to see your catalina.properties - which looks fine. What's in the Context elements for your webapps? If you're using anything other than the default (and implicit) Loader, that might affect how class searching is done. Also, if you have anything in the system classpath at Tomcat startup, that might also impact proceedings. - 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 - 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: After manager says that there was a leak, how to use a profiler?
Hi Chris, I already took off the JARs from the shared/lib directory. So that is not an issue now. I have just stopped my apps, and this is what I have found in my log: Nov 18, 2010 10:22:57 PM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated Nov 18, 2010 10:22:58 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Nov 18, 2010 10:22:58 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Nov 18, 2010 10:22:58 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap SEVERE: The web application [] created a ThreadLocal with key of type [org.apache.commons.lang.builder.ReflectionToStringBuilder$1] (value [org.apache.commons.lang.builder.reflectiontostringbuilde...@1794040]) and a value of type [java.util.HashSet] (value [[]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Tuesday, November 16, 2010 02:34 PM To: Tomcat Users List Subject: Re: After manager says that there was a leak, how to use a profiler? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brian, On 11/16/2010 10:42 AM, Brian wrote: If I choose the report of Paths from GC roots from it, I see LOTS of items! And all of them have the loader of indication. All the items are classes programmed by me, so I guess I'm guilty, and not the people that programmed Tomcat ;-) . They are DTOs, facades, Struts actionforms, etc. Why are all these classes in the list? If these are java.lang.Class objects, then you are looking at the list of classes loaded by the WebappClassLoader. These are the objects that make up the memory block that is unrecoverable. It's not the Class objects themselves that are holding onto references to the ClassLoader, it's the other way around. What should I check about them? Why are they still loaded? The real problem is that there is an object that is still live somewhere whose Class has been loaded by your webapp's WebappClassLoader. I guess there is something missing in my programming. Maybe I should do something about all the objects that are still alive that correspond to all the loaded classes? Maybe I need to do something in the contextDestroyed() method in the ServletContextListener in my app, in order to destroy all the objects properly? A basic rule is that anything you configure in a ServletContextListener's contextStarted method needs to be destroyed in the contextDestroyed method. Same thing for any Servlets that have init() methods -- use the destroy() method to clean-up those resources. When you undeploy, there may be a leak message in catalina.out. If you post that, we might be able to help you. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: After manager says that there was a leak, how to use a profiler?
-Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Friday, November 19, 2010 04:45 AM To: Tomcat Users List Subject: Re: After manager says that there was a leak, how to use a profiler? On 19/11/2010 03:58, Brian wrote: Hi Chris, I already took off the JARs from the shared/lib directory. So that is not an issue now. I have just stopped my apps, and this is what I have found in my log: Nov 18, 2010 10:22:57 PM org.apache.catalina.core.StandardWrapper unload INFO: Waiting for 1 instance(s) to be deallocated Nov 18, 2010 10:22:58 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [] registered the JBDC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Tomcat fixed this one for you. You'll need to de-register the JDBC driver in a ServletContextListener to stop the message. I tried. In the contextDestroyed method I placed a code that looks for the drivers and unregisters them. But the only driver found is sun.jdbc.odbc.JdbcOdbcDriver, which is not even unregistered because (driver.getClass().getClassLoader().equals(getClass().getClassLoader())) = false Nov 18, 2010 10:22:58 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. I thought someone mentioned this was fixed in the latest MySQL JDBC driver. Thanks. I have downloaded to latest driver. Now lets see if that solves it. Nov 18, 2010 10:22:58 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap SEVERE: The web application [] created a ThreadLocal with key of type [org.apache.commons.lang.builder.ReflectionToStringBuilder$1] (value [org.apache.commons.lang.builder.reflectiontostringbuilde...@1794040]) and a value of type [java.util.HashSet] (value [[]]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. I think this one is https://issues.apache.org/jira/browse/LANG-586 Thanks. I have upgraded to the latest version of Commons Lang. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Spam
Since I enrolled in this list, I started to receive spam. The tipical subject of I have an account in the Nigerian Bank with US$10'000,000 and if you help me to recover it, you will get 30%... Is there a way to avoid this? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Spam
-Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Saturday, November 20, 2010 11:48 AM To: Tomcat Users List Subject: RE: Spam From: Brian [mailto:bbprefix-m...@yahoo.com] Subject: Spam Since I enrolled in this list, I started to receive spam. If you've never gotten spam before, you must be nearly unique. Well, I must admit I have received spam before :-) But I really don't get much spam, and I don't use any filters because they have never been reliable enough. I prefer to get spam, than to use a filter that blocks valid emails and having to check all the blocked emails to see if something valid is there. What I meant is that as soon as I enrolled, I started receiving this spam with the classic scam that made Nigerians famous on the internet, as they were on fax. Since the mailing list messages are archived in numerous public locations, it's pretty much impossible to prevent the unscrupulous from harvesting members' e-mail addresses. That's is why forums are better than lists. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
How to schedule events on Tomcat?
Hi, I have a regular app in my Tomcat server, based on the request/response paradigm. I need some processes tu run at some specific intervals, lets say after 30 minutes of some events, or maybe every 30 minutes. Is there a way to do that on Tomcat, to schedule events? I don't want to try tying this process to the requests, because it would make them run slower, and it would run twice at the same time if two requests arrive almous simultaneously. Thanks, Brian
How to schedule events on Tomcat
Wht I want to do is to call a method inside an object in the same java web app. Trying to do that from the OS would not be a good solution for me. -Original Message- From: Joseph Morgan [mailto:joseph.mor...@ignitesales.com] Sent: Thursday, December 02, 2010 03:17 PM To: Tomcat Users List; bbprefix-tom...@yahoo.com Subject: RE: How to schedule events on Tomcat? Why can't you use process scheduling of your OS? -Original Message- From: Brian [mailto:bbprefix-tom...@yahoo.com] Sent: Thursday, December 02, 2010 1:52 PM To: users@tomcat.apache.org Subject: How to schedule events on Tomcat? Hi, I have a regular app in my Tomcat server, based on the request/response paradigm. I need some processes tu run at some specific intervals, lets say after 30 minutes of some events, or maybe every 30 minutes. Is there a way to do that on Tomcat, to schedule events? I don't want to try tying this process to the requests, because it would make them run slower, and it would run twice at the same time if two requests arrive almous simultaneously. Thanks, Brian
RE: How to schedule events on Tomcat
Mark, This is what I call a perfect solution. I already did it using your advice. Thanks! -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Thursday, December 02, 2010 04:13 PM To: Tomcat Users List Subject: Re: How to schedule events on Tomcat On 02/12/2010 21:08, Brian wrote: Wht I want to do is to call a method inside an object in the same java web app. Trying to do that from the OS would not be a good solution for me. java.util.Timer and friends combined with a ServletContextListener 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
RE: How to schedule events on Tomcat?
Thanks! -Original Message- From: David kerber [mailto:dcker...@verizon.net] Sent: Thursday, December 02, 2010 05:05 PM To: Tomcat Users List Subject: Re: How to schedule events on Tomcat? On 12/2/2010 3:17 PM, Joseph Morgan wrote: Why can't you use process scheduling of your OS? -Original Message- From: Brian [mailto:bbprefix-tom...@yahoo.com] Sent: Thursday, December 02, 2010 1:52 PM To: users@tomcat.apache.org Subject: How to schedule events on Tomcat? Hi, I have a regular app in my Tomcat server, based on the request/response paradigm. I need some processes tu run at some specific intervals, lets say after 30 minutes of some events, or maybe every 30 minutes. Is there a way to do that on Tomcat, to schedule events? I don't want to try tying this process to the requests, because it would make them run slower, and it would run twice at the same time if two requests arrive almous simultaneously. I use java.util.Timer and java.util.TimerTask for this. D - 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
Tomcat CORS Filter: Why is the default list of headers in Access-Control-Allow-Headers so arbitrarily limited?
Hi, Tomcat brings a special filter that implements the CORS specification. In this filter, the default list of allowed headers is the following: Origin Accept X-Requested-With Content-Type Access-Control-Request-Method Access-Control-Request-Headers I know that I can replace that list by using the filter parameter cors.allowed.headers and specify my own list of headers. I know that. But I have the following questions: - When this filter was created, why was the list filled with this -abritrarily- short list of headers? Why these headers and not others? Why, for example, isn't the cache-control header in the list? How was this list chosen? - If I want to define a more complete list, which headers should I include? There are some many headers to think about! - Can I use a * instead of specifying a list? Is that something that the CORS specs allows? - I know that the CORS specs defined this kind of list, but. Why is that necessary? Why can't we just accept any header in the pre-flight OPTIONS step, instead of returning a 403 (Forbiden) if at least one of the headers requested by the client is not in the list of allowed headers? - Why isn't there an option in the filter to do something like this: response.setHeader(Access-Control-Allow-Headers, request.getHeader(Access-Control-Request-Headers) ? I'm puzzled. One of the users of my API sent the cache-control header in the in the Access-Control-Request-Headers list during the pre-flight step, and received an HTTP 403 error status. I can add this header to the list (using the cors.allowed.headers filter parameter). But what about next time some client sends another header that is not in the list? Brian
Sporadic HTTP 403 returned by Tomcat when this should not happen ever. How to find out why this happens?
Hi, I have a Restful service that receives a huge amount of HTTP requests per day. In some of these requests, Tomcat returns an HTTP 403 error status. This should never happen as far as I can tell because the resource is open, and is very sporadic but yet very critical because it makes my service unreliable. When this happens, it does for the same resource that would otherwise return a succesful response. I'm sure this is happening, because my users have reported me the issue, and because I can clearly see that in our Tomcat log, as follows: localhost - - [04/Feb/2015:01:11:06 -0500] GET /location/v1.7/locateip?key=abc123ip=182.68.243.178format=JSON HTTP/1.0 403 - - Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36 localhost - - [04/Feb/2015:01:12:24 -0500] GET /location/v1.8/locateip?key=abc123ip=local-ipformat=jsoncapacity=6X HTTP/1.0 403 - - Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36 localhost - - [04/Feb/2015:01:18:06 -0500] GET /location/v1.8/locateip?key=abc123ip=local-ipformat=jsoncapacity=6X HTTP/1.0 403 - - Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.94 Safari/537.36 Is there a way to show in the log why the 403s took place? How do I debug these events? I'm using Tomcat 7.0.50. By the way: I don't know if this is relevant, but this is the complete stack of software between the user and my Java App: - The request first goes through a Amazon AWS load balancer - Then it enters my Linux instance (Ubuntu 12.04.3) - Then it arrives to Nginx (v1.4.7), that runs a module that deals with abuses (when there are too many requests) - Then it hits Tomcat (7.0.50) - Then it finally hits my java servlet. Thanks in advance, Brian
RE: Sporadic HTTP 403 returned by Tomcat when this should not happen ever. How to find out why this happens?
Hello David, Not, it is not the case. No exceptions whatsoever. And about 1/100 (or less) of the requests return a 403 to the users, and all those requests are doing the same thing. Thanks a lot for your help! -Original Message- From: David Bullock [mailto:david.bull...@machaira.com.au] Sent: jueves, 05 de febrero de 2015 06:04 p.m. To: Tomcat Users List Subject: Re: Sporadic HTTP 403 returned by Tomcat when this should not happen ever. How to find out why this happens? On 6 February 2015 at 02:42, Brian brian...@emailbb.com wrote: Hi, I have a Restful service that receives a huge amount of HTTP requests per day. In some of these requests, Tomcat returns an HTTP 403 error status. Your servlet does something which throws a java.lang.Security exception (which is a runtime exception), and Tomcat is translating it into a 403 for you? (I didn't test it, but it might be a reasonable thing for a servlet-container to do). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Sporadic HTTP 403 returned by Tomcat when this should not happen ever. How to find out why this happens?
Hello Mark, 1- No authentication at all, since the user authenticates sending a parameter in the query string. 2- I have two filters: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter (which has been working fine for years now) and CORS, yes!!! Actually, the CORS filter (org.apache.catalina.filters.CorsFilter) is the first filter in my web.xml file, so it is the first to run. This is the way I have configured it: filter filter-nameCorsFilter/filter-name filter-classorg.apache.catalina.filters.CorsFilter/filter-class init-param param-namecors.allowed.origins/param-name param-value*/param-value /init-param init-param param-namecors.support.credentials/param-name param-valuefalse/param-value /init-param /filter filter-mapping filter-nameCorsFilter/filter-name url-pattern/*/url-pattern /filter-mapping I added the CORS filter probably two months ago, and probably I have started seen the 403 errors since then, yes! And now that I think about it, probably it is the CORS filter the reason of the 403 indeed, since my API is being called not only from servers but also from Javascript running in all kind of browsers and maybe some of them don't deal with CORS properly. That would explain why the 403s happens ocasionally. In fact, I see this 403 ocurring in most of the cases by one specific user (authenticated by a parameter in the query string) that calls my API from javacript! In what conditions does this filter return a 403 error? What are the Headers involved when that happens? How can I avoid this problem? Where (on the internet) can I learn more about this specific problem? Thanks Mark! -Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: viernes, 06 de febrero de 2015 04:47 a.m. To: Tomcat Users List Subject: Re: Sporadic HTTP 403 returned by Tomcat when this should not happen ever. How to find out why this happens? On 05/02/2015 23:14, Brian wrote: Hello David, Not, it is not the case. No exceptions whatsoever. And about 1/100 (or less) of the requests return a 403 to the users, and all those requests are doing the same thing. Thanks a lot for your help! Is any authentication configured for this web application? What filters are configured (the CORS filter might return a 403 for example)? 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
ServletRequest.getRemoteHost() not working when Tomcat is behind Nginx (Nginx as a reverse proxy)
Hi, First of all, I'm using: - Tomcat 7.0.50 - Nginx 1.4.7 When I use Tomcat alone, ServletRequest.getRemoteHost() (http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRe moteHost() <http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRe moteHost())> ) works fine. But when Tomcat is behind Nginx (Nginx acting as a reverse proxy), it does not. Just to make myself clear, this is the architecture I'm talking about: Client -> Nginx (as a reverse proxy) -> Tomcat. The problem is that ServletRequest.getRemoteHost() gives me the hostname of the proxy itself (meaning Nginx) and not that of the client. I was able to get the IP address of the visitor (and not that of the host where Nginx is running) doing this on Nginx: server { listen 80; server_name www.acme.com acme.com; location / { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; <--- This line did the trick proxy_set_header Host $http_host; proxy_pass http://152.53.163.220:80/; } } And then inspecting the content of the "X-Forwarded-For" header in my java programming. But what do I do to obtain the remote hostname? I guess it is something similar, but I haven't found a solution. What I want to know is: - Exactly what configuration do I need in Nginx - Exactly what do I do from Java to obtain the value. Thanks in advance, Brian
RE: ServletRequest.getRemoteHost() not working when Tomcat is behind Nginx (Nginx as a reverse proxy)
Hello José, That’s a nice idea indeed (A VERY NICE ONE!), but an extra work because of the networking effort. I'm talking about a site that can get hundreds of requests per second. Since Nginx has access to this information, I bet there must be a way to pass it to Tomcat the same way the IP address can be passed! But for some reason I can't find it and I have spent quite some time looking for it. Thanks a lot! > -Original Message- > From: Jose María Zaragoza [mailto:demablo...@gmail.com] > Sent: martes, 08 de septiembre de 2015 02:58 p.m. > To: Tomcat Users List <users@tomcat.apache.org> > Subject: Re: ServletRequest.getRemoteHost() not working when Tomcat is > behind Nginx (Nginx as a reverse proxy) > > 2015-09-08 21:22 GMT+02:00 Brian <brian...@emailbb.com>: > > Hi, > > > > > > > > First of all, I'm using: > > > > - Tomcat 7.0.50 > > > > - Nginx 1.4.7 > > > > > > > > When I use Tomcat alone, ServletRequest.getRemoteHost() > > > (http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRe > > moteHost() > > > <http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRe > > moteHost())> ) works fine. But when Tomcat is behind Nginx (Nginx acting > > as a reverse proxy), it does not. > > > > Just to make myself clear, this is the architecture I'm talking about: > > > > > > > > Client -> Nginx (as a reverse proxy) -> Tomcat. > > > > > > > > The problem is that ServletRequest.getRemoteHost() gives me the hostname of > > the proxy itself (meaning Nginx) and not that of the client. > > > > > > > > I was able to get the IP address of the visitor (and not that of the host > > where Nginx is running) doing this on Nginx: > > > > > > > > server { > > > > listen 80; > > > > server_name www.acme.com acme.com; > > > > location / { > > > > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > > <--- This line did the trick > > > > proxy_set_header Host $http_host; > > > > proxy_pass http://152.53.163.220:80/; > > > > } > > > > } > > > > > > > > And then inspecting the content of the "X-Forwarded-For" header in my java > > programming. But what do I do to obtain the remote hostname? I guess it is > > something similar, but I haven't found a solution. What I want to know is: > > > > - Exactly what configuration do I need in Nginx > > > > - Exactly what do I do from Java to obtain the value. > > Why not do you perform a reverse DNS lookup by code ? Something like : > > InetAddress addr = InetAddress.getByName("xx.xx.xx.xx"); > String host = addr.getCanonicalHostName(); > System.out.println(host); > > You only need to extract 'X-Forwarded-For' header from request and > execute that piece of code > > > Regards > > > > > > > > > Thanks in advance, > > > > > > > > Brian > > > > - > 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: ServletRequest.getRemoteHost() not working when Tomcat is behind Nginx (Nginx as a reverse proxy)
mm.. ... Well, so far I have always assumed that Tomcat itself has always made this effort (assuming that it is enabled to do so in the connector), so that when I execute the method I'm just retrieving the value. I'm I wrong? In this case when using Nginx+Tomcat, I assume that Nginx already made the effort to get the remoteHost value as well, so Tomcat just receives it and I just need to invoke the method to get it. Maybe I'm wrong here. I really appreciate your help! > -Original Message- > From: Jose María Zaragoza [mailto:demablo...@gmail.com] > Sent: martes, 08 de septiembre de 2015 03:59 p.m. > To: Tomcat Users List <users@tomcat.apache.org> > Subject: Re: ServletRequest.getRemoteHost() not working when Tomcat is > behind Nginx (Nginx as a reverse proxy) > > 2015-09-08 22:10 GMT+02:00 Brian <brian...@emailbb.com>: > > Hello Jos�, > > > > That�s a nice idea indeed (A VERY NICE ONE!), but an extra work because of > the networking effort. I'm talking about a site that can get hundreds of > requests > per second. > > But you would want to execute ServletRequest.getRemoteHost() in every > request , right ? That was your question. > I don't know how is the Tomcat 6's ServletRequest.getRemoteHost() > implementation , but I guess it's not very different to my code > > Regards > > > > > > > > Since Nginx has access to this information, I bet there must be a way to > > pass it > to Tomcat the same way the IP address can be passed! But for some reason I > can't find it and I have spent quite some time looking for it. > > > > Thanks a lot! > > > > > >> -Original Message- > >> From: Jose Mar�a Zaragoza [mailto:demablo...@gmail.com] > >> Sent: martes, 08 de septiembre de 2015 02:58 p.m. > >> To: Tomcat Users List <users@tomcat.apache.org> > >> Subject: Re: ServletRequest.getRemoteHost() not working when Tomcat is > >> behind Nginx (Nginx as a reverse proxy) > >> > >> 2015-09-08 21:22 GMT+02:00 Brian <brian...@emailbb.com>: > >> > Hi, > >> > > >> > > >> > > >> > First of all, I'm using: > >> > > >> > - Tomcat 7.0.50 > >> > > >> > - Nginx 1.4.7 > >> > > >> > > >> > > >> > When I use Tomcat alone, ServletRequest.getRemoteHost() > >> > > >> > (http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRe > >> > moteHost() > >> > > >> > <http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRe > >> > moteHost())> ) works fine. But when Tomcat is behind Nginx (Nginx > >> > acting > >> > as a reverse proxy), it does not. > >> > > >> > Just to make myself clear, this is the architecture I'm talking about: > >> > > >> > > >> > > >> > Client -> Nginx (as a reverse proxy) -> Tomcat. > >> > > >> > > >> > > >> > The problem is that ServletRequest.getRemoteHost() gives me the > hostname of > >> > the proxy itself (meaning Nginx) and not that of the client. > >> > > >> > > >> > > >> > I was able to get the IP address of the visitor (and not that of the host > >> > where Nginx is running) doing this on Nginx: > >> > > >> > > >> > > >> > server { > >> > > >> > listen 80; > >> > > >> > server_name www.acme.com acme.com; > >> > > >> > location / { > >> > > >> > proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; > >> > <--- This line did the trick > >> > > >> > proxy_set_header Host $http_host; > >> > > >> > proxy_pass http://152.53.163.220:80/; > >> > > >> > } > >> > > >> > } > >> > > >> > > >> > > >> > And then inspecting the content of the "X-Forwarded-For" header in my > >> > java > >> > programming. But what do I do to obtain the remote hostname? I guess it > >> > is > >> > something similar, but I haven't found a solution. What I want to know > >> > is: > >> > > >> > - Exactly what configuration do I need in Nginx > >> > > >> > - Exactly what do I do from
Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?
-Original Message- From: Emmanuel Bourg Reply-To: Tomcat Users List Date: Monday, June 22, 2020 at 15:36 To: "users@tomcat.apache.org" Subject: Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead? Le 22/06/2020 à 20:03, Christopher Schultz a écrit : > It looks like whoever is responsible for packing Tomcat for Ubuntu has > something missing, there. I suggest you file a bug with Ubuntu. That must be me :) I'll get a look. Emmanuel Bourg Hi Emmanuel, Please do! It definitely looks like a bug. I just reported the bug here: https://bugs.launchpad.net/ubuntu/+source/tomcat9/+bug/1884591 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?
-Original Message- From: Emmanuel Bourg Date: Monday, June 22, 2020 at 18:14 To: Tomcat Users List , Brian Subject: Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead? Le 22/06/2020 à 18:43, Brian a écrit : > I'm not really an expert with Linux. It would seem to me that the "adm" group (to which syslog seems to belong) lacks a write permission Indeed, rsyslog in Ubuntu runs as syslog:adm and needs special permissions to write to /var/log/tomcat9. This issue should be reported to Ubuntu. The tomcat9 package in Debian isn't affected by this issue because rsyslogd runs as root. > OK, I did it and the write permission was added to the adm group. I restarted Tomcat and it worked, the catalina.out file got created! However, after I restarted the whole Ubuntu, I discovered that the permissions went back to how there were (not write for adm). Why is that? The permissions on this directory are managed by systemd-tmpfiles. The tomcat9 package defines the expected permissions in /usr/lib/tmpfiles.d/tomcat9.conf and the permissions are enforced when the system starts. It's possible to override the default settings, you have to copy the configuration file to /etc/tmpfiles.d/ and change the permissions on /var/log/tomcat9 from 2750 to 2760: cp /usr/lib/tmpfiles.d/tomcat9.conf /etc/tmpfiles.d/ sed -i s/2750/2760/ /etc/tmpfiles.d/tomcat9.conf The write permissions for the adm group will then be persistent. Hi Emmanuel, Thanks a lot for your help, but unfortunately I think that something is still not working. I copied the file running the cp command, and then edited the created file to replace "2750" with "2760", then restarted Ubuntu But I still have the same problem, catalina.out never gets created. Then I tried editing the original file (/usr/lib/tmpfiles.d/tomcat9.conf) replacing "2750" with "2760", then restarted Ubuntu But I still have the same problem. I verified that the permissions stay correct, I mean giving write permission to the adm group after I restart Ubuntu, and that DOES work! When I perform a "ls -l /var/log/", this is what I see for the "tomcat9" directory: drwxrwS--- 3 tomcatadm4096 Jun 23 11:31 tomcat9 Finally, I checked the syslog and this is what I found: Jun 23 12:27:43 ip-172-31-92-155 systemd[1]: Starting Apache Tomcat 9 Web Application Server... Jun 23 12:27:43 ip-172-31-92-155 systemd[1]: Started Apache Tomcat 9 Web Application Server. Jun 23 12:27:43 ip-172-31-92-155 tomcat9[594]: NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED Jun 23 12:27:43 ip-172-31-92-155 rsyslogd: file '/var/log/tomcat9/catalina.out': open error: Permission denied [v8.2001.0 try https://www.rsyslog.com/e/2433 ] Jun 23 12:27:44 ip-172-31-92-155 tomcat9[594]: Jun 23, 2020 12:27:44 PM org.apache.catalina.startup.VersionLoggerListener log Jun 23 12:27:44 ip-172-31-92-155 tomcat9[594]: INFO: Server version name: Apache Tomcat/9.0.31 (Ubuntu) . It seems that rsyslogd is still unable to deal with "/var/log/tomcat9/catalina.out". What could be wrong now? Do you have any ideas? Brian Emmanuel Bourg - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?
Hello, I have been using Tomcat for about 18 years. As far as I can remember, everything that I leave on the log with System.out.println() has been found inside the file "catalina.out" which has been nice. However, this seems to have changed. I just migrated to Ubuntu 20.04 + Tomcat 9.0.31, and installed Tomcat doing a "sudo apt install tomcat9". Now I see that the file "catalina.out" never gets created, and that everything that had been sent there is now being sent to the Ubuntu/Linux/Debian log "syslog". I don't like that, I want to keep having a separate/dedicated log for Tomcat (which is something I check very often) and not havoing to search for it inside syslog (which is something I rarely inspect). I have done some research, and this is what I have discovered (if I understood everything correctly): - Tomcat now runs as a service inside something called "systemsd" - For some reason, the people at Ubuntu/Debian/Linux decided that Tomcat's log should be found inside syslog, instead of staying independent inside "catalina.out". Why is that? I don't know and I don't like it! - The other files inside /var/log/tomcat get created, including the "catalina.-MM-DD.log" files. But I dont' find my "System.out.println()" messages there, which has always been the case. - I have found, however, that syslog tries to create and populate the "catalina.out" file as well, since I have found an error inside syslog that says something like "rsyslogd: file '/var/log/tomcat9/catalina.out': open error: Permission denied". - I have also found a file "/etc/rsyslog.d/tomcat9.conf" which, indeed, seams to indicate syslog that the file "/var/log/tomcat9/catalina.out" must be populated. Which makes sense and should solve my needs. - Considering the "Permission denied" error message, I started playing with the permissions (something that I really don't have much experience with). If I remember correctly, I created the file "catalina.out" manually, and the modified its properties so the owners are "tomcat/adm", since the "syslog" process/user seems to be inside the "adm" group. Restarted everything... and the "catalina.out" file got created and populated!!! So it seems that the main obstacle here is a lack of correct permissions so syslog can do what has been told and populate the "catalina.out" file. Did I get it right? - However, when I delete all the log files (which I do every once in a while), the permissions that I assigned get lost and the file doesn't get created anymore. What are we supposed to do to deal with this problem? Can/should we do something so the Tomcat log doesn't go to syslog? If not, and considering that it seems that syslog is trying to populate the "catalina.out" file as it has been told, what should we do to correct the permissions problem? Thanks in advance! Brian
Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Brian, On 6/22/20 02:04, Brian wrote: > Hello, > > I have been using Tomcat for about 18 years. As far as I can > remember, everything that I leave on the log with > System.out.println() has been found inside the file "catalina.out" > which has been nice. However, this seems to have changed. I just > migrated to Ubuntu 20.04 + Tomcat 9.0.31, and installed Tomcat > doing a "sudo apt install tomcat9". Now I see that the file > "catalina.out" never gets created, and that everything that had > been sent there is now being sent to the Ubuntu/Linux/Debian log > "syslog". I don't like that, I want to keep having a > separate/dedicated log for Tomcat (which is something I check very > often) and not havoing to search for it inside syslog (which is > something I rarely inspect). > > I have done some research, and this is what I have discovered (if I > understood everything correctly): > > - Tomcat now runs as a service inside something called "systemsd" - > For some reason, the people at Ubuntu/Debian/Linux decided that > Tomcat's log should be found inside syslog, instead of staying > independent inside "catalina.out". Why is that? I don't know and I > don't like it! - The other files inside /var/log/tomcat get > created, including the "catalina.-MM-DD.log" files. But I dont' > find my "System.out.println()" messages there, which has always > been the case. - I have found, however, that syslog tries to create > and populate the "catalina.out" file as well, since I have found an > error inside syslog that says something like "rsyslogd: file > '/var/log/tomcat9/catalina.out': open error: Permission denied". - > I have also found a file "/etc/rsyslog.d/tomcat9.conf" which, > indeed, seams to indicate syslog that the file > "/var/log/tomcat9/catalina.out" must be populated. Which makes > sense and should solve my needs. - Considering the "Permission > denied" error message, I started playing with the permissions > (something that I really don't have much experience with). If I > remember correctly, I created the file "catalina.out" manually, and > the modified its properties so the owners are "tomcat/adm", since > the "syslog" process/user seems to be inside the "adm" group. > Restarted everything... and the "catalina.out" file got created and > populated!!! So it seems that the main obstacle here is a lack of > correct permissions so syslog can do what has been told and > populate the "catalina.out" file. Did I get it right? - However, > when I delete all the log files (which I do every once in a while), > the permissions that I assigned get lost and the file doesn't get > created anymore. > > What are we supposed to do to deal with this problem? Can/should we > do something so the Tomcat log doesn't go to syslog? If not, and > considering that it seems that syslog is trying to populate the > "catalina.out" file as it has been told, what should we do to > correct the permissions problem? What are the permissions of the /var/log/tomcat directory? Hello Chris, I did a "ls -l /var/log/". According to that, this is what I see for "/var/log/tomcat9": drwxr-s--- 3 tomcatadm4096 Jun 22 10:51 tomcat9 I'm not really an expert with Linux. It would seem to me that the "adm" group (to which syslog seems to belong) lacks a write permission, but in my old instance (Tomcat 8.5.39 + Ubuntu 18.04) the "catalina.out" file works perfectly (gets created and populated) and this is what I see there, it doesn't seem to me that the adm group has a write permission there either: drwxr-x--- 3 tomcat8 adm 4096 Jun 22 10:00 tomcat8 Perhaps you need to chmod g+w /var/log/tomcat ? - -chris OK, I did it and the write permission was added to the adm group. I restarted Tomcat and it worked, the catalina.out file got created! However, after I restarted the whole Ubuntu, I discovered that the permissions went back to how there were (not write for adm). Why is that? In fact, now I remember that I tried this before, but since I restarted the whole Ubuntu instead of just Tomcat, I never saw any progress. I didn't notice that it would have worked if I just restarted Tomcat. In any case, why is this permission required in my new VPS, if the old one lacks it and catalina.out works perfectly?
Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?
-Original Message- From: Emmanuel Bourg Reply-To: Tomcat Users List Date: Tuesday, June 23, 2020 at 19:02 To: "users@tomcat.apache.org" Subject: Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead? Le 23/06/2020 à 19:48, Brian a écrit : > It seems that rsyslogd is still unable to deal with "/var/log/tomcat9/catalina.out". > What could be wrong now? Do you have any ideas? I got the permissions wrong, the adm group is now allowed to write to /var/log/tomcat9 but not to enter it. Try 2770 instead of 2760. Emmanuel Bourg Hi Emmanuel, Good news: I updated "/etc/tmpfiles.d/tomcat9.conf" (the file I created) with the new value of 2770. Deleted all the logs inside "/val/log/tomcat9" and restarted Ubuntu. "catalina.out" got created and populated. Bad news: Then I deleted all the logs inside "/val/log/tomcat9" and just restarted Tomcat (which is something I do sometimes, in production). "catalina.out" didn't get created this time. Just to confirm, again I deleted all the logs inside "/val/log/tomcat9" and restarted Ubuntu. "catalina.out" got created and populated again. Any ideas? Brian
Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead?
-Original Message- From: Emmanuel Bourg Reply-To: Tomcat Users List Date: Tuesday, June 23, 2020 at 20:01 To: "users@tomcat.apache.org" Subject: Re: File "catalina.out" not being created/populated when using Tomcat 9.0.31 + Ubuntu 20.04, and content goes to the Ubuntu syslog instead? Le 24/06/2020 à 02:35, Brian a écrit : > Good news: I updated "/etc/tmpfiles.d/tomcat9.conf" (the file I created) with the new value of 2770. Deleted all the logs inside "/val/log/tomcat9" and restarted Ubuntu. "catalina.out" got created and populated. > Bad news: Then I deleted all the logs inside "/val/log/tomcat9" and just restarted Tomcat (which is something I do sometimes, in production). "catalina.out" didn't get created this time. > > Just to confirm, again I deleted all the logs inside "/val/log/tomcat9" and restarted Ubuntu. "catalina.out" got created and populated again. > > Any ideas? The catalina.out file is held by rsyslogd and isn't recreated unless you restart rsyslogd. Try this when you clean the logs and restart Tomcat: systemctl restart rsyslog tomcat9 Hi, I just realized that when the "bad news" experiment took place, in the syslog there was NOT another of those " file '/var/log/tomcat9/catalina.out': open error: Permission denied.." errors, so I guess it was not a permissions issue anymore, which makes me think that the "2770" value finally solved that issue. That is nice, thanks! OK, I restarted rsyslog and the started again Tomcat as you adviced and... you are right, the catalina.out file got created again. So I think you are right about rsyslogd still holding the log file. To be honest with you, I'm happy about the catalina.out file finally getting created and I really appreciate your kind help, I really do. But I'm not really happy about having to restart rsyslog before every time I need to restart Tomcat. It is weird, and I guess a lot of users will never imagine that they have to do that and they will not feel very pleased when they realize that the catalina.out file doesn't get created after restarting Tomcat. And probably most of them will not even notice that the Tomcat log is being added to the syslog, for that matter. This whole new relation between syslog and Tomcat is really weird and I don't think the users are being warned about it. I have used Tomcat+Ubuntu for several years and I haven't seen this complication before. If there is an advantage about this relation between syslog and Tomcat, I really can't see it. Thanks again! Brian
Newbie question about log config with JSF
Hello - hoping someone can help with a (dumb?) easy log config question. I am using Tomcat 6.0.16 with JSF 1.2.9 (Mojarra) - everything is working pretty cool, but I am getting one SEVERE exception being thrown from JSF, which appears in the logs: SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /secure/ecobee4.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImp [EMAIL PROTECTED] Unfortunately, I have no stack trace information in the logs for this, which I need to help track this down. So, I tried changing the log levels for the file and console loggers to FINEST: 1catalina.org.apache.juli.FileHandler.level = FINEST java.util.logging.ConsoleHandler.level = FINEST but this didn't do the trick. The stderr_20080811.log and stdout_20080811.log files are empty. If anyone can point out the changes needed to log the full stack trace, it would be heartily welcomed - I'm a little stumped. Many thanks. Brian Parkinson Avaning Inc. --- x8 snip conf: cat logging.properties # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the License); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4admin.org.a pache.juli.FileHandler, 5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler # Handler specific properties. # Describes specific configuration info for Handlers. 1catalina.org.apache.juli.FileHandler.level = FINEST 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 1catalina.org.apache.juli.FileHandler.prefix = catalina. 2localhost.org.apache.juli.FileHandler.level = FINE 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 2localhost.org.apache.juli.FileHandler.prefix = localhost. 3manager.org.apache.juli.FileHandler.level = FINE 3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 3manager.org.apache.juli.FileHandler.prefix = manager. 4admin.org.apache.juli.FileHandler.level = FINE 4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 4admin.org.apache.juli.FileHandler.prefix = admin. 5host-manager.org.apache.juli.FileHandler.level = FINE 5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs 5host-manager.org.apache.juli.FileHandler.prefix = host-manager. java.util.logging.ConsoleHandler.level = FINEST java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter # Facility specific properties. # Provides extra control for each logger. org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager] .level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager] .handlers = 3manager.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].l evel = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].h andlers = 4admin.org.apache.juli.FileHandler org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-man ager].level = INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-man ager].handlers = 5host-manager.org.apache.juli.FileHandler # For example, set the com.xyz.foo logger to only log SEVERE # messages: #org.apache.catalina.startup.ContextConfig.level = FINE #org.apache.catalina.startup.HostConfig.level = FINE #org.apache.catalina.session.ManagerBase.level = FINE #org.apache.catalina.core.AprLifecycleListener.level=FINE conf: - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Log4J error using Quartz scheduler
Hello - Wondering if anyone can help. I am using: - Tomcat 6.0.14 on Linix - Java 1.5.0_13 - Spring 2.5.1 - Quartz scheduler 1.6.0 - commons logging 1.1.1 I am seeing the following in the tomcat catalina-2008-mm-dd.log file: SEVERE: Runtime error occured in main trigger firing loop. java.lang.NullPointerException at org.apache.commons.logging.LogFactory.getCachedFactory(LogFactory.java:9 79) at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:435) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685) at org.quartz.core.JobRunShell.init(JobRunShell.java:80) at org.quartz.impl.StdJobRunShellFactory.borrowJobRunShell(StdJobRunShellFa ctory.java:86) at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:357 ) 11-Aug-2008 5:44:01 PM org.quartz.core.QuartzSchedulerThread run Can anyone point me to how I might fix this? I am flummoxed. Any help is greatly appreciated. Thanks. Brian Parkinson Avanaing Inc. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Native library for Windows
Hello, I am getting the following error when starting up Tomcat 6.0.16 on Windows 2003: Sep 2, 2008 4:18:13 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Perl\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS Here's the catch, I do have the library installed in the bin directory (the very same bin referenced in the PATH above). I downloaded version 1.1.14.0 from http://tomcat.heanet.ie/native/1.1.14/binaries/win32/ and tried to just drop it in the bin directory. I don't know why it doesn't work. I also tried putting it in my windows\system32 directory, but with the same result. I've done a lot of research on the 'net, and found lots of other people that have this problem. However, most seem to have the problem resolved by putting the library in the right place, such as described in this earlier mailing list posting: http://www.mail-archive.com/users@tomcat.apache.org/msg29111.html Any ideas on what is going on here? Brian Clark
Re: Tomcat Native library for Windows
I downloaded the file http://tomcat.heanet.ie/native/1.1.14/binaries/win32/tcnative-1.dll I didn't change the name. - Original Message From: Mark Thomas [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, September 2, 2008 5:38:45 PM Subject: Re: Tomcat Native library for Windows Brian Clark wrote: Hello, I am getting the following error when starting up Tomcat 6.0.16 on Windows 2003: Sep 2, 2008 4:18:13 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Perl\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS Here's the catch, I do have the library installed in the bin directory (the very same bin referenced in the PATH above). I downloaded version 1.1.14.0 from http://tomcat.heanet.ie/native/1.1.14/binaries/win32/ and tried to just drop it in the bin directory. I don't know why it doesn't work. I also tried putting it in my windows\system32 directory, but with the same result. I've done a lot of research on the 'net, and found lots of other people that have this problem. However, most seem to have the problem resolved by putting the library in the right place, such as described in this earlier mailing list posting: http://www.mail-archive.com/users@tomcat.apache.org/msg29111.html Any ideas on what is going on here? Which file did you download. What is its current name? Mark - 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 Native library for Windows
Hmmm...on Windows, what is the difference between java.library.path and the Windows environmental variable PATH? I am not sure I understand your suggestion. I have my Java Classpath set to this, which contains my bootstrap.jar. C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\bootstrap.jar Should I just set, via JAVA_OPTS, my java.library.path to the same directory, since that's where I put my tcnative-1.dll file? -Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin I don't want to break anything. Setting the java.library.path won't make Tomcat stop looking at other libraries in other locations (like the built-in /lib directory) will it? Thanks, Brian - Original Message From: Martin Gainty [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, September 2, 2008 5:59:10 PM Subject: RE: Tomcat Native library for Windows AprLifecycleListener reads java.library.path so either start Java with -Djava.library.path java -Djava.library.path=LocationOfBinary bootstrap.jar (easier to place -Djava.library.path into JAVA_OPTS) OR set LD_LIBRARY_PATH=LocationOfBinary YMMV/ Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Tue, 2 Sep 2008 23:38:45 +0100 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat Native library for Windows Brian Clark wrote: Hello, I am getting the following error when starting up Tomcat 6.0.16 on Windows 2003: Sep 2, 2008 4:18:13 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\Perl\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS Here's the catch, I do have the library installed in the bin directory (the very same bin referenced in the PATH above). I downloaded version 1.1.14.0 from http://tomcat.heanet.ie/native/1.1.14/binaries/win32/ and tried to just drop it in the bin directory. I don't know why it doesn't work. I also tried putting it in my windows\system32 directory, but with the same result. I've done a lot of research on the 'net, and found lots of other people that have this problem. However, most seem to have the problem resolved by putting the library in the right place, such as described in this earlier mailing list posting: http://www.mail-archive.com/users@tomcat.apache.org/msg29111.html Any ideas on what is going on here? Which file did you download. What is its current name? Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get ideas on sharing photos from people like you. Find new ways to share. http://www.windowslive.com/explore/photogallery/posts?ocid=TXT_TAGLM_WL_Photo_Gallery_082008
Re: Tomcat Native library for Windows
Thanks for the suggestions. I just re-downloaded the file and now it works. I guess it was corrupted during the original download or something. Go figure. Brian - Original Message From: Caldarale, Charles R [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, September 2, 2008 7:19:32 PM Subject: RE: Tomcat Native library for Windows From: Brian Clark [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat Native library for Windows Hmmm...on Windows, what is the difference between java.library.path and the Windows environmental variable PATH? By default, none. I have my Java Classpath set to this, which contains my bootstrap.jar. Hopefully that's what shows in the tomcat6w.exe program, not something you're setting in the system environment variables. (If you do have a CLASSPATH environment variable, get rid of it - it will only break things.) Should I just set, via JAVA_OPTS, my java.library.path to the same directory, since that's where I put my tcnative-1.dll file? -Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin Don't bother, the JVM is already looking there, as shown by the INFO message. I don't want to break anything. Setting the java.library.path won't make Tomcat stop looking at other libraries in other locations (like the built-in /lib directory) will it? No, it won't break anything, but it's also not going to make it work. The java.library.path is used for native library DLLs only, not for classes. Check for ownership and access permissions on the file - insure that the account the Tomcat service is running under can access the DLL. By any chance, is this a 64-bit version of Windows Server? If so, and you're using a 64-bit JVM, you'll need the 64-bit version of the DLL. - 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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with running 64-bit Tomcat 6 as a Windows service
Hello, I am trying to get Tomcat 6.0.18 to run on my Win2k3 x64 edition server. I basically did the same thing talked about here: http://markmail.org/message/kptleixb6duxgwhm but it didn't work for me. I didn't use the service.bat install though. I installed the service manually with the sc.exe command. I am using the 64-bit 1.6.0_06 JDK. I don't get any Windows errors, the service start process just times out. My catalina and jakarta logs don't have anything useful. The logs seem to indicate that Tomcat started up fine--only it didn't. When I start up Tomcat from the command line, it works fine. I did have to check the box in tomcat6w.exe to allow the service to interact with the desktop to run it from the command line though. That seemed a little weird. Anyone successful in running Tomcat 6 as a 64-bit service? Thanks, Brian
Tomcat logging properties
At the bottom of my Tomcat 6.0.16 logging.properties file, I have the following entries: #org.apache.catalina.startup.ContextConfig.level = FINE #org.apache.catalina.startup.HostConfig.level = FINE #org.apache.catalina.session.ManagerBase.level = FINE #org.apache.catalina.core.AprLifecycleListener.level=FINE Aside from being commented out at the moment, I don't really know what these do. I couldn't find any documentation on them. Can someone point me to something that explains what these things might log? I'm struggling with an application issue, and my current logs and logging levels aren't showing me much. Thanks, Brian
Re: Tomcat logging properties
Yep, read through that, but it didn't tell me what those directives actually mean. Anyone have anything else? - Original Message From: Yassine [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 10, 2008 8:17:01 PM Subject: Re: Tomcat logging properties have a look here if you still need more info http://tomcat.apache.org/tomcat-6.0-doc/logging.html On Thu, Sep 11, 2008 at 2:10 AM, Brian Clark [EMAIL PROTECTED] wrote: At the bottom of my Tomcat 6.0.16 logging.properties file, I have the following entries: #org.apache.catalina.startup.ContextConfig.level = FINE #org.apache.catalina.startup.HostConfig.level = FINE #org.apache.catalina.session.ManagerBase.level = FINE #org.apache.catalina.core.AprLifecycleListener.level=FINE Aside from being commented out at the moment, I don't really know what these do. I couldn't find any documentation on them. Can someone point me to something that explains what these things might log? I'm struggling with an application issue, and my current logs and logging levels aren't showing me much. Thanks, Brian - 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: Fw: Tomcat Patch Management
So, do you think Automatic windows patch management and manual tomcat patch management would ideal as patch releases from Tomcat is very rare? Yes, that's the way we do it. We use WSUS for Windows patch management, and manually upgrade Tomcat as needed. This has not been an issue for us, as Tomcat is only updated a few times per year, not once per month like Windows is. If your environment is standardized enough, you could probably build your own MSI installer for Tomcat to make the upgrade process even easier. I've not done this, but there are inexpensive tools that you can get to help you do it. Brian
Re: Non-Heap Memory always increasing during deployment for TC 5.5.26/Solaris/JVM 1.5.0_16
I think you need to add one more line to your CATALINA_OPTS statement: -Dcom.sun.management.jmxremote=true If that does not help you, I'd try using port 6969 (the default) instead of . It should not matter, but I would at least give it a try as part of the troubleshooting process. You could also check to make sure you have access to the system on port , and that there are no firewalls (or iptables) in between you and the system preventing access to this port. Brian - Original Message From: emerson cargnin [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, September 16, 2008 8:40:59 AM Subject: Re: Non-Heap Memory always increasing during deployment for TC 5.5.26/Solaris/JVM 1.5.0_16 Correcting, in windows I wasn't actually connected to tomcat. For some reason it wouldn't allow me to choose a port with the following appended to catalina.bat set CATALINA_OPTS=-Dcom.sun.management.jmxremote.port= -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false Anyone knows why? regards emerson 2008/9/16 emerson cargnin [EMAIL PROTECTED]: Hi I tried to find about this in the tomcat faq, google, but still haven't found the reason for this strange behaviour. Every time I hot-deploy an application, the non-heap memory goes up. This ends up breaking the tomcat server with the message: Exception in thread RMI TCP Connection(13)-12.169.193.2 java.lang.OutOfMemoryError: PermGen space I profiled it and got the result in the image: http://home.zenly.co.uk/emerson/Console.png I tested in two different solaris servers witht he same behaviour. Even after I undeployed the application via manager app the memory didn't go down. I know I can get this non-heap memory up using -XX:MaxPermSize but shouldn't the memory go down after the undeployment? My Configuration: JVM: JVM 1.5.0_16 Server: SunOS boxname 5.10 Generic_120011-14 sun4v sparc SUNW,Sun-Fire-T200 Tomcat: 5.5.26 I just did the same test on windows and I couldn't see the non-heap memory going mad. Thanks a lot Emerson - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jstack and Tomcat 6 on Windows
Hello, I run Tomcat 6.0.x as a service on Windows 2003, using Sun JDK 1.6. I was trying to use the jstack program, part of the JDK, to get a stack dump from Tomcat/Java on my server. However, I ran into a problem. First of all, Tomcat on Windows seems to hide the JVM instance. Java doesn't show up in my process listing. I tried running jstack against the Tomcat PID but it errored out. Any idea how to make jstack work with Tomcat running as a service on Win2k3? BTW: I can get a stack dump using a tool like Sun's VisualVM, but I wanted to use jstack as part of a script, which I obviously can't do with VisualVM. Thanks, Brian