eclipse配置好tomcat后,请求路径也对,但就是报404,请问怎么解决?

下面是控制台信息
一月 02, 2018 2:21:02 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_151\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_151/bin/server;C:/Program Files/Java/jre1.8.0_151/bin;C:/Program Files/Java/jre1.8.0_151/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_151\bin;C:\Program Files\Java\jdk1.8.0_151\jre\bin;D:\eclipse\eclipse;;.
一月 02, 2018 2:21:02 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
一月 02, 2018 2:21:02 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8009"]
一月 02, 2018 2:21:02 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 523 ms
一月 02, 2018 2:21:02 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
一月 02, 2018 2:21:02 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.82
一月 02, 2018 2:21:04 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
一月 02, 2018 2:21:04 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\docs
一月 02, 2018 2:21:05 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
一月 02, 2018 2:21:05 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\docs has finished in 868 ms
一月 02, 2018 2:21:05 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\examples
一月 02, 2018 2:21:06 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
一月 02, 2018 2:21:06 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
一月 02, 2018 2:21:06 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
一月 02, 2018 2:21:06 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@402ce79')
一月 02, 2018 2:21:06 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\examples has finished in 1,238 ms
一月 02, 2018 2:21:06 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\host-manager
一月 02, 2018 2:21:07 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
一月 02, 2018 2:21:07 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\host-manager has finished in 599 ms
一月 02, 2018 2:21:07 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\manager
一月 02, 2018 2:21:07 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
一月 02, 2018 2:21:07 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\manager has finished in 505 ms
一月 02, 2018 2:21:07 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\ROOT
一月 02, 2018 2:21:08 下午 org.apache.catalina.startup.TldConfig execute
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
一月 02, 2018 2:21:08 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\Tomcat\apache-tomcat-7.0.82\webapps\ROOT has finished in 487 ms
一月 02, 2018 2:21:08 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
一月 02, 2018 2:21:08 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
一月 02, 2018 2:21:08 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 5758 ms
图片说明

首先看一下webapp下面有没有项目,有项目证明部署上去了,那应该就是路径问题了,WEB-INF下面的页面,不可以通过url直接访问,如果东西不在WEB-INF下,路径对的还是访问不了,看看是否被拦截了

会不会是你指定的目录没有存储访问的文件

从Tomcat启动看,启动未报错,看看项目.class在webapps里有没有,然后再确定访问路径。建议jdk和Tomcat配套,要么都用7或8

你把你的重新全部改成D,感觉还是你有地方指定错误了

看看是不是你发布的项目不是你本身命名的项目不一致:图片说明
你也可以直接浏览tomcat下的项目名,从目前看,你的指定路径肯定不是对的,tomcat根本就没有执行。

很明显你的tomcat是正常启动的,应该是访问路径不对导致404错误,你可以使用http://localhost:8080访问下,看是否可以看到页面,如果有应该是tomcat正常启动了。

怎么添加的项目,你的请求访问路径是什么

启动是没问题的 应该是你项目的目录有问题 就是你的访问路径出错了。建议先在tomcat内部启动一下,查看访问是否正常 再看webapp目录下的项目名和你访问的路径名

重新看下项目配置,重新编译看报错不,发布tomcat,启动

服务已经启动了,只是你访问页面的路径写错了。例如你访问下面的页面的话,需要保证在你项目(doc)的根目录下有test.html才行。
例如:http://localhost:8080/doc/test.html

另外,如果是在eclipse启动的tomcat,无论服务启动成功与否,访问http://localhost:8080 都会返回404

看一下网络是否能ping通

看看这是不是也有地址信息图片说明

jsp页面要写action才可以访问,不能直接访问。

会不会是web.xml没有配置或者配错了

tomcat报404,是请求路径的问题。
可以试着加上项目名试试,如果原来加了项目名,那就去掉试一下。

直接把项目下所有内容全部粘贴进webapps-ROOT内,在conf-server.xml里把你配置的host下的context标签删除,重新启动试试吧(望采纳)

这个问题我遇到过,关闭eclipse,关闭tomcat,然后再任务管理器找到他们的任务器关闭在打开就可以了

如果你用的是旧的tomcat的话最好把之前的项目删除,重新部署你的项目。如果都不行,那就去官网下载一个新的试试看,启动之前,一定要配置好,要不然就算不报错,访问可能会遇到404。

一、启动后,看下tomcat目录下的webapp里面有无该项目
二、看下你的页面放在哪个目录,如果是WEB-INF下面的话,单单通过页面去访问是访问不到的。
三、如果你的项目没有做过类似于ssm框架的试图解析器的话,看看访问的url有没有加上项目的名称。

如果页面是放在webapp下的,那么相应的url访问是:localhost:8080/项目名称/页面.jsp

你把项目的部署路径更改下,就是webapps的地方,改成你的tomcat的路径下的webapps图片说明

首先你要看看你的页面是否在 web-inf下面 弱是这下面 他是不能通过浏览器进行直接访问的 只能通过控制器访问

你看一下 (1)、web.xml需要配置访问路由,
(2)、需要将你的项目加载到tomcat中,
(3)、看你的tomcat时否配置成功,直接在浏览器访问这个URL:http://localhost:8080
(4)、看你的Jsp或者html是不是在WEB-INF文件夹下,如果是,从浏览器是直接访问不到的,必须从controller直接访问
如果以上QQ me:564580134