请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Tomcat正常启动,输入url,页面显示找不到网页

Tomcat正常启动,输入url,页面显示找不到网页


项目启动后控制台信息:

E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75\bin\catalina.bat run

[2020-02-20 05:44:57,133] Artifact permission:war exploded: Waiting for server connection to start artifact deployment...

Using CATALINA_BASE:   "C:\Users\Administrator\.IntelliJIdea2019.1\system\tomcat\Tomcat_8_0_171_permission"

Using CATALINA_HOME:   "E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75"

Using CATALINA_TMPDIR: "E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75\temp"

Using JRE_HOME:        "D:\JavaJDK8\JDK\jre"

Using CLASSPATH:       "E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75\bin\bootstrap.jar;E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75\bin\tomcat-juli.jar"

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Server version:        Apache Tomcat/7.0.75

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Server built:          Jan 18 2017 20:54:42 UTC

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Server number:         7.0.75.0

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: OS Name:               Windows 10

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: OS Version:            10.0

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Architecture:          amd64

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Java Home:             D:\JavaJDK8\JDK\jre

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: JVM Version:           1.8.0_111-b14

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: JVM Vendor:            Oracle Corporation

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: CATALINA_BASE:         C:\Users\Administrator\.IntelliJIdea2019.1\system\tomcat\Tomcat_8_0_171_permission

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: CATALINA_HOME:         E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator\.IntelliJIdea2019.1\system\tomcat\Tomcat_8_0_171_permission\conf\logging.properties

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Dcom.sun.management.jmxremote=

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Dcom.sun.management.jmxremote.port=1099

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Dcom.sun.management.jmxremote.ssl=false

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\Administrator\.IntelliJIdea2019.1\system\tomcat\Tomcat_8_0_171_permission\jmxremote.password

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\Administrator\.IntelliJIdea2019.1\system\tomcat\Tomcat_8_0_171_permission\jmxremote.access

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Djava.rmi.server.hostname=127.0.0.1

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Djava.endorsed.dirs=E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75\endorsed

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Dcatalina.base=C:\Users\Administrator\.IntelliJIdea2019.1\system\tomcat\Tomcat_8_0_171_permission

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Dcatalina.home=E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.VersionLoggerListener log

信息: Command line argument: -Djava.io.tmpdir=E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75\temp

二月 20, 2020 5:44:59 下午 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: D:\JavaJDK8\JDK\jre\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;D:\JavaJDK8\JDK\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\MySQL\bin;D:\MongoDB\MongoDB\bin;E:\JAVA文档\Redis数据库\server;%MAV;N_HOME%\bin;\software\ICW\bin;龟\bin;;SystemRoot%\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;F:\PythonProject\venv\Scripts;E:\mukeProject\ShoppingProject\downloadSoftware\apache-maven-3.0.5\bin;C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin;E:\mukeProject\ShoppingProject\downloadSoftware\Git\cmd;C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps;;.

二月 20, 2020 5:44:59 下午 org.apache.coyote.AbstractProtocol init

信息: Initializing ProtocolHandler ["http-bio-8080"]

二月 20, 2020 5:44:59 下午 org.apache.coyote.AbstractProtocol init

信息: Initializing ProtocolHandler ["ajp-bio-8009"]

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.Catalina load

信息: Initialization processed in 952 ms

二月 20, 2020 5:44:59 下午 org.apache.catalina.core.StandardService startInternal

信息: Starting service Catalina

二月 20, 2020 5:44:59 下午 org.apache.catalina.core.StandardEngine startInternal

信息: Starting Servlet Engine: Apache Tomcat/7.0.75

二月 20, 2020 5:44:59 下午 org.apache.coyote.AbstractProtocol start

信息: Starting ProtocolHandler ["http-bio-8080"]

二月 20, 2020 5:44:59 下午 org.apache.coyote.AbstractProtocol start

信息: Starting ProtocolHandler ["ajp-bio-8009"]

二月 20, 2020 5:44:59 下午 org.apache.catalina.startup.Catalina start

信息: Server startup in 83 ms

Connected to server

[2020-02-20 05:44:59,738] Artifact permission:war exploded: Artifact is being deployed, please wait...

二月 20, 2020 5:45:02 下午 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.

二月 20, 2020 5:45:02 下午 org.springframework.web.context.ContextLoader initWebApplicationContext

信息: Root WebApplicationContext: initialization started

二月 20, 2020 5:45:03 下午 org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh

信息: Refreshing Root WebApplicationContext: startup date [Thu Feb 20 17:45:03 CST 2020]; root of context hierarchy

二月 20, 2020 5:45:03 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions

信息: Loading XML bean definitions from class path resource [applicationContext.xml]

2020-02-20 17:45:05.152 [RMI TCP Connection(4)-127.0.0.1] INFO  com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited

二月 20, 2020 5:45:05 下午 org.springframework.web.context.ContextLoader initWebApplicationContext

信息: Root WebApplicationContext: initialization completed in 2974 ms

[2020-02-20 05:45:06,025] Artifact permission:war exploded: Artifact is deployed successfully

[2020-02-20 05:45:06,026] Artifact permission:war exploded: Deploy took 6,288 milliseconds

二月 20, 2020 5:45:09 下午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deploying web application directory E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75\webapps\manager

二月 20, 2020 5:45:09 下午 org.apache.catalina.startup.HostConfig deployDirectory

信息: Deployment of web application directory E:\mukeProject\ShoppingProject\downloadSoftware\apache-tomcat-7.0.75\webapps\manager has finished in 262 ms

接口:

https://img1.sycdn.imooc.com//szimg/5e4e59b90985d68007190470.jpg


输入的url: http://localhost:8080/test/hello

https://img1.sycdn.imooc.com//szimg/5e4e57c7097fa23c09360482.jpg


出现这个问题后,我去逛了逛评论区类似的问题,但是没有找到解决的办法

还有就是我的compiler.xml之前是这样的


https://img1.sycdn.imooc.com//szimg/5e4e591409ab137c08710294.jpg

然后build就会出现

https://img1.sycdn.imooc.com//szimg/5e4e594e090db19e07120121.jpg

然后我按照老师的compiler.xml手动添加了下面的几行代码才能正常编译,弄了一下午没有解决,第一次用idea来创建项目,遇到这个问题比较头疼,只好跑过来问老师了..

正在回答

1回答

你好,这里指定了需要使用jdk8,你确定好这些配置后,删除已有的重新生成即可。页面找不到代表请求不对,如果代码没问题,很可能是部署导致的,保证application context为/就可以(如果是war包直接放在tomcat webapp目录下,这个context会多出一层包名,实际访问时就需要带上包名)

1 回复 有任何疑惑可以回复我~
  • 老师,保证application context为/就可以,这句话我没读懂。
    回复 有任何疑惑可以回复我~ 2020-02-20 22:08:19
  • 原来是Deployment中的Application context,之前后面有一串,现在改成/就可以正常访问了,谢谢老师。
    回复 有任何疑惑可以回复我~ 2020-02-21 00:24:22
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信