java - JUL TO SLF4J on TomEE 1.7.2 with maven plugin -
i use slf4j api log4j2 impl inside tomee maven project. result added inside pom.xml :
<dependency> <groupid>org.slf4j</groupid> <artifactid>slf4j-api</artifactid> <version>1.7.12</version> </dependency> <dependency> <groupid>org.slf4j</groupid> <artifactid>jul-to-slf4j</artifactid> <version>1.7.12</version> </dependency> <dependency> <groupid>org.apache.logging.log4j</groupid> <artifactid>log4j-slf4j-impl</artifactid> <version>2.4</version> </dependency> <dependency> <groupid>org.apache.logging.log4j</groupid> <artifactid>log4j-api</artifactid> <version>2.4</version> </dependency> <dependency> <groupid>org.apache.logging.log4j</groupid> <artifactid>log4j-core</artifactid> <version>2.4</version> </dependency>
i edited logging.properties file of tomee :
handlers = org.slf4j.bridge.slf4jbridgehandler
and try run project maven command :
mvn package tomee:run
unfortunately got exception :
objc[2756]: class javalaunchhelper implemented in both /library/java/javavirtualmachines/jdk1.8.0_60.jdk/contents/home/jre/bin/java , /library/java/javavirtualmachines/jdk1.8.0_60.jdk/contents/home/jre/lib/libinstrument.dylib. 1 of 2 used. 1 undefined. handler error java.lang.classnotfoundexception: org.slf4j.bridge.slf4jbridgehandler @ java.net.urlclassloader.findclass(urlclassloader.java:381) @ java.lang.classloader.loadclass(classloader.java:424) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:331) @ java.lang.classloader.loadclass(classloader.java:357) @ org.apache.juli.classloaderlogmanager.readconfiguration(classloaderlogmanager.java:560) @ org.apache.juli.classloaderlogmanager.readconfiguration(classloaderlogmanager.java:503) @ org.apache.juli.classloaderlogmanager.readconfiguration(classloaderlogmanager.java:311) @ java.util.logging.logmanager$3.run(logmanager.java:399) @ java.util.logging.logmanager$3.run(logmanager.java:396) @ java.security.accesscontroller.doprivileged(native method) @ java.util.logging.logmanager.readprimordialconfiguration(logmanager.java:396) @ java.util.logging.logmanager.access$800(logmanager.java:145) @ java.util.logging.logmanager$2.run(logmanager.java:345) @ java.security.accesscontroller.doprivileged(native method) @ java.util.logging.logmanager.ensurelogmanagerinitialized(logmanager.java:338) @ java.util.logging.logmanager.getlogmanager(logmanager.java:378) @ java.util.logging.logger.demandlogger(logger.java:448) @ java.util.logging.logger.getlogger(logger.java:502) @ org.apache.juli.logging.directjdklog.<init>(directjdklog.java:71) @ org.apache.juli.logging.directjdklog.getinstance(directjdklog.java:196) @ org.apache.juli.logging.logfactory.getinstance(logfactory.java:67) @ org.apache.juli.logging.logfactory.getinstance(logfactory.java:93) @ org.apache.juli.logging.logfactory.getlog(logfactory.java:102) @ org.apache.catalina.startup.bootstrap.<clinit>(bootstrap.java:59)
i tried add dependencies lib :
<plugin> <groupid>org.apache.openejb.maven</groupid> <artifactid>tomee-maven-plugin</artifactid> <configuration> <context>root</context> <libs> <li>org.slf4j:slf4j-api:1.7.12</li> <lib>org.slf4j:jul-to-slf4j:1.7.12</lib> </libs> </configuration> </plugin>
i can see inside maven console :
[info] copied 'org.slf4j:slf4j-api:1.7.12' in '/users/xxx/work/git/xxx/target/apache-tomee/lib/slf4j-api-1.7.12.jar [info] copied 'org.slf4j:jul-to-slf4j:1.7.12' in '/users/xxx/work/git/xxx/target/apache-tomee/lib/jul-to-slf4j-1.7.12.jar
but got same exception :(
after inside jul-to-slf4j-1.7.12.jar can see org.slf4j.bridge.slf4jbridgehandler class file present.
i don't understand why tomee can't find ? possible mac's jdk bug has related ? objc[10012]: class javalaunchhelper implemented in both ... libinstrument.dylib. 1 of 2 used. 1 undefined
thank !
<li>org.slf4j:slf4j-api:1.7.12</li>
b missing inside li tag. updated lib
Comments
Post a Comment