开发者

Tomcat alias - cannot find WEB-INF/web.xml

开发者 https://www.devze.com 2023-02-18 11:04 出处:网络
I have setup aliases under tomcat in my server.xml as follows: <Host name=\"sub.domain.co.za\" appB开发者_JAVA技巧ase=\"/usr/local/tomcat/webapps/appname\">

I have setup aliases under tomcat in my server.xml as follows:

<Host name="sub.domain.co.za" appB开发者_JAVA技巧ase="/usr/local/tomcat/webapps/appname">
<Context path="" docBase="."/>
</Host>

This works fine except when navigating to more than one folder deep as follows: This works fine sub.domain.co.za and loads the tomcat application, however if you go to sub.domain.co.za/directory/index.jsp it gives an error 404 and the tomcat logs say cannot find WEB-INF/web.xml.

Anybody got any ideas?


If your webapp does not have a web.xml, then you will be able to find a web.xml in the following folder TOMCAT_HOME/conf

If a webapp does not have one of its own, then this web.xml used by tomcat.

To make sure there is nothing wrong with your tomcat setup, you can copy one of the example webapp (provided by tomcat), rename it to "appname" and try it accessing it. First try accessing it using "localhost" in your URL. Then try using the IP address in place of localhost. http://XXX.XXX.XXX.XX/index.jsp

Regarding your entry in server.xml. I think you will need an entry in the DNS server for this to work.

Setting up servers and their configuration is out of my area of expertise, but my two cents would probably help you debug and get you closer to the root of the problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号