dimanche 29 mars 2015

How to configure hibernate-entitymanager:4.3.8.Final to work with SLF4J?

I recently changed the hibernate-entitymanager version from 4.0.1 to 4.3.8.Fianl, after that I got this error when I deployed project to WildFly:



12:17:15,340 ERROR [stderr] (MSC service thread 1-5) log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.
12:17:15,341 ERROR [stderr] (MSC service thread 1-5) log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
12:17:15,341 ERROR [stderr] (MSC service thread 1-5) log4j:ERROR [ModuleClassLoader for Module "deployment.taolijie.war:main" from Service Module Loader] whereas object of type
12:17:15,342 ERROR [stderr] (MSC service thread 1-5) log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [ModuleClassLoader for Module "org.jboss.log4j.logmanager:main" from local module loader @12bc6874 (finder: local module finder @de0a01f (roots: /home/whf/app/wildfly-8.0.0.Final/modules,/home/whf/app/wildfly-8.0.0.Final/modules/system/layers/base))].
12:17:15,342 ERROR [stderr] (MSC service thread 1-5) log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
12:17:15,347 ERROR [stderr] (MSC service thread 1-5) log4j:WARN No appenders could be found for logger (org.jboss.logging).
12:17:15,348 ERROR [stderr] (MSC service thread 1-5) log4j:WARN Please initialize the log4j system properly.
12:17:15,348 ERROR [stderr] (MSC service thread 1-5) log4j:WARN See http://ift.tt/1foX5be for more info.


If I change the version of hinbernate-entitymanager back to 4.0.1, everything is fine. I have no idea about this.. How to fix?


Here is my pom.xml:



<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<!--<version>4.0.1.Final</version>-->
<version>4.3.8.Final</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>

Aucun commentaire:

Enregistrer un commentaire