Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-22 Thread Mark Thomas
Alexander Shutyaev wrote: >Hi Mark, > >The problem is that I have a dynamic app where webapps come and go, so >I >can't call addWebapp() before calling start(). The best I can do is a >delayed start() - in my method that calls addWebapp() I can make a >check - >and if this is the first time - c

Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-21 Thread Alexander Shutyaev
Hi Mark, The problem is that I have a dynamic app where webapps come and go, so I can't call addWebapp() before calling start(). The best I can do is a delayed start() - in my method that calls addWebapp() I can make a check - and if this is the first time - call start() after addWebapp(). Will th

Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-21 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 17/07/2012 19:31, Alexander Shutyaev wrote: > Hi Christopher, > > I've found a solution to my problem although I believe it's more > accurate to say I guessed it :) Maybe you'll be able to explain it > to me. Here is the complete code: > > Tomca

Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-18 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 7/18/12 5:33 AM, André Warnier wrote: > I don't find in the on-line documentation a description of how > Tomcat exactly matches HTTP requests to names, but the > general logic in webservers is something like : - consider the > "Host:" heade

Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-18 Thread Alexander Shutyaev
Hi André, Thanks for your suggestion. I've changed (1) to tomcat.getEngine().setDefaultHost(tomcat.getHost().getName()); and removed (2). It also works this way and the code seems more adequate. Thanks again! 2012/7/18 André Warnier > Alexander Shutyaev wrote: > >> Hi Christopher, >> >> I've

Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-18 Thread André Warnier
Alexander Shutyaev wrote: Hi Christopher, I've found a solution to my problem although I believe it's more accurate to say I guessed it :) Maybe you'll be able to explain it to me. Here is the complete code: Tomcat tomcat = new Tomcat(); tomcat.setBaseDir(baseDir); tomcat.getConnector().setPort

Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-17 Thread Alexander Shutyaev
Hi Christopher, I've found a solution to my problem although I believe it's more accurate to say I guessed it :) Maybe you'll be able to explain it to me. Here is the complete code: Tomcat tomcat = new Tomcat(); tomcat.setBaseDir(baseDir); tomcat.getConnector().setPort(8080); tomcat.getServer().s

Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alexander, On 7/17/12 6:42 AM, Alexander Shutyaev wrote: > Ok, I've figured out it DOES listen on ALL addresses no matter > what hostname is, but somehow requests only succeed if they have > the hostname matching with the one set by Tomcat.setHostname

Re: force embedded tomcat 7 to listen on ALL adresses

2012-07-17 Thread Alexander Shutyaev
Ok, I've figured out it DOES listen on ALL addresses no matter what hostname is, but somehow requests only succeed if they have the hostname matching with the one set by Tomcat.setHostname(...) (which is localhost by default). I'm not sure where the requests fail, but they do. 2012/7/17 Alexander

force embedded tomcat 7 to listen on ALL adresses

2012-07-17 Thread Alexander Shutyaev
Hi all! I've embedded tomcat 7 using org.apache.catalina.startup.Tomcat class. It seems that by default it listens on "localhost". I've noticed there is a method org.apache.catalina.startup.Tomcat.setHostname(String) which I can use to change this. But I can't find how I can tell tomcat to listen