解决 : Apache Tomcat8.0.0-RC1 - Error report ... HTTP Status 404

    xiaoxiao2021-04-04  73

    1.报错:

    Apache Tomcat/8.0.0-RC1 - Error report HTTP Status 404 - /richer/getOnLineRicherCount The requested resource is not available.

    2.  用jetty  就可以运行,用tomcat就报这个错

    3.  原因和解决: 

    1)请求访问路径错了,请求路径不完整:

    jetty 是默认访问的项目根路径,请求不用写工程名,而 tomcat 是默认带上工程名,是我的请求访问路径错了,我把工程名加上就OK了。

    如错误写法:http://localhost:8086/api/v1/work_collect/getWorkWeightAll?startTime=2018-06-01&endTime=2018-06-30 (这种请求 是符合 jetty 默认方式的,但 tomcat 默认方式是不支持的。

    正确写法http://localhost:8086/wwr/api/v1/work_collect/getWorkWeightAll?startTime=2018-06-01&endTime=2018-06-30

    wwr 是我的工程名。在 tomcat  部署时请求路径 默认是需要带上工程名的。

    当然,把 tomcat 也设置为请求不带工程名访问也是可以解决这个问题的。

    2)参数不对:

    我的第2种情况是:参数不对,参数要求一定要2个,我只传了1个。

    转载请注明原文地址: https://ju.6miu.com/read-666090.html

    最新回复(0)