Re: No Host matches server name localhost error
Hello, Parsons Technical Services wrote: Now as for the issue, I am not sure that it is a bug but just a feature. Unless you can show where it does not meet the servlet specs then it will not be considered a bug. Ok, and since the issue is actually documented, it cannot be called a bug. Understood; no offense intended :-) I am not sure why this is causing such a problem. The only time a default context will ever be used is if the browser is using an IP instead of a URL or if you have a DNS entry that points to your IP with no matching application. So unless you are using only the IP or are directing multiple unmatched URLs at the server there is no issue. If you are, then knowing what the war is about is only a small piece of the puzzle that exist in the setup. I may really be missing something here, but my impression was that a host's default web application is used whenever a URL is requested that does not match any other context's path prefix within the host - regardless of the access being made by IP address or by domain name. To me, this means that I *need* a default context if I want to see the welcome page of my foo web application (within the host named www.foodomain.com) at http://www.foodomain.com; and not at http://www.foodomain.com/foo;, right? If this is right, then I'd have to tamper with server.xml or name my .war file ROOT.war. I can live with the latter, but it feels somewhat unclean. IMO, the same applies to setting up a minimal ROOT.war that simply forwards to another context, since this will also cause an unnecessary /foo prefix in every subsequent request URL. -- Thomas Corte [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No Host matches server name localhost error
Try renaming the context.xml to ROOT.xml, I normally get the 400 error if it can't find the context for a particular path. For some reason Tomcat tends to ignore the path on the context. Paul On Tue, 2005-08-30 at 09:50 -0700, Brian Moseley wrote: i'm using tomcat 5.5.9 with a single webapp deployed with a context path of and a default host named localhost. when i request the webapp's root resource (http://localhost:8080/), i get a 400 error with the message No Host matches server name localhost. as you can see from my very minimal server.xml, i do in fact have a Host named localhost and have specified it as the default host for the engine. so, i must admit to being confused as to why i'm receiving that particular error message. :) i have turned on debug logging to verify that the context is being loaded, but i have yet to step through a request with a debugger. any ideas? server.xml: Server port=8005 shutdown=SHUTDOWN Service name=Catalina Connector port=8080 enableLookups=false/ Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps autoDeploy=false/ /Engine /Service /Server context.xml (in conf/Catalina/localhost/): Context path= docBase=cosmo reloadable=true Environment name=cosmo/version value=0.2-4 type=java.lang.String override=false/ Environment name=cosmo/serverAdmin value=[EMAIL PROTECTED] type=java.lang.String override=false/ Environment name=cosmo/repository/username value=cosmo_repository type=java.lang.String override=false/ Environment name=cosmo/repository/password value= type=java.lang.String override=false/ Resource name=jcr/cosmo type=javax.jcr.Repository factory=org.apache.jackrabbit.core.jndi.BindableRepositoryFactory configFilePath=etc/repository.xml repHomeDir=data/repository/ Resource name=jdbc/cosmo type=javax.sql.DataSource maxActive=5 maxIdle=3 maxWait=1 username=sa parameter= driverClassName=org.hsqldb.jdbcDriver url=jdbc:hsqldb:file:data/db/userdb/ Resource name=mail/cosmo type=javax.mail.Session mail.transport.protocol=smtp/ mail.smtp.host=localhost/ mail.smtps.host=localhost/ mail.smtp.starttls.enable=false/ Valve className=org.apache.catalina.valves.AccessLogValve directory=../logs prefix=access. suffix=.log pattern=combined resolveHosts=false/ /Context - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No Host matches server name localhost error
The error your getting is more likely saying that you computer can not resolve localhost as domain name. If so it would have nothing to do with your server config. Try using the loop back IP(127.0.0.1). If this is happening on a windows box you may want to run a check for viruses or spyware. If it is Linux make sure you have a listing for localhost in your /etc/hosts file. Brian Moseley wrote: i'm using tomcat 5.5.9 with a single webapp deployed with a context path of and a default host named localhost. when i request the webapp's root resource (http://localhost:8080/), i get a 400 error with the message No Host matches server name localhost. as you can see from my very minimal server.xml, i do in fact have a Host named localhost and have specified it as the default host for the engine. so, i must admit to being confused as to why i'm receiving that particular error message. :) i have turned on debug logging to verify that the context is being loaded, but i have yet to step through a request with a debugger. any ideas? server.xml: Server port=8005 shutdown=SHUTDOWN Service name=Catalina Connector port=8080 enableLookups=false/ Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps autoDeploy=false/ /Engine /Service /Server context.xml (in conf/Catalina/localhost/): Context path= docBase=cosmo reloadable=true Environment name=cosmo/version value=0.2-4 type=java.lang.String override=false/ Environment name=cosmo/serverAdmin value=[EMAIL PROTECTED] type=java.lang.String override=false/ Environment name=cosmo/repository/username value=cosmo_repository type=java.lang.String override=false/ Environment name=cosmo/repository/password value= type=java.lang.String override=false/ Resource name=jcr/cosmo type=javax.jcr.Repository factory=org.apache.jackrabbit.core.jndi.BindableRepositoryFactory configFilePath=etc/repository.xml repHomeDir=data/repository/ Resource name=jdbc/cosmo type=javax.sql.DataSource maxActive=5 maxIdle=3 maxWait=1 username=sa parameter= driverClassName=org.hsqldb.jdbcDriver url=jdbc:hsqldb:file:data/db/userdb/ Resource name=mail/cosmo type=javax.mail.Session mail.transport.protocol=smtp/ mail.smtp.host=localhost/ mail.smtps.host=localhost/ mail.smtp.starttls.enable=false/ Valve className=org.apache.catalina.valves.AccessLogValve directory=../logs prefix=access. suffix=.log pattern=combined resolveHosts=false/ /Context - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Brian Cook Digital Services Analyst Print Time Inc. [EMAIL PROTECTED] 913.345.8900 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No Host matches server name localhost error
Per the 5.5 doc you can't do it that way. You can only specify the path as a blank string when the context element is in the server.xml. http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html Look at the path attribute. Doug - Original Message - From: Brian Moseley [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Tuesday, August 30, 2005 12:50 PM Subject: No Host matches server name localhost error i'm using tomcat 5.5.9 with a single webapp deployed with a context path of and a default host named localhost. when i request the webapp's root resource (http://localhost:8080/), i get a 400 error with the message No Host matches server name localhost. as you can see from my very minimal server.xml, i do in fact have a Host named localhost and have specified it as the default host for the engine. so, i must admit to being confused as to why i'm receiving that particular error message. :) i have turned on debug logging to verify that the context is being loaded, but i have yet to step through a request with a debugger. any ideas? server.xml: Server port=8005 shutdown=SHUTDOWN Service name=Catalina Connector port=8080 enableLookups=false/ Engine name=Catalina defaultHost=localhost Host name=localhost appBase=webapps autoDeploy=false/ /Engine /Service /Server context.xml (in conf/Catalina/localhost/): Context path= docBase=cosmo reloadable=true Environment name=cosmo/version value=0.2-4 type=java.lang.String override=false/ Environment name=cosmo/serverAdmin value=[EMAIL PROTECTED] type=java.lang.String override=false/ Environment name=cosmo/repository/username value=cosmo_repository type=java.lang.String override=false/ Environment name=cosmo/repository/password value= type=java.lang.String override=false/ Resource name=jcr/cosmo type=javax.jcr.Repository factory=org.apache.jackrabbit.core.jndi.BindableRepositoryFactory configFilePath=etc/repository.xml repHomeDir=data/repository/ Resource name=jdbc/cosmo type=javax.sql.DataSource maxActive=5 maxIdle=3 maxWait=1 username=sa parameter= driverClassName=org.hsqldb.jdbcDriver url=jdbc:hsqldb:file:data/db/userdb/ Resource name=mail/cosmo type=javax.mail.Session mail.transport.protocol=smtp/ mail.smtp.host=localhost/ mail.smtps.host=localhost/ mail.smtp.starttls.enable=false/ Valve className=org.apache.catalina.valves.AccessLogValve directory=../logs prefix=access. suffix=.log pattern=combined resolveHosts=false/ /Context - 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: No Host matches server name localhost error
Parsons Technical Services wrote: Per the 5.5 doc you can't do it that way. You can only specify the path as a blank string when the context element is in the server.xml. http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html Look at the path attribute. aha! man, if only somebody had written a 5.0 - 5.5 migration guide :) thanks for the pointer. after moving my context definition into server.xml, requests are serviced successfully (well, not under ssl, but that's another message). i wonder what the motivation was for making it such that i can't configure the root context in its own file? seems a bit shortsighted, but maybe there was a good reason? thanks for the suggestions all. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: No Host matches server name localhost error
From: Brian Moseley [mailto:[EMAIL PROTECTED] Subject: Re: No Host matches server name localhost error thanks for the pointer. after moving my context definition into server.xml Bad move. This is specifically discouraged in 5.5. i wonder what the motivation was for making it such that i can't configure the root context in its own file? As far as I know, you can - just put your default context in webapps/ROOT, and its associated Context element in webapps/ROOT/META-INF/context.xml. - 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: No Host matches server name localhost error
On Tue, 2005-08-30 at 13:25 -0500, Caldarale, Charles R wrote: From: Brian Moseley [mailto:[EMAIL PROTECTED] Subject: Re: No Host matches server name localhost error thanks for the pointer. after moving my context definition into server.xml Bad move. This is specifically discouraged in 5.5. It seems that Tomcat 5.5 discourages you from putting contexts in the server.xml, and that is something that is a good idea as it's easier to manage them when they are outside. But the context path is only supported when you put it in the server.xml so you can't deploy the wars to any other path other than the name of the context file so deploying to /apps/admin. I know there is the special ROOT.xml for the root context but that doesn't solve the sub path issue which no one seems to know the answer to. i wonder what the motivation was for making it such that i can't configure the root context in its own file? As far as I know, you can - just put your default context in webapps/ROOT, and its associated Context element in webapps/ROOT/META-INF/context.xml. - 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: No Host matches server name localhost error
From: Paul Austin [mailto:[EMAIL PROTECTED] Subject: RE: No Host matches server name localhost error But the context path is only supported when you put it in the server.xml so you can't deploy the wars to any other path other than the name of the context file so deploying to /apps/admin. I believe the usual mechanism for handling this is a trivial ROOT webapp that forwards to the true default application. - 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: No Host matches server name localhost error
Paul Austin wrote: It seems that Tomcat 5.5 discourages you from putting contexts in the server.xml, and that is something that is a good idea as it's easier to manage them when they are outside. But the context path is only supported when you put it in the server.xml so you can't deploy the wars to any other path other than the name of the context file so deploying to /apps/admin. right. ideally i'd not put the context definition in server.xml. but deploying my webapp at the root path is more important to me (i'm operating in a pretty specific context and don't have to worry much about additional webapps being deployed into the container). i saw the suggestion for adding a ROOT webapp that forwards to the true webapp, but that seems silly. hopefully the folks who made this design decision can speak up and explain it. I know there is the special ROOT.xml for the root context but that doesn't solve the sub path issue which no one seems to know the answer to. i don't recall seeing any references to a ROOT.xml. i tried renaming my context xml file to ROOT.xml (within conf/Catalina/localhost of course) but it did not seem to have been processed (requests to / gave that same 400 error). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No Host matches server name localhost error
Brian Moseley wrote: i don't recall seeing any references to a ROOT.xml. i tried renaming my context xml file to ROOT.xml (within conf/Catalina/localhost of course) but it did not seem to have been processed (requests to / gave that same 400 error). and gosh, what a misleading error message - No Host matches server name localhost is obviously not true. maybe the message can be changed to more accurately convey that no context can be found for the request uri? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No Host matches server name localhost error
Hi, Parsons Technical Services wrote: Per the 5.5 doc you can't do it that way. You can only specify the path as a blank string when the context element is in the server.xml. To reiterate: so the only 2 ways to define the *default web app* for the host are either - to define the context in server.xml (which is inconvenient because it may e.g. contain JNDI resource definitions that have to be updated whenever META-INF/context.xml within the war changes) or - to name the war file for the default webapp ROOT.war (which is somewhat crappy, too, since it e.g. leaves no hint at what the war is about if someone just looks at the webapps drawer) If the above is true, I wonder why the path attribute of the context defined in META-INF/context.xml isn't simply considered in *any* case? Shouldn't this be considered a tomcat bug? -- Thomas Corte [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: No Host matches server name localhost error
First, let me clarify that I am only a user of Tomcat and was simply pointing out the part of the documentation. Now as for the issue, I am not sure that it is a bug but just a feature. Unless you can show where it does not meet the servlet specs then it will not be considered a bug. I am not sure why this is causing such a problem. The only time a default context will ever be used is if the browser is using an IP instead of a URL or if you have a DNS entry that points to your IP with no matching application. So unless you are using only the IP or are directing multiple unmatched URLs at the server there is no issue. If you are, then knowing what the war is about is only a small piece of the puzzle that exist in the setup. Just my understanding of the setup. Feel free to enlighten me if you think I am off base. Every aspect of a program is considered a feature. No matter how good or bad one may think it is. It only become a bug when it breaks a rule. Either the programmers rule, a system rule or a specification rule. If a feature that was considered bad by some could be classed as a bug, then 90% of the code written in the world would be bugs because somewhere there is someone who doesn't like it. Doug - Original Message - From: Thomas Corte [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Tuesday, August 30, 2005 4:28 PM Subject: Re: No Host matches server name localhost error Hi, Parsons Technical Services wrote: Per the 5.5 doc you can't do it that way. You can only specify the path as a blank string when the context element is in the server.xml. To reiterate: so the only 2 ways to define the *default web app* for the host are either - to define the context in server.xml (which is inconvenient because it may e.g. contain JNDI resource definitions that have to be updated whenever META-INF/context.xml within the war changes) or - to name the war file for the default webapp ROOT.war (which is somewhat crappy, too, since it e.g. leaves no hint at what the war is about if someone just looks at the webapps drawer) If the above is true, I wonder why the path attribute of the context defined in META-INF/context.xml isn't simply considered in *any* case? Shouldn't this be considered a tomcat bug? -- Thomas Corte [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]