tomcat显示空白页

t1rydlwq  于 2021-07-12  发布在  Java
关注(0)|答案(0)|浏览(200)

重新安装intellij idea后,运行项目并打开url时会出现一个空页面localhost:8081/test/. (/test/应该是我项目的url,它是在run/debug配置中配置的,我希望我做得对..)
这是tomcat catalina日志。

13-Feb-2020 22:38:36.180 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Users\F555L\.IntelliJIdea2019.3\system\tomcat\Tomcat_9_0_27_final_2
13-Feb-2020 22:38:36.181 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat 9.0
13-Feb-2020 22:38:36.181 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\F555L\.IntelliJIdea2019.3\system\tomcat\Tomcat_9_0_27_final_2\conf\logging.properties
13-Feb-2020 22:38:36.181 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
13-Feb-2020 22:38:36.182 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
13-Feb-2020 22:38:36.182 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
13-Feb-2020 22:38:36.182 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
13-Feb-2020 22:38:36.182 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\F555L\.IntelliJIdea2019.3\system\tomcat\Tomcat_9_0_27_final_2\jmxremote.password
13-Feb-2020 22:38:36.182 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\F555L\.IntelliJIdea2019.3\system\tomcat\Tomcat_9_0_27_final_2\jmxremote.access
13-Feb-2020 22:38:36.182 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
13-Feb-2020 22:38:36.183 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
13-Feb-2020 22:38:36.183 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
13-Feb-2020 22:38:36.183 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
13-Feb-2020 22:38:36.183 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\F555L\.IntelliJIdea2019.3\system\tomcat\Tomcat_9_0_27_final_2
13-Feb-2020 22:38:36.183 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
13-Feb-2020 22:38:36.183 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 9.0\temp
13-Feb-2020 22:38:36.184 INFO [main] 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\jdk1.8.0_221\jre\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Microsoft MPI\Bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;D:\u\matlab\runtime\win64;C:\Program Files\Java\jdk1.8.0_221C:\Program Files\Java\jdk1.8.0_221;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\Git\cmd;C:\Program Files\apache-maven-3.6.3\bin\;C:\postgresql;C:\Program Files\JetBrains\IntelliJ IDEA 2019.3.3\bin;;.]
13-Feb-2020 22:38:37.108 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8081"]
13-Feb-2020 22:38:37.163 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1В 788] milliseconds
13-Feb-2020 22:38:37.292 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
13-Feb-2020 22:38:37.292 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.31]
13-Feb-2020 22:38:37.305 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8081"]
13-Feb-2020 22:38:37.322 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [158] milliseconds
Connected to server
[2020-02-13 10:38:37,405] Artifact final:war: Artifact is being deployed, please wait...
2020-02-13 22:38:45 INFO  ConnectionPoolImpl:53 - Connection pool has been created
2020-02-13 22:38:45 INFO  ApplicationContextListener:18 - Context was initialized
[2020-02-13 10:38:45,966] Artifact final:war: Artifact is deployed successfully
[2020-02-13 10:38:45,966] Artifact final:war: Deploy took 8,561 milliseconds
13-Feb-2020 22:38:47.556 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory Установка веб приложения в папку [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager]
13-Feb-2020 22:38:48.159 INFO [Catalina-utility-2] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\manager] has finished in [601] ms

web xml

<?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns="http://xmlns.jcp.org/xml/ns/javaee"
             xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
             version="3.1">
        <display-name>test</display-name>
        <absolute-ordering/>
        <servlet-mapping>
            <servlet-name>default</servlet-name>
            <url-pattern>*.css</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>default</servlet-name>
            <url-pattern>*.js</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>default</servlet-name>
            <url-pattern>*.jpg</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>default</servlet-name>
            <url-pattern>*.png</url-pattern>
        </servlet-mapping>

         <error-page>
            <error-code>404</error-code>
            <location>/jsp/errors/error404.jsp</location>
        </error-page>
    </web-app>

项目结构如下所示在这里输入图像描述

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题