2010-09-22 16 views
5

के साथ समस्याएं मैं "शुरुआती हाइबरनेट 3.5" के माध्यम से काम करने की कोशिश कर रहा हूं, और मैंने प्रारंभिक स्नैग मारा है।हाइबरनेट 3.5 शुरू करना - चींटी कार्य

जब मैं ant exportDDL चलाने के लिए, मैं निम्नलिखित त्रुटि हो:

exportDDL: 
    [htools] Executing Hibernate Tool with a Hibernate Annotation/EJB3 Configuration 
    [htools] 1. task: hbm2ddl (Generates database schema) 
    [htools] SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8] 
    [htools] SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details. 
    [htools] An exception occurred while running exporter #2:hbm2ddl (Generates database schema) 
    [htools] To get the full stack trace run ant with -verbose 
    [htools] Problems in creating a AnnotationConfiguration. Have you remembered to add it to the classpath ? 
    [htools] java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple; 

BUILD FAILED 
C:\hibernate\project\build.xml:30: Problems in creating a AnnotationConfiguration. Have you 
remembered to add it to the classpath ? 
निम्नलिखित चींटी कार्य के साथ

:

<target name="exportDDL" depends="compile"> 
    <mkdir dir="${sql}"/> 
    <htools destdir="${sql}"> 
     <classpath refid="classpath.tools"/> 
     <annotationconfiguration 
       configurationfile="${src}/hibernate.cfg.xml"/> 
     <hbm2ddl drop="true" outputfilename="sample.sql"/> 
    </htools> 
</target> 
<target name="compile"> 
    <javac srcdir="${src}" destdir="${bin}" classpathref="classpath.base"/> 
</target> 

क्या यहाँ हो रहा है? ant compile ठीक काम करता है, लेकिन exportDDL कार्य नहीं करता है। एसएल 4 जे जार क्लासपाथ पर है, और मैंने slf4j-simple-1.6.1.jar डाउनलोड किया। विचार?

उत्तर

18

यहाँ हल करती है कि आप क्या चाहते

Mixing mixing different versions of slf4j artifacts can cause problems. For example, if you are using slf4j-api-1.6.1.jar, then you should also use slf4j-simple-1.6.1.jar, using slf4j-simple-1.5.5.jar will not work.

In general, you should make sure that the slf4j-api version matches that of the slf4j binding.

At initialization time, if SLF4J suspects that there may be a version mismatch problem, it will emit a warning about the suspected mismatch. For the exact details of the version mismatch detection mechanism, please refer to the relevant entry in the FAQ.

+0

यूप। ऐसा लगता है जैसे sl4j-api-1.5.8 –

3

यहाँ एक उदाहरण मैं SLF4J के पार चेतावनी शुरू आया है जब आप असंगत slf4j संस्करणों मिल गया है:

SLF4J: अनुरोध संस्करण 1.5.10 द्वारा आपका slf4j बाध्यकारी [1.6] SLF4J के साथ संगत नहीं है: अधिक जानकारी के लिए http://www.slf4j.org/codes.html#version_mismatch देखें।

संबंधित मुद्दे