Re: IIS 6.0 / JK1.2.25 / Tomcat 5.5.20 - Service temporary unavailable
After two months with a system running smoothly, we are currently experiencing the same problems again (albeit less often). A little update: - The system's memory has been upgraded to 16 GB, Tomcat's memory settings are Xms4096m and Xmx10240m now. - We are using commons-dbcp 1.2.2 instead of Tomcat's internal pooling mechanism, so with org.apache.commons.dbcp.BasicDataSourceFactory as data source factory - Java version is Sun JDK 1.5.0.15 now. We are still at IIS 6.0, JK 1.2.26, Tomcat 5.5.20 and APR 1.1.14. - We have no automatic Tomcat reboots - Currently this 503 hang happens about once or twice a week Attached you will find a part of the isapi_redirector.log of today (the whole morning 503 errors occurred). I also tried to create a thread dump using StackTrace while Tomcat was hanging, but it didn't really work. The other JVM's were able to produce a thread dump, and since all JVM's are part of the same group of services, I have included this thread dump. Any idea, anyone? http://www.nabble.com/file/p20930602/20081210_isapi_redirect.zip 20081210_isapi_redirect.zip http://www.nabble.com/file/p20930602/20081210_threaddump.txt 20081210_threaddump.txt Jesse Klaasse wrote: Last Wednesday, I decided to try to use commons-dbcp (1.2.2) instead of the included naming-factory-dbcp.jar. Besides that, I have removed the validationQuery attribute, after reading about some problems with that. Since then, no problems have arised, Tomcat behaved nicely. I hope this finally has solved my problems. Still have to wait a few weeks before I can really say the system is stable. I keep my fingers crossed. -- View this message in context: http://www.nabble.com/IIS-6.0---JK1.2.25---Tomcat-5.5.20---%22Service-temporary-unavailable%22-tp18238896p20930602.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache Tomcat 6.0.18 Not Starting
Michael CC wrote: I am already running Apache Webserver on 8080. I changed the Connector Port to 8088 in the Server. xml file. When I test the service by calling http://localhost:8088/ I get the Internet Explorer cannot display the webpage. Maybe another back-reference to http://marc.info/?l=tomcat-userm=122823060425367w=2 Items #1 and #7 ? :-) Just kidding. Seriously now : - the first logfile excerpt that you sent looks totally normal, and does not look like Tomcat is Not Starting. It does start, and says so. - there can be multiple reasons why Internet Explorer would come up with this page. The first one being that this is an internal error page from IE, which it displays instead of the page it (maybe) gets from Tomcat. It may hide a more significant error page from Tomcat, but which IE in its wisdom decides not to show. Try the following, after you start Tomcat : - open a Command window - enter netstat -an | more Do you see somewhere a line like : TCP0.0.0.0:8088 0.0.0.0:0 LISTEN (the important part is the :8088 and the LISTEN) ? - then, if the line above is there, enter : telnet localhost 8088 does it connect ? If it does, enter (exactly) : GET / HTTP/1.1CR CR (where CR stands for the Return key) What is happening ? Alternatively, if you have Perl installed on that system, enter : lwp-request -m GET -Sed http://localhost:8088/ it is much more informative. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
modjk windows connection_pool_size need to be sure
Hi the list, i've two litlles question about using modjk on windows apache mpm_winnt(i'am not using windows for fun...) as i understand the documentation my worker.template.connection_pool_size=200 must be adequate with he the ThreadsPerChildin the windows mpm i have 5 tomcats servers with 200 thread in modjk param and i fix the apache ThreadsPerChild to 1400 . so the idea is 1000 thread can work with tomcat and 400 dedicated only to static content my question are -my understanding of mod jk connection_pool_size is correct ? -i found very few doc on the winnt_mpm tunning ,is the 1400 value for ThreadsPerChild is a correct value(the server is good boy cpu*2/2GB ram) regards Marc (who want to migrate all this f... production on linux) -- View this message in context: http://www.nabble.com/modjk-windows-connection_pool_size-need-to-be-sure-tp20932440p20932440.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can not fail over a web service call using mod_jk
Michael Ludwig schrieb: Rainer Jung schrieb am 09.12.2008 um 22:17:16 (+0100): I'm looking forward to httpd 2.4 with mod_luau aka mod_wombat, an embedded Lua interpreter that has access to httpd objects (like the request object) and will allow us to inject custom logic e.g. for balancing and error reaction. [OT] Good old (but not exactly light-weight) mod_perl can do all that. Although I don't know how good its threading implementation is. Of course bot I think the httpd project was looking for something much smaller. They use mod_perl for example for their test framework and they know it pretty well. Lua doesn't do threading as well (perl does sort of), but since Lua is so small, one would use a pool of Lua interpreters. It can do concurrent processing though, but there's no memory shared between the coprocesses. Regards, Rainer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: modjk windows connection_pool_size need to be sure
killbulle schrieb: Hi the list, i've two litlles question about using modjk on windows apache mpm_winnt(i'am not using windows for fun...) as i understand the documentation my worker.template.connection_pool_size=200 must be adequate with he the ThreadsPerChildin the windows mpm i have 5 tomcats servers with 200 thread in modjk param and i fix the apache ThreadsPerChild to 1400 . so the idea is 1000 thread can work with tomcat and 400 dedicated only to static content my question are -my understanding of mod jk connection_pool_size is correct ? -i found very few doc on the winnt_mpm tunning ,is the 1400 value for ThreadsPerChild is a correct value(the server is good boy cpu*2/2GB ram) For Apache the connection_pool_size can be determined automatically by mod_jk. You can check that by starting Apache with JkLogLevel debug (don't do that in normal production) and look for a line like setting connection pool size to in the JkLogFile. You should find the same size in that log line, that you used for ThreadsPerChild. Make sure you use a recent mod_jk version, like 1.2.27. Concerning the amount of threads in Tomcat and in Apache. The basic problem is, that whenever you have more threads in Apache than in one of your Tomcats, it could happen, that one of those threads will not be able to connect to Tomcat, because all Tomcat threads might be busy. Then you'll run into a timeout. You can make that less likely, by using connection_pool_size equals to your Tomcat thread size and not equal to the bigger ThreadsPerChild. But that would only mean, that the problem already happens inside Apache (an Apache thread will not be able to aquire a local pool object) and will be determined faster. Another possibility is to use the additional Tomcat Native connector, which decouples threads from connections on the Tomcat side. In general all this comes into play when things go bad, e.g. your application beacomes slow or gets stuck in Tomcat. Then requests pile up in front and your whole system can get unresponsive. Therefore it is very important to set good timeout values for mod_jk (see the mod_jk timeouts documentation page). I would expect, that you will get the most robust system by setting your ThreadsPerChild also to 200 and using good mod_jk timeouts. This sounds strange, but in general your bottleneck is not the number of threads. If it is a throughput type application, you will saturate your CPU (or bandwidth or memory) much earlier than you'll saturate a 200 threads thread pool. The number of threads only gets limiting, once your application gets slow. But in that case it doesn't help to accept more and more request and put them on threads. Rule of Thumb: Concurrency = Throughput * ResponseTime Concurrency: Number of threads actually in parallel use Throughput: Number of Requests per second (load) ResponseTime: Average Response Time in seconds So you only need a lot of threads, when your load is excessively high, or your response times are, e.g. when allowing huge downloads over slow lines. Example: How many threads do you need for static content? Assumption: Request rate 500 requests per second, average response time 50 milliseconds. Then on average you'll need 25 threads for static content. Example: How many threads for dynamic content= Assumption: Request rate 50 requests per second, average response time 3 seconds. Then on average you'll need 150 threads for dynamic content. Regards, Rainer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat-- Web Server or Web Container?
Hi I have a doubt which is breaking my head and I dont find good definition for it... What is the difference between Web Server and Web Container? What are the roles of Web Server and Web Container ? is Tomcat a Web Server or Web Container ..and why? I would e very Thankfull to find a response for it.:) Regards, Thangavel Sankaranarayanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: IIS 6.0 / JK1.2.25 / Tomcat 5.5.20 - Service temporary unavailable
Hi Jesse, Jesse Klaasse schrieb: After two months with a system running smoothly, we are currently experiencing the same problems again (albeit less often). A little update: - The system's memory has been upgraded to 16 GB, Tomcat's memory settings are Xms4096m and Xmx10240m now. When using big heaps, you need to take extra effort to get your GC settings right. Do you have GC-Logs? What are the JVM options you use to start Tomcat? - We are using commons-dbcp 1.2.2 instead of Tomcat's internal pooling mechanism, so with org.apache.commons.dbcp.BasicDataSourceFactory as data source factory - Java version is Sun JDK 1.5.0.15 now. We are still at IIS 6.0, JK 1.2.26, Tomcat 5.5.20 and APR 1.1.14. - We have no automatic Tomcat reboots - Currently this 503 hang happens about once or twice a week Attached you will find a part of the isapi_redirector.log of today (the whole morning 503 errors occurred). I also tried to create a thread dump using StackTrace while Tomcat was hanging, but it didn't really work. The other JVM's were able to produce a thread dump, and since all JVM's are part of the same group of services, I have included this thread dump. The attached thread dumps do not belong to Tomcat. They are from the Gauss VIP Content Server. Any idea, anyone? First of all I assume you are talking about the event starting at 07:09? The initial problems are Timeouts (Winsock 10060). So again we need to find out, why things took to long on the backend. Thread Dumps would be a good start ... As we don't have them: - Check without APR - Check whether your GC takes to long http://www.nabble.com/file/p20930602/20081210_isapi_redirect.zip 20081210_isapi_redirect.zip http://www.nabble.com/file/p20930602/20081210_threaddump.txt 20081210_threaddump.txt Regards, Rainer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat caching of static resources?
Hi all, is it possible to cache static images and .js files in Tomcat? (I'm using version 6). When i look at the browser cache it looks like the browser is downloading all page assets for every call, including some very large .js files. I've come across a link which may be the same issue but the solution didn't resolve the problem (especially if deploying via war files) and i cant believe there isn't a standard Tomcat configuration for this? http://www.symphonious.net/2007/06/19/caching-in-tomcat/ Thanks in advance. Dave
Re: Tomcat-- Web Server or Web Container?
tomcat is a web server for it serves http requests. tomcat is a servlet container according to the servlet spec. there is no such thing as web container. regards Leon On Wed, Dec 10, 2008 at 1:19 PM, Thangavel Sankaranarayanan [EMAIL PROTECTED] wrote: Hi I have a doubt which is breaking my head and I dont find good definition for it... What is the difference between Web Server and Web Container? What are the roles of Web Server and Web Container ? is Tomcat a Web Server or Web Container ..and why? I would e very Thankfull to find a response for it.:) Regards, Thangavel Sankaranarayanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
You're right, maybe I put this in the wrong forum. Below is a stack trace of a request when it first enters my code on a successful request. In the error case, my code is not being invoked. I believe that all of the code below (except the top 4 call frames) are coyote and catalina code. I thought this was the correct forum for this question - perhaps not? What I meant by 'Tomcat processing the request' was that Tomcat receives the HTTP request and passes it into my code. I assumed the request is being blocked in Tomcat... When I recreate my problem and look at the threads in Tomcat, the only hung threads are the ones waiting for a free DB connection in c3p0 code. There is no trace of the incoming commit requests, which I do believe are successfully sent from my client (according to my logs). ServiceProxyServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 709 ServiceProxyServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 802 GWTShellServlet.service(HttpServletRequest, HttpServletResponse) line: 253 GWTShellServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 802 ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 237 ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 157 StandardWrapperValve.invoke(Request, Response, ValveContext) line: 214 StandardValveContext.invokeNext(Request, Response) line: 104 StandardPipeline.invoke(Request, Response) line: 520 StandardContextValve.invokeInternal(Wrapper, Request, Response) line: 198 StandardContextValve.invoke(Request, Response, ValveContext) line: 152 StandardValveContext.invokeNext(Request, Response) line: 104 StandardPipeline.invoke(Request, Response) line: 520 StandardHostValve.invoke(Request, Response, ValveContext) line: 137 StandardValveContext.invokeNext(Request, Response) line: 104 ErrorReportValve.invoke(Request, Response, ValveContext) line: 118 StandardValveContext.invokeNext(Request, Response) line: 102 StandardPipeline.invoke(Request, Response) line: 520 StandardEngineValve.invoke(Request, Response, ValveContext) line: 109 StandardValveContext.invokeNext(Request, Response) line: 104 StandardPipeline.invoke(Request, Response) line: 520 StandardEngine(ContainerBase).invoke(Request, Response) line: 929 CoyoteAdapter.service(Request, Response) line: 160 Http11Processor.process(InputStream, OutputStream) line: 799 Http11Protocol$Http11ConnectionHandler.processConnection(TcpConnection, Object[]) line: 705 TcpWorkerThread.runIt(Object[]) line: 577 ThreadPool$ControlRunnable.run() line: 683 ThreadWithAttributes(Thread).run() line: 619 Caldarale, Charles R wrote: Tomcat doesn't process requests - your webapp does. Take a thread dump and find out where your webapp is stuck and failing to reach its commit points. - Chuck -- View this message in context: http://www.nabble.com/Tomcat-thread-pool-question-tp20915752p20935709.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat resources
Caldarale, Charles R wrote: From: Kees de Kooter [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat resources Is this some would-be turing machine babbling away or is there are genuine question here? Might be time to repost Andre's list... http://marc.info/?l=tomcat-userm=122823060425367w=2 lol. i go away for a few weeks... i could have never known that this existed. p - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat-- Web Server or Web Container?
Hi, Web-server is a tool, which handles HTTP requests. Apache is web-server. Microsoft IIS is web-server. Thttpd is web-server too. Servlet-container (according to specification of servlets) is something, that runs servlets in special environment. Web-server may work with CGI or static pages or servlets. Tomcat is web-server AND servlet-container. Kazakevich Ilya, MCP, SCJP -Original Message- From: Thangavel Sankaranarayanan [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2008 3:19 PM To: Tomcat Users List Subject: Tomcat-- Web Server or Web Container? Hi I have a doubt which is breaking my head and I dont find good definition for it... What is the difference between Web Server and Web Container? What are the roles of Web Server and Web Container ? is Tomcat a Web Server or Web Container ..and why? I would e very Thankfull to find a response for it.:) Regards, Thangavel Sankaranarayanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
From: ped [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat thread pool question I believe that all of the code below (except the top 4 call frames) are coyote and catalina code. It's the top frames that are critical, of course, since they show where the thread is stuck. When I recreate my problem and look at the threads in Tomcat, the only hung threads are the ones waiting for a free DB connection in c3p0 code. Because you're not releasing the connections back to the pool. There is no trace of the incoming commit requests If I have interpreted that statement correctly, you have a fatally flawed application architecture. Each request should complete all its processing - including committing or rolling back database updates and releasing connections - before returning a response to the client. Otherwise, you have put yourself at the mercy of the client to release resources; what if the client never submits the commit request? If you need to maintain some state information about the client from one request to the next, use the Session object, not a database connection. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
It's the top frames that are critical, of course, since they show where the thread is stuck. That stack trace is not from when the thread is hung - I put a bp on the entry point to my code so that I could see what code an incoming request must go thru before being passed to my code - my theory being that my commit requests were stuck somewhere in there. I don't believe my code is stuck in the top 4 frames, since when I recreate the problem, there are no threads that are sitting in that code - I see no evidence of the commit requests that have been sent from the client. Because you're not releasing the connections back to the pool. Yes - my requests that are attempting to release the connections back to the pool are not arriving in my code. My client is sending them, but they are not arriving at my server. If I have interpreted that statement correctly, you have a fatally flawed application architecture. Each Understood - we are in the process of re-writing some of this logic. However, poor design or not, I see no reason why Tomcat stops processing incoming requests when an underlying pool (that it should have no knowledge of) has been depleted. I am pursuing this point because it occurs to me that Tomcat is not behaving as I would expect - perhaps I misunderstand what Tomcat is doing, in which case I'm looking for guidance. Perhaps there is a subtle bug here, or misconfiguration on my part (other than the obvious undersizing of the pool - but that should just cause poor performance, rather than non-functional code). -- View this message in context: http://www.nabble.com/Tomcat-thread-pool-question-tp20915752p20937425.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat caching of static resources?
From: David Smith [mailto:[EMAIL PROTECTED] Subject: Tomcat caching of static resources? is it possible to cache static images and .js files in Tomcat? Think about what you just asked for: how would caching static resources in the server avoid them being downloaded by the browser? It's the browser that must cache the information to avoid the redundant downloads. When i look at the browser cache it looks like the browser is downloading all page assets for every call, including some very large .js files. As stated in one of the (correct) responses to the article you referenced: So the first thing is to get control of the cache headers. Without them, the cache can not know what to do. What are you doing to control the headers? What headers are being used for the large .js files? but the solution didn't resolve the problem (especially if deploying via war files) The original author of the article is clearly unfamiliar with Tomcat, caching, and security (e.g., not knowing where a context.xml file goes, and erroneously stating it doesn't work with a .war file). i cant believe there isn't a standard Tomcat configuration for this? For what? Caching static resources on the server end doesn't alter the amount of network traffic generated. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
From: ped [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat thread pool question Perhaps there is a subtle bug here, or misconfiguration on my part It's not subtle - it's blatant. The db connection pool is exhausted, all of the Tomcat threads are waiting for db connections to become available, and further requests are queued in the OS TCP/IP stack. You have a designed-in deadlock in your application, and there's nothing Tomcat can do about that. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat 6.0.18 clustering.. session getting replicated partially
after modifying the cart, you must add session.setAttribute(cart,cart) to trigger replication Filip rohit aman wrote: Hey Filip, sorry abt that. here is the example web application zip file: http://www.yousendit.com/download/TTZuRFFhbEo5eFh2Wmc9PQ please unzip it, put it in your webapps directory, then you should be able to access the cart using https://hostname/clusterex/sessions/carts.jsphttps://%3chostname%3e/clusterex/sessions/carts.jsp juss FYI...this is how u can reproduce it 1) set the LB for sticky sessions 2) start tomcat1 3) access the cart and add some items (lets say 6 items) 4) now start tomcat2 5) add some more items ( lets say 3 more...so total items would be 6+3=9) (here request still goes to tomcat 1 because of sticky sessions setup) 6) stop tomcat1 7) add some more items (now request goes to tomcat2, here we can see that the new item gets added as 7th item to the first 6 items and the 3 items we added later can not be seen) Thanks for the help rohit On Tue, Nov 25, 2008 at 10:20 AM, Filip Hanik - Dev Lists [EMAIL PROTECTED] wrote: you're attachment didn't go through, just post a complete example somewhere on the web. for free support, you can't expect the other guy (me in this case) to have to spend time setting up to replicate your environment instead, you do the legwork, and you get help for free, not a bad trade if you ask me Filip rohit aman wrote: Hi Filip, All I did was to modify sessions application that comes with tomcat. It's just two simple changes shown below. 1) Replace the DummCart.class in tomcat-home\apache-tomcat-6.0.18\webapps\examples\WEB-INF\classes\sessions with the attached one. 2)mark the web.xml in tomcat-home\apache-tomcat-6.0.18\webapps\examples\WEB-INF as distributable by adding /distributable tag 3)then access this by using https://localhost/examples/jsp/sessions/carts.jsp Please let me know...Thanks for doing this Rohit On Mon, Nov 24, 2008 at 6:55 PM, Filip Hanik - Dev Lists [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: post a sample app, and we can test it out Filip rohit aman wrote: Hi, I had setup a tomcat cluster with two nodes. followed the instructions from tomcat 6 clustering how to document. I created a sample application to test out my cluster. This application has a cart where u can add items. now, the problem is, not all session variables are getting replicated. below is the scenario.. 1)start tomcat 1 2)access the cart add items to it ( lets say added 5 items ) 3)start tomcat 2 4)add some more items ( 3 more...so totally 8) ( this is done using tomcat 1 again because my LB is configured for sticky sessions) 5)stop tomcat 1 6)access the cart (now the request goes to tomcat 2)...here *I can only see the first 5 items where as it should be 8. *So, the next three did not get replicated. whichever session or session attribute gets created when both nodes are running is not getting replicated for some reason. I am monitoring both nodes with Jconsole. In Jconsole the number of session for the application = sessions in node 1 + sessions in node 2. So, this says that sessions are being replicated. But, I am not sure why I am not able to access all sessions/sessionAttributes. Any help is very much appreciated. Thanks Rohit - To start a new topic, e-mail: users@tomcat.apache.org mailto:users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Set and pick FROM in context.xml
Hello! My context.xml looks like: [CODE] Resource name=mail/Session auth=Container type=javax.mail.Session mail.store.protocol=pop3 mail.pop3.host=mail.server mail.transport.protocol=smtp mail.smtp.host=mail.server mail.smtp.port=portNo mail.smtp.auth=true mail.smtp.user=[EMAIL PROTECTED] password=mypass [/CODE] I want to put FROM also in this Context. For now it's hard-coded: [CODE]sender.setFrom([EMAIL PROTECTED]); [/CODE] I'm picking values with: [CODE] Object sess = ctx.lookup(mail/Session); session = (javax.mail.Session) sess; [/CODE] How can i set the FROM value with contex.xml? Regards -- View this message in context: http://www.nabble.com/Set-and-pick-FROM-in-context.xml-tp20938349p20938349.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem in pooled database
hello I am trying to manage pooled database (postgresql).I am encountering this problem : java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.activation.DataSource I will appreciate if you supply any information to me to overcome the problem kind regards Ahmet Temiz
Re: access to all sessions
Hi Leon, How bad of an idea is it to set privileged=true in my context? Wouldn't this give me access to the things I want (and much more that I probably don't want access to)? Our environment is such that maybe this isn't totally out of the question, we run TC in a piece of hardware to serve content to the attached touchscreen. There is only ever one webapp running, ROOT, and that is really all that will ever be running. Tim Leon Rosenberg wrote: It depends on your definition of easier... you could provide your own session manager with your own session implementation, which supports such a mechanism or patch the existing StandartSession.java. I don't know whether you'd call it easy :-) Leon On Thu, Dec 4, 2008 at 8:09 PM, Timothy J Schumacher [EMAIL PROTECTED] wrote: Hi Leon, Thanks for the info. So, if I simply wanted to tell TC to invalidate all sessions is there something easier I could do? Tim Leon Rosenberg wrote: Hello Tim, there is no easy and direct way to do it. What you can do is to create a SessionListener (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html), register it as listener in the web.xml and store references to the sessions upon creation somewhere (read map). But beware, you have to be cautious a) not to create a memory leak by not letting tomcat to remove outdated sessions and b) synchronize accesses to your map and sessions without creating dead locks (since 1.4 doesn't have all the fancy concurrency stuff). regards Leon On Thu, Dec 4, 2008 at 7:32 PM, Timothy J Schumacher [EMAIL PROTECTED] wrote: Hi, I have TC 5.0.12 and java 1.4.1_04. Unfortunately, I am stuck using these versions for now... I am trying to figure out how to access/manipulate all the sessions for my web app. I guess I want something similar to the manager application, but I don't want to have to run the manager application. Does anyone know of a good reference to learn more about how this works? I looked a little bit at the docs but it was not clear to me how to access this data. Thanks! Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
all of the Tomcat threads are waiting for db connections to become available So that implies that Tomcat only supports a max of 3 threads... I uncommented: Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=1/ in Tomcat's server.xml. But I still see the problem when I cap my db connection pool at 3. I would think that I should be able to increase the number of threads available to Tomcat to prevent this problem (I'm not saying that is the correct solution to my problem - I fully understand that our design is the root of this problem). -- View this message in context: http://www.nabble.com/Tomcat-thread-pool-question-tp20915752p20939919.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in pooled database
Patient says: It hurts when I do this... (demonstrates movement) Doctor says: Don't do that. Moral of the story is the error message is pretty clear. If your class has imported javax.activation.* and javax.sql.*, you may have to be more specific on the type of your datasource variable: javax.sql.DataSource dbDataSrc = /* code for retrieving the datasource */ For less sarcasm and more help, please feed us more details like say a snippet of code where this error occurs, what was imported for that class, and relevant parts of your config. --David ahmet temiz wrote: hello I am trying to manage pooled database (postgresql).I am encountering this problem : java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.activation.DataSource I will appreciate if you supply any information to me to overcome the problem kind regards Ahmet Temiz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in pooled database
Exception has taken place here: DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/bzk2); this is my Application-specific resource (context.xml) ?xml version=1.0 encoding=UTF-8? Context path=/home/orkun/workspace5/w1 docBase=w1 crossContext=true reloadable=true debug=1 Resource name=jdbc/bzk2 auth=Container type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql:// 127.0.0.1:5432/bzk2 username=orkun password=22 maxActive=20 maxIdle=10 maxWait=-1 / /Context thank you 2008/12/10 David Smith [EMAIL PROTECTED] Patient says: It hurts when I do this... (demonstrates movement) Doctor says: Don't do that. Moral of the story is the error message is pretty clear. If your class has imported javax.activation.* and javax.sql.*, you may have to be more specific on the type of your datasource variable: javax.sql.DataSource dbDataSrc = /* code for retrieving the datasource */ For less sarcasm and more help, please feed us more details like say a snippet of code where this error occurs, what was imported for that class, and relevant parts of your config. --David ahmet temiz wrote: hello I am trying to manage pooled database (postgresql).I am encountering this problem : java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.activation.DataSource I will appreciate if you supply any information to me to overcome the problem kind regards Ahmet Temiz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in pooled database
Ok... so what do the import statements at the top of that file look like? Seems to me java has taken DataSource to mean javax.activation.DataSource instead of javax.sql.DataSource. That's probably because of the imports at the top of your source file. --David ahmet temiz wrote: Exception has taken place here: DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/bzk2); this is my Application-specific resource (context.xml) ?xml version=1.0 encoding=UTF-8? Context path=/home/orkun/workspace5/w1 docBase=w1 crossContext=true reloadable=true debug=1 Resource name=jdbc/bzk2 auth=Container type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql:// 127.0.0.1:5432/bzk2 username=orkun password=22 maxActive=20 maxIdle=10 maxWait=-1 / /Context thank you 2008/12/10 David Smith [EMAIL PROTECTED] Patient says: It hurts when I do this... (demonstrates movement) Doctor says: Don't do that. Moral of the story is the error message is pretty clear. If your class has imported javax.activation.* and javax.sql.*, you may have to be more specific on the type of your datasource variable: javax.sql.DataSource dbDataSrc = /* code for retrieving the datasource */ For less sarcasm and more help, please feed us more details like say a snippet of code where this error occurs, what was imported for that class, and relevant parts of your config. --David ahmet temiz wrote: hello I am trying to manage pooled database (postgresql).I am encountering this problem : java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.activation.DataSource I will appreciate if you supply any information to me to overcome the problem kind regards Ahmet Temiz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
From: ped [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat thread pool question So that implies that Tomcat only supports a max of 3 threads... Obviously untrue, since the default is 200. I uncommented: Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=1/ in Tomcat's server.xml. But I still see the problem when I cap my db connection pool at 3. A useless exercise unless you changed all of the Connector elements you're using to utlize the executor; if you didn't, each Connector has its own thread pool. I would think that I should be able to increase the number of threads available to Tomcat to prevent this problem You cannot fix this problem in Tomcat, since you have turned over responsibility for server resources to the client(s). The Tomcat thread pool is finite; we'll call the maxThread value T. Likewise, the db connection pool is finite, and we'll call its size D. The client makes some number of requests that are not committed, which we'll label R. Anytime R T + D, you're stuck. The first D requests get processed, *do not* return the db connection to the pool, respond to the client, and return to the thread pool. The next T requests get stuck in the db pool waiting for db connections to become available. At this point, the db pool is fully consumed, the thread pool is fully consumed, and some number of subsequent requests are held in the platform's TCP/IP stack. Since you have no control over the clients (at least in the real world), you cannot ever configure T and D large enough to exceed all possible values of R; one of them would have to be infinite. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Mbean accessible as a singleton across a tomcat cluster?
How can I deploy an Mbean so it is accessible as a singleton across a tomcat cluster. So far have been unable to use the Mbean as a singleton, each cluster member seems to be getting its own Mbean instance. Any help is appreciated. Thanks! -- View this message in context: http://www.nabble.com/Mbean-accessible-as-a-singleton-across-a-tomcat-cluster--tp20940795p20940795.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Context placement question
Hi, I am in the process to convert our production Apache2 + mod_jk + Tomcat setup on Max OSx 10.5 to a cluster, so some applications can run on the cluster, other applications will run only on one of the two participating balance members. The Apache in one of the machines will also act as a reversed proxy. There will be just one tomcat instance per machine. The default context.xml in the conf directory - $CATALINA_BASE/conf/ context.xml -, starts up the StandardContext by default if I understand well. It will be good for those webapps that do not have their own context.xml. Now I have two questions: 1. If the default of the $CATALINA_BASE/conf/context.xml trigers the StandardContext, can I have ReplicatedContext for individual webapps that I want to run on the cluster? 2. If the answer is yes for the first question then what is the best place to put the Context path= docBase=ROOT className=org.apache.catalina.ha.context.ReplicatedContext element ? The http://tomcat.apache.org/tomcat-6.0-doc/config/context.html documentation suggests two places: a. CATALINA_BASE/conf/[enginename]/[hostname]/webapp.xml, where webapp would be unique for every webapp running on the cluster, b. inside the application's /META-INF/context.xml My major concern is that modification to the webapps context. xml or webapp.xml containing context info, should not interfere with the running of other webapps in production environment. If there is a good article about it please give me the URL. Thanks ahead, János - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
The Tomcat thread pool is finite; we'll call the maxThread value T. Likewise, the db connection pool is finite, and we'll call its size D. The client makes some number of requests that are not committed, which we'll label R. Anytime R T + D, you're stuck. Yes - that's my understanding of the problem. But as I change D (my db connection pool size) and R, Tomcat's maxThread value (T) seems to be very small (1 or 2). That surprised me, and led me to think something else was going on here. -- View this message in context: http://www.nabble.com/Tomcat-thread-pool-question-tp20915752p20941231.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Context placement question
From: János Löbb [mailto:[EMAIL PROTECTED] Subject: Context placement question The default context.xml in the conf directory - $CATALINA_BASE/conf/ context.xml -, starts up the StandardContext by default No - it merely adds attribute values for *all* Context elements, even for webapps that have their own. A webapp *may* override the attribute values in conf/context.xml, but if it doesn't do so explicitly, the ones in conf/context.xml apply in addition to any attributes the one from the webapp specifies. can I have ReplicatedContext for individual webapps that I want to run on the cluster? Yes, but that's completely independent of conf/context.xml, *unless* you modify that to include a className attribute. 2. If the answer is yes for the first question then what is the best place to put the Context path= docBase=ROOT className=org.apache.catalina.ha.context.ReplicatedContext element ? Normally, the best place is to keep it with the webapp: ROOT/META-INF/context.xml; alternatively, you may place it in conf/Catalina/[host]/ROOT.xml. In either case, the path and docBase attributes must not be set. You would normally use the latter location only if you want to package your webapp for distribution and be able to set (e.g., a database resource) attributes without modifying anything inside the package. My major concern is that modification to the webapps context. xml or webapp.xml containing context info, should not interfere with the running of other webapps in production environment. It won't, if you do what's described above. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in pooled database
Now, it seems ok after disabling javax.activation.DataSource; //import javax.activation.DataSource; import javax.sql.DataSource; thank you 2008/12/10 David Smith [EMAIL PROTECTED] Ok... so what do the import statements at the top of that file look like? Seems to me java has taken DataSource to mean javax.activation.DataSource instead of javax.sql.DataSource. That's probably because of the imports at the top of your source file. --David ahmet temiz wrote: Exception has taken place here: DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/bzk2); this is my Application-specific resource (context.xml) ?xml version=1.0 encoding=UTF-8? Context path=/home/orkun/workspace5/w1 docBase=w1 crossContext=true reloadable=true debug=1 Resource name=jdbc/bzk2 auth=Container type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql:// 127.0.0.1:5432/bzk2 username=orkun password=22 maxActive=20 maxIdle=10 maxWait=-1 / /Context thank you 2008/12/10 David Smith [EMAIL PROTECTED] Patient says: It hurts when I do this... (demonstrates movement) Doctor says: Don't do that. Moral of the story is the error message is pretty clear. If your class has imported javax.activation.* and javax.sql.*, you may have to be more specific on the type of your datasource variable: javax.sql.DataSource dbDataSrc = /* code for retrieving the datasource */ For less sarcasm and more help, please feed us more details like say a snippet of code where this error occurs, what was imported for that class, and relevant parts of your config. --David ahmet temiz wrote: hello I am trying to manage pooled database (postgresql).I am encountering this problem : java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.activation.DataSource I will appreciate if you supply any information to me to overcome the problem kind regards Ahmet Temiz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How do I uninstall tomcat
Hi Folks, I recently installed tomcat version 6 on my Windows XP laptop in order to test some Java servlets. Windows XP is fully up to date with all service updates and security updates. I believe that I followed all the installation instructions correctly and Tomcat reports that it is running using port 8080 very soon after I start it. I tried to fire up the examples supplied with Tomcat by using the address in IE http://localhost:8080, as described in the Tomcat instructions. This resulted in an Error 404 which stated that the server was running but the webpages could not be accessed. I also tried to run my test servlet with the same result. I tried stopping Tomcat to check whether there was another webserver running. When I tried to run my test servlet without Tomcat running, it failed with an error saying that there was no service. From this I assume that there was not another webserver running. I discovered that I had multiple Java directories in C:\Program Files and have decided to start completely from scratch by uninstalling all Java versions and Tomcat. I have successfully uninstalled all Java instances and checked that their directories have been removed from C:\Program Files. However, I cannot find any standad method of uninstalling Tomcat, which is installed at c:\tomcat It does not appear in the list of installed programs in the Control Panel/Add or Remove Programs list. Nor can I find any program called uninstall in the tomcat directories. Nor can I find any reference to uninstall in any of the tomcat documentation. I have tried searching the Tomcat wiki for uninstall information but got zero responses. Can I just delete the tomcat directory? or will this leave orphan Windows registry elements hanging around? I would not want to edit the Windows registry directly myself at my currently level of knowledge and experience. Or is their an uninstall process / program that I can use? I hope that someone can help me. Best Regards, Pete -- View this message in context: http://www.nabble.com/How-do-I-uninstall-tomcat-tp20941964p20941964.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem in pooled database
You could also be more explicit in your code if you import two classes of the same name from different packages: javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup( java:comp/env/jdbc/bzk2 ) ; --David ahmet temiz wrote: Now, it seems ok after disabling javax.activation.DataSource; //import javax.activation.DataSource; import javax.sql.DataSource; thank you 2008/12/10 David Smith [EMAIL PROTECTED] Ok... so what do the import statements at the top of that file look like? Seems to me java has taken DataSource to mean javax.activation.DataSource instead of javax.sql.DataSource. That's probably because of the imports at the top of your source file. --David ahmet temiz wrote: Exception has taken place here: DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/bzk2); this is my Application-specific resource (context.xml) ?xml version=1.0 encoding=UTF-8? Context path=/home/orkun/workspace5/w1 docBase=w1 crossContext=true reloadable=true debug=1 Resource name=jdbc/bzk2 auth=Container type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql:// 127.0.0.1:5432/bzk2 username=orkun password=22 maxActive=20 maxIdle=10 maxWait=-1 / /Context thank you 2008/12/10 David Smith [EMAIL PROTECTED] Patient says: It hurts when I do this... (demonstrates movement) Doctor says: Don't do that. Moral of the story is the error message is pretty clear. If your class has imported javax.activation.* and javax.sql.*, you may have to be more specific on the type of your datasource variable: javax.sql.DataSource dbDataSrc = /* code for retrieving the datasource */ For less sarcasm and more help, please feed us more details like say a snippet of code where this error occurs, what was imported for that class, and relevant parts of your config. --David ahmet temiz wrote: hello I am trying to manage pooled database (postgresql).I am encountering this problem : java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.activation.DataSource I will appreciate if you supply any information to me to overcome the problem kind regards Ahmet Temiz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I uninstall tomcat
From: BoyePeter [mailto:[EMAIL PROTECTED] Subject: How do I uninstall tomcat Can I just delete the tomcat directory? If you installed Tomcat from the .zip download, then yes. If you ran the service.bat script to create a Tomcat service, run service.bat remove first. If you had used the .exe download, tomcat would be in a completely different directory, and there would be an entry in the Windows program list (I think - I dislike the .exe version and don't use it myself). - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem in pooled database
also if you are going to be opening up more than 1 connection I would suggest using connection-pool Here is Oracle ex. http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-datasource/doc/how-to-datasource.html#conf (and follow david's advice) 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: Wed, 10 Dec 2008 14:05:14 -0500 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: problem in pooled database You could also be more explicit in your code if you import two classes of the same name from different packages: javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup( java:comp/env/jdbc/bzk2 ) ; --David ahmet temiz wrote: Now, it seems ok after disabling javax.activation.DataSource; //import javax.activation.DataSource; import javax.sql.DataSource; thank you 2008/12/10 David Smith [EMAIL PROTECTED] Ok... so what do the import statements at the top of that file look like? Seems to me java has taken DataSource to mean javax.activation.DataSource instead of javax.sql.DataSource. That's probably because of the imports at the top of your source file. --David ahmet temiz wrote: Exception has taken place here: DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/bzk2); this is my Application-specific resource (context.xml) ?xml version=1.0 encoding=UTF-8? Context path=/home/orkun/workspace5/w1 docBase=w1 crossContext=true reloadable=true debug=1 Resource name=jdbc/bzk2 auth=Container type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql:// 127.0.0.1:5432/bzk2 username=orkun password=22 maxActive=20 maxIdle=10 maxWait=-1 / /Context thank you 2008/12/10 David Smith [EMAIL PROTECTED] Patient says: It hurts when I do this... (demonstrates movement) Doctor says: Don't do that. Moral of the story is the error message is pretty clear. If your class has imported javax.activation.* and javax.sql.*, you may have to be more specific on the type of your datasource variable: javax.sql.DataSource dbDataSrc = /* code for retrieving the datasource */ For less sarcasm and more help, please feed us more details like say a snippet of code where this error occurs, what was imported for that class, and relevant parts of your config. --David ahmet temiz wrote: hello I am trying to manage pooled database (postgresql).I am encountering this problem : java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.activation.DataSource I will appreciate if you supply any information to me to overcome the problem kind regards Ahmet Temiz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Send e-mail faster without improving your typing skills. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008
Re: problem in pooled database
thank you 2008/12/10 David Smith [EMAIL PROTECTED] You could also be more explicit in your code if you import two classes of the same name from different packages: javax.sql.DataSource ds = (javax.sql.DataSource)ctx.lookup( java:comp/env/jdbc/bzk2 ) ; --David ahmet temiz wrote: Now, it seems ok after disabling javax.activation.DataSource; //import javax.activation.DataSource; import javax.sql.DataSource; thank you 2008/12/10 David Smith [EMAIL PROTECTED] Ok... so what do the import statements at the top of that file look like? Seems to me java has taken DataSource to mean javax.activation.DataSource instead of javax.sql.DataSource. That's probably because of the imports at the top of your source file. --David ahmet temiz wrote: Exception has taken place here: DataSource ds = (DataSource) ctx.lookup(java:comp/env/jdbc/bzk2); this is my Application-specific resource (context.xml) ?xml version=1.0 encoding=UTF-8? Context path=/home/orkun/workspace5/w1 docBase=w1 crossContext=true reloadable=true debug=1 Resource name=jdbc/bzk2 auth=Container type=javax.sql.DataSource driverClassName=org.postgresql.Driver url=jdbc:postgresql:// 127.0.0.1:5432/bzk2 username=orkun password=22 maxActive=20 maxIdle=10 maxWait=-1 / /Context thank you 2008/12/10 David Smith [EMAIL PROTECTED] Patient says: It hurts when I do this... (demonstrates movement) Doctor says: Don't do that. Moral of the story is the error message is pretty clear. If your class has imported javax.activation.* and javax.sql.*, you may have to be more specific on the type of your datasource variable: javax.sql.DataSource dbDataSrc = /* code for retrieving the datasource */ For less sarcasm and more help, please feed us more details like say a snippet of code where this error occurs, what was imported for that class, and relevant parts of your config. --David ahmet temiz wrote: hello I am trying to manage pooled database (postgresql).I am encountering this problem : java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource cannot be cast to javax.activation.DataSource I will appreciate if you supply any information to me to overcome the problem kind regards Ahmet Temiz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I uninstall tomcat
Chuck, Ta much for your advice and response. Best Regards, Pete -- View this message in context: http://www.nabble.com/How-do-I-uninstall-tomcat-tp20941964p20942486.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem in pooled database
From: Martin Gainty [mailto:[EMAIL PROTECTED] Subject: RE: problem in pooled database also if you are going to be opening up more than 1 connection I would suggest using connection-pool The OP is already using connection pooling. Note the subject line of this thread and the use of a Resource element to enable pooling. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Apache 5.5 on SSL - mod_SSL version?
Thanks for the reply. The errors are now gone. Has mod_SSL been published for Apache 5.5? I do not see it. This is all fronting a Liferay application. Matt -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker Sent: Tuesday, December 09, 2008 7:21 PM To: users@tomcat.apache.org Subject: Re: Apache 5.5 on SSL - errors- ResourceStart GetConfigured Installing the keystore is almost certainly not what you want to do if you are fronting with Apache. You need to configure Apache to do the SSL using the mod_ssl docs. If (as it seems from the log) you are using AJP/1.3 (aka mod_jk/mod_proxy_ajp), then no additional configuration may be required in server.xml (and probably at most setting the redirectPort on the Connector protocol=AJP/1.3 ... / element). You will need to copy the JkMount etc. statements to the SSL VHost in httpd.conf). Instead, it looks like you created an unused HTTP/1.1 Connector that speaks SSL. Of course, Tomcat won't care about this. Also, Tomcat quietly ignores configuration options that it doesn't understand, so configuring a keystore on the AJP/1.3 Connector will also not trigger an error. The errors below are likely caused by having backup copies of ROOT.xml in $CATALINA_HOME/conf/Catalina/localhost. If so, just change the extension to something other than .xml (e.g. Copy of Root.bak) and the errors should go away. Matt Moreira [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] p... A previously-working Apache build running non-SSL was switched to receive SSL traffic. The keystore has been installed, and I've modified the server.xml (which may not be correct, but I do not see where the application complains about it). In an order to cut down on some of the log chatter I removed some backup folders, which actually now show up as errors in addition to the ResourceStart and GetConfigured errors. I can add these folders back in, but do not see how the application needs them. Here is the catalina log: Dec 8, 2008 4:39:39 PM org.apache.coyote.http11.Http11AprProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Dec 8, 2008 4:39:39 PM org.apache.coyote.http11.Http11AprProtocol init INFO: Initializing Coyote HTTP/1.1 on http-443 Dec 8, 2008 4:39:39 PM org.apache.coyote.ajp.AjpAprProtocol init INFO: Initializing Coyote AJP/1.3 on ajp-8009 Dec 8, 2008 4:39:39 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 375 ms Dec 8, 2008 4:39:39 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Dec 8, 2008 4:39:39 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.23 Dec 8, 2008 4:39:39 PM org.apache.catalina.core.StandardHost start INFO: XML validation disabled Dec 8, 2008 4:39:39 PM org.apache.catalina.realm.JAASRealm setUseContextClassLoader INFO: Setting useContextClassLoader = false Dec 8, 2008 4:39:39 PM org.apache.catalina.core.StandardContext resourcesStart SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base D:\Portal\liferay433\webapps\Copy of ROOT does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.jav a:141) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext. java:3855) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4024 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 626) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java :553) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31 1) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu pport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at
Re: service.bat install failure (Windows, v 6.0.18)
Chuck, If you're still out there, I'm sort of continuing the service install thread. I have managed to move on to a different problem (but not real happy about how). I pretty much gave up on the Permission is denied. problem. (I have another vague thought about what was happening if you care, but not the time or expertise to pinpoint the issue.) I did a completely clean extract of the 6.0.18 tar.gz archive, and tried to see if I could install the tomcat service without having touched anything. Had immediate success. I thought I would be all set from there -- I could start deploying my apps little by little and see where things broke. Unfortunately, things didn't go quite as planned. What happens now is: 1. service.bat install appears to work fine. (So progress, I guess.) I notice that it does not start the service, so I take care of that manually. 2. Now, from a browser, if I visit http://localhost:8080 I get the Tomcat Welcome Page as expected. (Same as before deplying my app.) 3.But if I visit http://localhost:8080/mytestapp the browser waits and waits forever. 4. Note that if I stop the Tomcat service, and then start Tomcat from a console using startup.bat, everything works fine -- html, jsp, servlets, db connection Also, there isn't so much as a warning, much less an error message, on startup. 5. Just to see if it is mytestapp that is causing the problem, I did a completely clean extract again and tried to visit both http://localhost:8080/examples and http://localhost:8080/docs . I see the exact same endless wait. All these pages load fine if I start Tomcat using startup.bat. I have tried to debug this on my own a couple of ways so far without success: 1. I looked for a log file that might provide a clue. I found the file that the Tomcat service writes to when it starts and stops, but I could not find a file in the logs directory that gets updated at all when I hit the server from a browser. Maybe I need to start with a debug parameter? If so, could you point me to info on this? 2. Following the documentation, I unistalled the Tomcat service and tried to run it as tomcat6.exe //TS//Tomcat6 --other-startup-params hoping I'd see clues go to the console. Unfortunately, I get: [2008-12-10 12:54:25] [427 prunsrv.c] [error] The system cannot find the file specified. [2008-12-10 12:54:25] [1336 prunsrv.c] [error] Load configuration failed I took --other-startup-params from the trace of service.bat install, AND I was also careful to set all environment variables to the same values that service.bat install sets them. To confirm I didn't make a mistake, I put my tomcat6.exe //TS//... in a batch file along with all the env set commands. If I change the //TS// to a //IS// the service installs successfully, just like service.bat install. But if I change it back to //TS//, I get the errors above. Any chance you know of an easy fix for this one? (Maybe two issues - the failed //TS// seems different.) Seperately, thank you much for the pointer you provided to the procrun page in your last note -- this looks like it could be really useful. If you know people who manage the online Tomcat docs, I'd suggest simply hyperlinking the word procrun (on the windows-service-howto.html page) to the procrun page. This would help people like me a lot. - andrew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat thread pool question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ped, ped wrote: If I execute the loop N-1 times, I have no problems - I can execute my loop over and over. I can verify that I am not leaking connections (I have a monitor thread that displays the number of active connections). I'm probably joining this thread very late, but if you set your connection pool size to 1 (that is, a single connection), can you still execute any tests? Just because you aren't leaking connections doesn't mean that there's no potential for deadlock. We run all our development servers with maxActive=1 to catch just such potential deadlocks: if a single thread borrows two connections from the connection pool (instead of more correctly using the same one for all transactions), you can deadlock your app. Just a thought. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklAP4sACgkQ9CaO5/Lv0PDdAwCeImZkU0CiroF82SZR0bFLjLIF angAn0Wlchlp1se5ywh1fLw8FTxBiEL+ =82bg -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat thread pool question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ped, ped wrote: I would think that I should be able to increase the number of threads available to Tomcat to prevent this problem (I'm not saying that is the correct solution to my problem - I fully understand that our design is the root of this problem). If you have many clients: 1. borrowing db connections 2. executing queries 3. committing transactions and returning the connections to the pool ...then you have very nondeterministic behavior. If every request requires a db connection (either from the pool, or from the session, or wherever you store it), and you have fewer db connections available than the number of processing threads configured, then everything will eventually go to hell. Here's how: 1. Many clients borrow connections from the dbcp, exhausting it 2. New clients requiring new borrowed connections /block/ waiting for those pooled connections to be available 3. The requests blocked in #2 prevent new requests from being serviced 4. Clients who already own pooled connections cannot successfully make requests that will ultimately re-populate your dbcp So, unless you have maxActive == dbcp size, you're screwed. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklAQUQACgkQ9CaO5/Lv0PAS5QCfV90jki6OkspGN3oIVaW1ZKMK IgkAn0hL1tzOVUt2NrvBvU9GNUaUartv =DIbX -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat thread pool question
ped schrieb am 10.12.2008 um 10:33:23 (-0800): The Tomcat thread pool is finite; we'll call the maxThread value T. Likewise, the db connection pool is finite, and we'll call its size D. The client makes some number of requests that are not committed, which we'll label R. Anytime R T + D, you're stuck. Yes - that's my understanding of the problem. But as I change D (my db connection pool size) and R, Tomcat's maxThread value (T) seems to be very small (1 or 2). That surprised me, and led me to think something else was going on here. Tomcat's maxThread is what you configure it to be. Quoting from your original post: | my client (written in GWT) executes a loop as follows: | 1 - remote call to web app to start a DB transaction (essentially | reserving a 3cp0 connection) Which will never go back to the pool. You think you're reserving it, but you'll never get back to it, so you're actually losing it. | 2 - on callback from 1, make a remote call to web app to perform a DB | query using the above transaction Another one that will never again be available for anybody, as you don't commit your work and don't give it back to the pool. | 3 - on callback from 2, make a remote call to the web app to commit | the db transaction (freeing the c3p0 connection) And another one, which there isn't any point in committing, as no work has been done in it. You have to close your connection each and every time to give it back to the pool. That's the idiomatics of the pool: Calling close() on a connection returns it to the pool. http://commons.apache.org/dbcp/apidocs/org/apache/commons/dbcp/PoolableConnection.html Michael Ludwig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat thread pool question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, Christopher Schultz wrote: So, unless you have maxActive == dbcp size, you're screwed. Er, that should be maxActive == maxThreads. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklAQa0ACgkQ9CaO5/Lv0PCD+QCguPOh1/0anb6avQkFiARkn9w5 tj8AmgIbTo5wT1cHRtoE/FGShAj8YLDu =qbed -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
i have a thread going on another list about integrating corner cases for SQL e.g. 1 connection or 999 connections it would be helpful for the Build manager to auto-execute these corner cases before deploying to staging servers I usually never say this but ..good catch 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: Wed, 10 Dec 2008 17:15:39 -0500 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat thread pool question -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ped, ped wrote: If I execute the loop N-1 times, I have no problems - I can execute my loop over and over. I can verify that I am not leaking connections (I have a monitor thread that displays the number of active connections). I'm probably joining this thread very late, but if you set your connection pool size to 1 (that is, a single connection), can you still execute any tests? Just because you aren't leaking connections doesn't mean that there's no potential for deadlock. We run all our development servers with maxActive=1 to catch just such potential deadlocks: if a single thread borrows two connections from the connection pool (instead of more correctly using the same one for all transactions), you can deadlock your app. Just a thought. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAklAP4sACgkQ9CaO5/Lv0PDdAwCeImZkU0CiroF82SZR0bFLjLIF angAn0Wlchlp1se5ywh1fLw8FTxBiEL+ =82bg -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Send e-mail faster without improving your typing skills. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008
Re: Tomcat thread pool question
Possibly [OT], and just disregard if so. I am just trying to follow this thread and to understand, from my very superficial and elementary knowledge of things Java and Tomcat. So we have a Tomcat, which somehow has a pool of database connections ready to be lent to webapps. And we have a webapp capable of borrowing one of the connections from the pool to do something with it, the understanding being that when it's done, it gives it back to the pool. And we have several Tomcat threads ready to execute instances of this webapp, to service HTTP requests. We also have a client, who sends 3 HTTP requests in a row to Tomcat, as follows : - Client sends HTTP request # 1 to Tomcat - Tomcat passes this request to a thread, which runs the webapp - the thread borrows a connection from the pool - the thread for the moment doesn't do anything with it, but sends a response to the Client - request # 1 is terminated, the thread is ready to process another request - Client receives response to request # 1 - Client issues HTTP request # 2, which is a db transaction - Tomcat receives the request # 2, and passes it to the same / a different thread. Say it is the same (how that works I don't know, question below). - the thread somehow re-uses the same db connection which was borrowed before. How ? was it saved somewhere and can this thread get the same one back ? But suppose it does. - the thread makes the db query, and sends a response to the Client - request # 2 is terminated, the thread is ready to process another request - Client receives response to request # 2 - Client issues HTTP request # 3, which is a signal for the webapp to return the db connection to the pool - Tomcat receives the request # 3, and passes it to the same / a different thread. Say it is the same (how that works I don't know). - the thread somehow re-uses the same db connection it had borrowed before, to finalise the db transaction, then returns the connection to the pool. The thread sends a response to the Client. - request # 3 is terminated, the thread is ready to process another request - Client receives response to request # 3 and is happy. Now my question is : considering this is HTTP, where each request is supposedly independent from previous and following ones, can a scheme like the above possibly work ? Is it one particular thread which holds this borrowed db connection, and is request # 2 necessarily processed by the same thread as request # 1 ? Where is the borrowed connection stored between the requests ? Am I right in thinking that for such a scheme to work, even with well-behaved clients, the borrowed db connection would need to be saved somewhere independent of a Tomcat thread, but dependent on some kind of client session, so that any thread could pick it up where another one or itself left it between transactions of that same client ? Is that what everyone is trying to say ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
From: André Warnier [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat thread pool question So we have a Tomcat, which somehow has a pool of database connections ready to be lent to webapps. In this particular case, the db connection pool is managed by Hibernate, not Tomcat. More typical usage would have Tomcat managing the pool, but it wouldn't make any difference for this problem. And we have a webapp capable of borrowing one of the connections from the pool to do something with it, the understanding being that when it's done, it gives it back to the pool. That's the standard model, but this app design isn't using it. Instead, the connections are not returned to the pool until the client says it's ok to do so. - Tomcat receives the request # 2, and passes it to the same / a different thread. Say it is the same (how that works I don't know, question below). Unlikely to be the same, but it doesn't matter. - the thread somehow re-uses the same db connection which was borrowed before. How ? was it saved somewhere and can this thread get the same one back ? One presumes the webapp stored the connection somewhere retrievable, although the OP provided no actual evidence of that. It coule be stored in the Session, or kept in a completely separate active connection structure managed by the webapp. - Client issues HTTP request # 3, which is a signal for the webapp to return the db connection to the pool Not just return the db connection, but also commit the db updates. - Tomcat receives the request # 3, and passes it to the same / a different thread. Say it is the same (how that works I don't know). Doesn't matter if it's the same thread or not. Now my question is : considering this is HTTP, where each request is supposedly independent from previous and following ones, can a scheme like the above possibly work ? Yes, because each client can be identified by a session identifier or some other cookie. However, unless the client is very well controlled and extremely robust, this design abdicates responsibility for management of server resources (the db connections) and delegated that to the client, an extremely poor design choice. Is it one particular thread which holds this borrowed db connection, and is request # 2 necessarily processed by the same thread as request # 1 ? Highly unlikely. Where is the borrowed connection stored between the requests ? Could be in the Session object associated with the client, or some webapp-managed structure. Am I right in thinking that for such a scheme to work, even with well-behaved clients, the borrowed db connection would need to be saved somewhere independent of a Tomcat thread, but dependent on some kind of client session, so that any thread could pick it up where another one or itself left it between transactions of that same client ? Correct; it's only a minor - albeit dangerous - variation on the frequently used shopping cart seen on many web sites. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to set Log4J debug flag in Tomcat
How do I start tomcat as an application (not a service) and set the log4j debug commandline parameter? I tried editing startup.bat to prepend -Dlog4j.debug to %CMD_LINE_ARGS%, but I get the following error on startup, and I don't see any log4j debug output: usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { start | stop } Thanks for any help. Rebeccah -- The contents of this message, together with any attachments, are intended only for the use of the person(s) to which they are addressed and may contain confidential and/or privileged information. Further, any medical information herein is confidential and protected by law. It is unlawful for unauthorized persons to use, review, copy, disclose, or disseminate confidential medical information. If you are not the intended recipient, immediately advise the sender and delete this message and any attachments. Any distribution, or copying of this message, or any attachment, is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat thread pool question
Caldarale, Charles R wrote: From: André Warnier [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat thread pool question So we have a Tomcat, which somehow has a pool of database connections ready to be lent to webapps. In this particular case, the db connection pool is managed by Hibernate, not Tomcat. More typical usage would have Tomcat managing the pool, but it wouldn't make any difference for this problem. And we have a webapp capable of borrowing one of the connections from the pool to do something with it, the understanding being that when it's done, it gives it back to the pool. That's the standard model, but this app design isn't using it. Instead, the connections are not returned to the pool until the client says it's ok to do so. - Tomcat receives the request # 2, and passes it to the same / a different thread. Say it is the same (how that works I don't know, question below). Unlikely to be the same, but it doesn't matter. - the thread somehow re-uses the same db connection which was borrowed before. How ? was it saved somewhere and can this thread get the same one back ? One presumes the webapp stored the connection somewhere retrievable, although the OP provided no actual evidence of that. It coule be stored in the Session, or kept in a completely separate active connection structure managed by the webapp. - Client issues HTTP request # 3, which is a signal for the webapp to return the db connection to the pool Not just return the db connection, but also commit the db updates. - Tomcat receives the request # 3, and passes it to the same / a different thread. Say it is the same (how that works I don't know). Doesn't matter if it's the same thread or not. Now my question is : considering this is HTTP, where each request is supposedly independent from previous and following ones, can a scheme like the above possibly work ? Yes, because each client can be identified by a session identifier or some other cookie. However, unless the client is very well controlled and extremely robust, this design abdicates responsibility for management of server resources (the db connections) and delegated that to the client, an extremely poor design choice. Is it one particular thread which holds this borrowed db connection, and is request # 2 necessarily processed by the same thread as request # 1 ? Highly unlikely. Where is the borrowed connection stored between the requests ? Could be in the Session object associated with the client, or some webapp-managed structure. Am I right in thinking that for such a scheme to work, even with well-behaved clients, the borrowed db connection would need to be saved somewhere independent of a Tomcat thread, but dependent on some kind of client session, so that any thread could pick it up where another one or itself left it between transactions of that same client ? Correct; it's only a minor - albeit dangerous - variation on the frequently used shopping cart seen on many web sites. Thanks Chuck. So it has nothing to do directly with the threads. And I will suppose for now that the webapp saves each borrowed connection, in some place related to the session-id of the client that triggered the borrowing of each connection. Suppose we have 5 available db connections in the pool, and 10 threads, and 15 clients. The first 5 clients send their request # 1, resulting in 5 threads busy momentarily, and 5 db connections borrowed. So the pool is empty. The next 5 clients come in with request # 1, they also get 5 threads, but these threads have to wait for a db connection to become available in the pool again. So these threads block, until the first client issues its request # 3, and one db connection is returned to the pool. The next 5 clients arrive, and for the moment there is no thread available to service the request, so they block earlier, in the accept queue of the Connector or something. So now the first client receives the response to its request # 1. A thread is now free, and one of the waiting accept connections gets it. This thread immediately tries to get a new db connection from the pool, but it cannot because it's empty. So it too has to wait, and this blocks another thread. So now there are 6 threads blocked. A second client receives a response # 1 and issues a request #2. It doesn't get a thread, because in the meantime another waiting accept connection got that free thread, and also waits on a free db connection. So now we have 7 threads blocked, and one request # 2 waiting in the accept queue. And so on. Thus finally, if there are more threads than db connections in the pool, we can get completely locked up, even with clients that are perfectly well-behaved and always issue request # 3 if they can. And if a client is not well-behaved and never issues its request # 3, we lose a db connection from the pool. Think I got it. But on the other hand, if you increase the number of threads above the
Re: How to set Log4J debug flag in Tomcat
Prastein, Rebeccah H wrote: How do I start tomcat as an application (not a service) and set the log4j debug commandline parameter? I tried editing startup.bat to prepend -Dlog4j.debug to %CMD_LINE_ARGS%, but I get the following error on startup, and I don't see any log4j debug output: usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { start | stop } Sounds like your added switch gets added at the end, after the -jar. I don't have a Windows Tomcat handy, but you might try to add it in JAVA_OPTS instead, like JAVA_OPTS=$JAVA_OPTS -Dlog4j.debug (Unix version) Maybe in sentenv.bat, if it exists ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat thread pool question
From: André Warnier [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat thread pool question So it has nothing to do directly with the threads. Only in determining how many requests can be accepted by Tomcat before going on the limited TCP/IP queue and subsequent requests being rejected. I will suppose for now that the webapp saves each borrowed connection, in some place related to the session-id of the client that triggered the borrowing of each connection. I hope so; otherwise the application architecture is complete wishful thinking. Think I got it. Yup. But on the other hand, if you increase the number of threads above the number of simultaneous clients that you could possibly have, then it would unblock the situation, no ? In a test environment, that might be feasible; in the real world, it is highly unlikely that one has sufficient control over the clients to limit the number of requests that they might submit in toto. (It's not really the number of clients that's the problem; it's the number of concurrent requests, since there's nothing stopping a client from issuing multiple requests simultaneously. Given the poor design demonstrated so far by the app in question, I wouldn't be surprised that they aren't providing for that situation either.) I'm not saying that it is a good design, but maybe it's a temporary solution ? Maybe, but I would never condone putting such a scheme into production. I wonder what other shortcomings this app has... - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to set Log4J debug flag in Tomcat
LOGGING: Create a file called log4j.properties with the following content and save it into common/classes. log4j.rootLogger=DEBUG,R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m% --Container specific log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG, --core specific log4j.logger.org.apache.catalina.core=DEBUG, R --session specific log4j.logger.org.apache.catalina.session=DEBUG, R Download Log4J (v1.2 or later) and place the log4j jar in $CATALINA_HOME/common/lib. Download Commons Logging and place the commons-logging-x.y.z.jar (not commons-logging-api-x.y.z.jar) in $CATALINA_HOME/common/lib with the log4j jar.Start Tomcat Documentation is located at http://tomcat.apache.org/tomcat-5.5-doc/logging.html hth 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. Subject: How to set Log4J debug flag in Tomcat Date: Wed, 10 Dec 2008 19:31:09 -0500 From: [EMAIL PROTECTED] To: users@tomcat.apache.org How do I start tomcat as an application (not a service) and set the log4j debug commandline parameter? I tried editing startup.bat to prepend -Dlog4j.debug to %CMD_LINE_ARGS%, but I get the following error on startup, and I don't see any log4j debug output: usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { start | stop } Thanks for any help. Rebeccah -- The contents of this message, together with any attachments, are intended only for the use of the person(s) to which they are addressed and may contain confidential and/or privileged information. Further, any medical information herein is confidential and protected by law. It is unlawful for unauthorized persons to use, review, copy, disclose, or disseminate confidential medical information. If you are not the intended recipient, immediately advise the sender and delete this message and any attachments. Any distribution, or copying of this message, or any attachment, is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Send e-mail faster without improving your typing skills. http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008
Re: Tomcat caching of static resources?
Caldarale, Charles R [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] From: David Smith [mailto:[EMAIL PROTECTED] Subject: Tomcat caching of static resources? is it possible to cache static images and .js files in Tomcat? Think about what you just asked for: how would caching static resources in the server avoid them being downloaded by the browser? It's the browser that must cache the information to avoid the redundant downloads. There are settings in Tomcat that control server-side caching of static resources (i.e. Tomcat serves up an in-memory copy of frequently requested static resources). I really can't recommend this for large .js files on a production server however. If you must do this, check out the Tomcat docs for configuring a Resources .../ element. However, the OP is probably better off enabling the sendfile options on either the NIO or APR Connector. When i look at the browser cache it looks like the browser is downloading all page assets for every call, including some very large .js files. As stated in one of the (correct) responses to the article you referenced: So the first thing is to get control of the cache headers. Without them, the cache can not know what to do. What are you doing to control the headers? What headers are being used for the large .js files? The article is referring to the fact that Tomcat adds cache headers by default to any page protected by a security-constraint to prevent someone else from stealing it from an intermediate proxy. The default settings are extremely aggressive, resulting in regular posts on this list of the form My secured pdf file can't be displayed in IE. If the article applies to the OP, it may just be easier to move the .js files to a non-secured location. If you take the advice in the article, then you are telling Tomcat that the webapp programmer is taking full control of the cache headers, so you are on your own in terms of security. but the solution didn't resolve the problem (especially if deploying via war files) The original author of the article is clearly unfamiliar with Tomcat, caching, and security (e.g., not knowing where a context.xml file goes, and erroneously stating it doesn't work with a .war file). i cant believe there isn't a standard Tomcat configuration for this? For what? Caching static resources on the server end doesn't alter the amount of network traffic generated. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: service.bat install failure (Windows, v 6.0.18)
From: andrew [mailto:[EMAIL PROTECTED] Subject: Re: service.bat install failure (Windows, v 6.0.18) I did a completely clean extract of the 6.0.18 tar.gz archive I usually use the .zip for Windows, but it should be the same thing. I notice that it does not start the service, so I take care of that manually. You can, of course, set the startup mode to automatic in the Services snap-in. 3. But if I visit http://localhost:8080/mytestapp the browser waits and waits forever. Can you take a thread dump and see what's going on? Do JConsole or JVisualVM show anything interesting (e.g., a thread looping or stuck on a lock)? What happens if you configure the service to run under the same account you use when running Tomcat with the startup.bat script? (Use the tomcat6w.exe program to set the account.) 4. Note that if I stop the Tomcat service, and then start Tomcat from a console using startup.bat, everything works fine -- html, jsp, servlets, db connection By everything, do you mean mytestapp? Also, there isn't so much as a warning, much less an error message, on startup. When running as a service, or as a regular program, or both? I did a completely clean extract again and tried to visit both http://localhost:8080/examples and http://localhost:8080/docs. I see the exact same endless wait. But the Tomcat default home page works? Is this page possibly just being cached by the browser? I could not find a file in the logs directory that gets updated at all when I hit the server from a browser. You have to uncomment the AccessLogValve near the bottom of conf/server.xml. However, I don't think this logs anything until a response is sent. 2. Following the documentation, I unistalled the Tomcat service and tried to run it as tomcat6.exe //TS//Tomcat6 --other-startup-params I think you misunderstood the doc. You have to use //IS// first to install the service, after which you can run it with //TS// from the command prompt. Any chance you know of an easy fix for this one? Easy answer - no. But there are a few more questions: 1) Is this a 32- or 64-bit version of Windows? 2) What JVM do have have installed? 3) When you run tomcat6w.exe, what does the Java tab show (all fields, please)? - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]