Is it possible to disable caching/force reloading of JNDI resources?
Hi guys, I'm stuck with a JNDI resource object factory problem. Hopefully you can help me out with this issue. My idea was to provide multiple web applications running inside a Tomcat instance with configuration properties from config files located outside the WAR file of the applications. I'm currently trying to provide these configuration properties with a global naming resource (defined inside the server.xml) which is consumed by the said applications to keep the configuration container independent and to avoid direct file access from a web application. So far almost everything already works perfectly! Except that Tomcat obviously caches resources which are looked up via JNDI. This way I have to restart Tomcat every time the external config files changes because the web applications never access my ObjectFactory again after Tomcat has cached the result of the ObjectFactory. Accordingly to the documentation an implementation of ObjectFactory should be accessed each time a web application looks it up with its JNDI key. But that's definitely not the case here. Any ideas or thoughts on this issue? Is there any way to disable this behavior of Tomcat's JNDI resource management? Or any comments on this plan to externalize the application configuration in general? Thanks in advance! Marco - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Is it possible to disable caching/force reloading of JNDI resources?
Am 17.07.2010 12:56, schrieb Mark Thomas: On 17/07/2010 09:50, Marco Ehrentreich wrote: Accordingly to the documentation an implementation of ObjectFactory should be accessed each time a web application looks it up with its JNDI key. But that's definitely not the case here. What documentation? Mark Sorry, I'll try to find the said documentation again. I think it was something from the original Tomcat documentation but I can't find it at the moment. Maybe I missunderstood it but at least it didn't mention that the result of an ObjectFactory is only produced once and then cached by Tomcat. Can you tell me some more details about this issue? Or would you recommend a completely different approach? Marco - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: using Apache as a front end for Tomcat
Hi James! it would be very kind of you people if some one can share how can I use Apache as a front end to Tomcat. I guess most installations of Apache and Tomcat are using the AJP protocol for communication between the Apache frontend and Tomcat backend. There are two similar approaches with two different Apache modules: mod_jk or the newer mod_proxy_ajp module. I've used mod_proxy_ajp for a few installations recently and it works without problems. Another advantage is that it's part of the Apache 2.2 standard modules. For both solutions you basically have to tell Apache which URLs or URL patterns it should forward to your Tomcat backend for processing of these requests. I think you'll find enough tutorials and examples on the intenert. Maybe there are comletely different approaches too, but in my opinion mod_proxy_ajp is really straight forward and not too hard to configure. Marco - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: using Apache as a front end for Tomcat
Hi James, Marco thanks for your kind reply. Your welcome ;-) I am a bit new to this Proxy business I did searched tutorials on net but I have got a lot confused. If you can share your vhost as how you are using mod_proxy_ajp For example following is an example configuration of Apache as front end I enabled mod_proxy_ajp as per your instructions. VirtualHost *:80 ServerName myserver.com IfModule mod_proxy_ajp Location /sakai/ ProxyPass ajp://192.168.1.5:9090/portal ProxyPassReverse ajp://192.168.1.5:9090/portal /Location /IfModule /VirtualHost Is this what you meant for the front end. Or I also need to do some thing where sakai is present. This is basically what I meant. You don't even need a Location container. You can put this configuration options for mod_proxy_ajp directly inside the Server or Vhost container like this: SetEnv BALANCER_SESSION_STICKY jsessionid ProxyRequests Off ProxyPreserveHost Off # Hudson continous integration server ProxyPass /hudson ajp://localhost:1/hudson ProxyPassReverse /hudson ajp://localhost:1/hudson As you can see there are general options for mod_proxy/mod_proxy_ajp you can tweak but the most important are the ProxyPass and ProxyPassReverse directive which you can just copy for any web application URL you want to forward to Tomcat. Of course the port number in these directives must match the port of your AJP connector of Tomcat inside the server.xml configuration for Tomcat. The directives and parameters are well documented on the Apache module documentation pages and in the Tomcat documentation too. Of course it's a huge topic to understand the Apache configuration itself in detail, so it's almost impossible to explain every option here. But the configuration snippets above show the important things which are needed to get an existing Apache config working with Tomcat backend(s). Marco - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org