NutzCN Logo
问答 打印结果没有shiro相关日志
发布于 2534天前 作者 qq_753729fe 2766 次浏览 复制 上一个帖子 下一个帖子
标签:

按照配置并pom.xml中配置了shiro

 <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz-integration-shiro</artifactId>
      <version>${nutz.version}</version>
    </dependency>
<dependency>
      <groupId>org.apache.shiro</groupId>
      <artifactId>shiro-all</artifactId>
      <version>${shiro.version}</version>
    </dependency>
  <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>

打印结果没有shiro相关日志

Connected to server
[2018-01-14 10:15:21,768] Artifact nutzStudy:war exploded: Artifact is being deployed, please wait...
14-Jan-2018 22:15:23.522 信息 [RMI TCP Connection(4)-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.
[INFO ] 22:15:24.400 org.nutz.mvc.NutFilter._init(NutFilter.java:85) - NutFilter[nutz] starting ...
[DEBUG] 22:15:24.419 org.nutz.resource.Scans.printLocations(Scans.java:527) - Locations count=4 time use 4ms
[DEBUG] 22:15:24.443 org.nutz.resource.Scans.printLocations(Scans.java:527) - Locations count=31 time use 23ms
[DEBUG] 22:15:24.467 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:61) - Loading by class org.nutz.mvc.impl.NutLoading
[INFO ] 22:15:24.471 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) - Nutz Version : 1.r.63-SNAPSHOT 
[INFO ] 22:15:24.471 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) - Nutz.Mvc[nutz] is initializing ..
4 回复

下面是整个配置

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.gree</groupId>
  <artifactId>nutzStudy</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>nutzStudy Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <!-- UTF8大法好 -->
  <properties>
    <!-- UTF8大法好 -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <nutz.version>1.r.63</nutz.version>
    <mysql.version>5.1.40</mysql.version>
    <javax.servlet.api.version>3.1.0</javax.servlet.api.version>
    <druid.version>1.0.27</druid.version>
    <junit.version>4.12</junit.version>
    <slf4j.version>1.7.21</slf4j.version>
    <logback.version>1.1.8</logback.version>
    <jstl.version>1.2</jstl.version>
    <log4j.version>1.2.17</log4j.version>
    <slf4j.version>1.7.25</slf4j.version>
    <shiro.version>1.3.2</shiro.version>
    <quartz.version>2.3.0</quartz.version>
    <javax.mail.version>1.5.2</javax.mail.version>
    <commons-email.version>1.3.3</commons-email.version>
    <commons-logging.version>1.2</commons-logging.version>
    <commons-beanutils.version>1.9.3</commons-beanutils.version>

  </properties>

  <dependencies>
    <!-- 核心jar -->
    <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz</artifactId>
      <version>${nutz.version}</version>
    </dependency>
    <!-- mysql驱动 -->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>${mysql.version}</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>${javax.servlet.api.version}</version>
      <scope>provided</scope>
    </dependency>
    <!-- Druid连接池 -->
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>druid</artifactId>
      <version>${druid.version}</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>jstl</artifactId>
      <version>${jstl.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.nutz/nutz-integration-shiro -->
    <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz-integration-shiro</artifactId>
      <version>${nutz.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>${commons-logging.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
      <version>${commons-beanutils.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-all -->
    <dependency>
      <groupId>org.apache.shiro</groupId>
      <artifactId>shiro-all</artifactId>
      <version>${shiro.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.nutz/nutz-integration-quartz -->
    <dependency>
      <groupId>org.nutz</groupId>
      <artifactId>nutz-integration-quartz</artifactId>
      <version>${nutz.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.quartz-scheduler/quartz -->
    <dependency>
      <groupId>org.quartz-scheduler</groupId>
      <artifactId>quartz</artifactId>
      <version>${quartz.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/javax.mail/javax.mail-api -->
    <!-- https://mvnrepository.com/artifact/com.sun.mail/javax.mail -->
    <dependency>
      <groupId>com.sun.mail</groupId>
      <artifactId>javax.mail</artifactId>
      <version>${javax.mail.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-email -->
    <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-email -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-email</artifactId>
      <version>${commons-email.version}</version>
    </dependency>


    <!--log4j-->
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j.version}</version>
    </dependency>

  </dependencies>
  <build>
    <finalName>nutzStudy</finalName>
  </build>
  <repositories>
    <repository>
      <id>nutz</id>
      <url>https://jfrog.nutz.cn/artifactory/jcenter</url>
    </repository>
    <repository>
      <id>nutz-snapshots</id>
      <url>https://jfrog.nutz.cn/artifactory/snapshots</url>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>

</project>

缺slf4j-log4j12

这个不是加了吗

<dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>

去掉

 <scope>test</scope>
添加回复
请先登陆
回到顶部