SLF4Jに依存しています。このエラーが発生します:
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.
これが私のMavenエントリです:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
問題はどこだ?
編集: log4j依存関係がないと、次の例外が発生します
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)
at org.apache.bval.jsr303.ConfigurationImpl.<clinit>(ConfigurationImpl.java:50)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at org.apache.bval.jsr303.ApacheValidationProvider.createGenericConfiguration(ApacheValidationProvider.java:66)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:173)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:50)
at com.daimler.zv9.basic.entity.AbstractEntity.<clinit>(AbstractEntity.java:73)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:228)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:195)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:168)
EDIT2:これは私が入手したMAVENツリーの例です
[INFO] com.myCompany.abc:ABC_Document:ejb:0.0.1-SNAPSHOT
[INFO] +- com.myCompany.abc:ABC_Basic:jar:0.0.1-SNAPSHOT:compile
[INFO] +- com.myCompany.iap:javax.j2ee:jar:5.0.0:provided
[INFO] +- com.myCompany.iap:logging:jar:5.0.0:provided
[INFO] +- com.myCompany.iap:util:jar:5.0.0:provided
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- javax.servlet:jstl:jar:1.2:provided
[INFO] +- org.slf4j:slf4j-api:jar:1.6.6:compile
[INFO] +- org.slf4j:slf4j-simple:jar:1.6.6:compile
[INFO] \- org.mockito:mockito-all:jar:1.9.0:test