NutzCN Logo
问答 项目启动又失败。。。fuck
发布于 2545天前 作者 蛋蛋的忧伤 1799 次浏览 复制 上一个帖子 下一个帖子
标签:

启动时这个错误。。。妈的搞死我了

D:\Dev\apache-tomcat-8.0.44\bin\catalina.bat run
[2018-01-03 10:23:40,280] Artifact WhiteGold-Api2:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "D:\_idea\system\tomcat\Unnamed_WhiteGold"
Using CATALINA_HOME:   "D:\Dev\apache-tomcat-8.0.44"
Using CATALINA_TMPDIR: "D:\Dev\apache-tomcat-8.0.44\temp"
Using JRE_HOME:        "D:\Dev\java 8\jdk"
Using CLASSPATH:       "D:\Dev\apache-tomcat-8.0.44\bin\bootstrap.jar;D:\Dev\apache-tomcat-8.0.44\bin\tomcat-juli.jar"
Connected to the target VM, address: '127.0.0.1:55726', transport: 'socket'
03-Jan-2018 10:23:41.175 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.44
03-Jan-2018 10:23:41.182 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          May 10 2017 17:21:09 UTC
03-Jan-2018 10:23:41.182 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.44.0
03-Jan-2018 10:23:41.182 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 7
03-Jan-2018 10:23:41.182 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.1
03-Jan-2018 10:23:41.182 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
03-Jan-2018 10:23:41.182 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             D:\Dev\java 8\jdk\jre
03-Jan-2018 10:23:41.182 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_131-b11
03-Jan-2018 10:23:41.183 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
03-Jan-2018 10:23:41.183 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         D:\_idea\system\tomcat\Unnamed_WhiteGold
03-Jan-2018 10:23:41.183 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         D:\Dev\apache-tomcat-8.0.44
03-Jan-2018 10:23:41.184 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=D:\_idea\system\tomcat\Unnamed_WhiteGold\conf\logging.properties
03-Jan-2018 10:23:41.184 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
03-Jan-2018 10:23:41.184 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:55726,suspend=y,server=n
03-Jan-2018 10:23:41.184 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:D:\_idea\system\captureAgent\debugger-agent.jar=C:\Users\Administrator\AppData\Local\Temp\capture623.props
03-Jan-2018 10:23:41.184 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF-8
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=D:\Dev\apache-tomcat-8.0.44\endorsed
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=D:\_idea\system\tomcat\Unnamed_WhiteGold
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\Dev\apache-tomcat-8.0.44
03-Jan-2018 10:23:41.185 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\Dev\apache-tomcat-8.0.44\temp
03-Jan-2018 10:23:41.186 信息 [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: D:\Dev\java 8\jdk\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Dev\java 8\jdk\bin;C:\Program Files\TortoiseSVN\bin;D:\Dev\apache-maven-3.5.0\bin;;.
03-Jan-2018 10:23:41.379 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
03-Jan-2018 10:23:41.402 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Jan-2018 10:23:41.410 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
03-Jan-2018 10:23:41.413 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
03-Jan-2018 10:23:41.413 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 540 ms
03-Jan-2018 10:23:41.459 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
03-Jan-2018 10:23:41.460 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.44
03-Jan-2018 10:23:41.476 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
03-Jan-2018 10:23:41.491 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
03-Jan-2018 10:23:41.496 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 82 ms
Connected to server
[2018-01-03 10:23:41,876] Artifact WhiteGold-Api2:war exploded: Artifact is being deployed, please wait...
03-Jan-2018 10:23:44.967 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 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.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
03-Jan-2018 10:23:45.636 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
03-Jan-2018 10:23:45.637 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
[2018-01-03 10:23:45,653] Artifact WhiteGold-Api2:war exploded: Error during artifact deployment. See server log for details.
03-Jan-2018 10:23:51.481 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory D:\Dev\apache-tomcat-8.0.44\webapps\manager
03-Jan-2018 10:23:51.566 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory D:\Dev\apache-tomcat-8.0.44\webapps\manager has finished in 84 ms

web.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
project

COOKIE


org.apache.shiro.web.env.EnvironmentLoaderListener


ShiroFilter
org.apache.shiro.web.servlet.ShiroFilter


ShiroFilter
/*
REQUEST
FORWARD
INCLUDE
ERROR


DruidWebStatFilter
com.alibaba.druid.support.http.WebStatFilter


exclusions
*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*,/rs/*



DruidWebStatFilter
/*


nutz
org.nutz.mvc.NutFilter

modules
com.yixin.whitegold.MainModule


ignore
^(.+[.])(html|png|gif|jpg|js|css|jspx|jpeg|ftl|jsp|ico)$



nutz
/*

REQUEST
FORWARD
INCLUDE


DruidStatView
com.alibaba.druid.support.http.StatViewServlet


DruidStatView
/druid/*



freemarker
freemarker.ext.servlet.FreemarkerServlet

TemplatePath
/


template_exception_handler
ignore


ContentType
text/html


template_update_delay
0


default_encoding
UTF-8


locale
zh_CN


number_format
0.##########


datetime_format
yyyy-MM-dd HH:mm:ss

2


freemarker
*.ftl


freemarker
*.html

我去掉web.xml里的如下shiro配置就能正常启动,这是为啥?


org.apache.shiro.web.env.EnvironmentLoaderListener


ShiroFilter
org.apache.shiro.web.servlet.ShiroFilter


ShiroFilter
/*
REQUEST
FORWARD
INCLUDE
ERROR

```

9 回复

web.xml配置:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>project</display-name>
  <session-config>
    <tracking-mode>COOKIE</tracking-mode>
  </session-config>
  <listener>
    <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
  </listener>
  <filter>
    <filter-name>ShiroFilter</filter-name>
    <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>ShiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
  </filter-mapping>

  <filter>
    <filter-name>DruidWebStatFilter</filter-name>
    <filter-class>com.alibaba.druid.support.http.WebStatFilter
    </filter-class>
    <init-param>
      <param-name>exclusions</param-name>
      <param-value>*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*,/rs/*</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>DruidWebStatFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <filter>
    <filter-name>nutz</filter-name>
    <filter-class>org.nutz.mvc.NutFilter</filter-class>
    <init-param>
      <param-name>modules</param-name>
      <param-value>com.yixin.whitegold.MainModule</param-value>
    </init-param>
    <init-param>
      <param-name>ignore</param-name>
      <param-value>^(.+[.])(html|png|gif|jpg|js|css|jspx|jpeg|ftl|jsp|ico)$</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>nutz</filter-name>
    <url-pattern>/*</url-pattern>
    <!-- ForwardView需要下面的配置 @Ok("->:/xxx/yyy/zzz") -->
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
  </filter-mapping>

  <servlet>
    <servlet-name>DruidStatView</servlet-name>
    <servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>DruidStatView</servlet-name>
    <url-pattern>/druid/*</url-pattern>
  </servlet-mapping>

  <!-- freemarker -->
  <servlet>
    <servlet-name>freemarker</servlet-name>
    <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
    <init-param>
      <param-name>TemplatePath</param-name>
      <param-value>/</param-value>
    </init-param>
    <init-param>
      <param-name>template_exception_handler</param-name>
      <param-value>ignore</param-value>
    </init-param>
    <init-param>
      <param-name>ContentType</param-name>
      <param-value>text/html</param-value>
    </init-param>
    <init-param>
      <param-name>template_update_delay</param-name>
      <param-value>0</param-value>
    </init-param>
    <init-param>
      <param-name>default_encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
      <param-name>locale</param-name>
      <param-value>zh_CN </param-value>
    </init-param>
    <init-param>
      <param-name>number_format</param-name>
      <param-value>0.##########</param-value>
    </init-param>
    <init-param>
      <param-name>datetime_format</param-name>
      <param-value>yyyy-MM-dd HH:mm:ss</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>freemarker</servlet-name>
    <url-pattern>*.ftl</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>freemarker</servlet-name>
    <url-pattern>*.html</url-pattern>
  </servlet-mapping>

</web-app>
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details

缺日志包, slf4j-log4j12

去掉shiro的如下配置就能正常启动。。

<listener>
    <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
  </listener>
  <filter>
    <filter-name>ShiroFilter</filter-name>
    <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>ShiroFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
  </filter-mapping>

有时候虽然抛这个异常但是还是可以执行的

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details

但是现在直接启动不了,然后去掉shiro配置后就行。。。

你没加,有的话就不会打印这个警告

另外, 不要再发这种没意义的标题!!!

哦好。。。有点激动不好意思了....

最后的问题所在竟然是shiro.ini配置写错了,竟然没打印日志....

添加回复
请先登陆
回到顶部