# hibernateTool not working

**URL:** <https://discuss.gradle.org/t/hibernatetool-not-working/14231>\
**Category:** Plugin Portal\
**Tags:** plugins, hibernate\
**Created:** [February 5, 2016, 2:30pm UTC](https://discuss.gradle.org/t/hibernatetool-not-working/14231 "2016-02-05T14:30:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohitjoins](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@rohitjoins](https://discuss.gradle.org/u/rohitjoins)\
**Post date:** [February 5, 2016, 2:30pm UTC](https://discuss.gradle.org/t/hibernatetool-not-working/14231/1 "2016-02-05T14:30:35Z")

</div>

I’m trying to create a task to convert cfg to sql and I’m using hibernate 3.

My ant task for same looks like this -

ant {  
taskdef(name: ‘hibernateTool’,  
classname: ‘org.hibernate.tool.ant.HibernateToolTask’,  
classpath: configurations.hibernatetool.asPath  
)  
hibernateTool(destdir: ‘resources/b2c/hibernate/schema’) {  
annotationconfiguration(configurationfile: ‘resources/b2c/hibernate/hibernate.b2c.cfg.xml’)  
hbm2ddl(export: true, outputfilename: ‘db-b2c-update-ddl.sql’)  
classpath {  
pathelement(path: ‘classes’)  
fileset(dir: ‘…/intl\_lib’) {  
include(name: ‘\*\*/\*.jar’)  
}  
}  
}  
}

I have added the following dependencies for the same -

hibernatetool group: ‘org.hibernate’, name: ‘hibernate-tools’, version: '[3.2.4.GA](http://3.2.4.GA)’  
hibernatetool group: ‘org.hibernate’, name: ‘hibernate-entitymanager’, version: ‘3.6.10.Final’

Applied plugin -

id “org.hibernate.gradle.tools” version “1.2.3”

Set configuration as -

configurations {  
hibernatetool  
}

I’m getting the following error while running the task -

[ant:hibernateTool] SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.  
[ant:hibernateTool] SLF4J: Defaulting to no-operation (NOP) logger implementation  
[ant:hibernateTool] SLF4J: See [http://www.slf4j.org/codes.html#StaticLoggerBinder](http://www.slf4j.org/codes.html#StaticLoggerBinder) for further details.

Here is the stack trace for the same -  
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory  
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1366)  
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1315)  
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1068)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)  
… 165 more

Any leads on this is appreciated.

Thanks  
Rohit

---

<div class="post-metadata">

**Author:** ![eljobe](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/eljobe/32/4290_2.png) [@eljobe](https://discuss.gradle.org/u/eljobe)\
**Post date:** [February 10, 2016, 2:19pm UTC](https://discuss.gradle.org/t/hibernatetool-not-working/14231/2 "2016-02-10T14:19:49Z")

</div>

Hi Rohit,

I haven’t been able to find someone with expertise on using the hibernate plugin.  
Is it the one developed here: [https://plugins.gradle.org/plugin/org.hibernate.gradle.tools](https://plugins.gradle.org/plugin/org.hibernate.gradle.tools)  
Maybe you could contact the main contributor to that project on GitHub?

Thanks,  
Pepper

P.S. Requests for help like this one where you don’t have clear evidence of a bug belong on the [Help/Discuss](https://discuss.gradle.org/c/help-discuss) topic.

---

<div class="post-metadata">

**Author:** ![Mownathi](https://avatars.discourse-cdn.com/v4/letter/m/90ced4/32.png) [@Mownathi](https://discuss.gradle.org/u/Mownathi)\
**Post date:** [March 17, 2017, 8:55am UTC](https://discuss.gradle.org/t/hibernatetool-not-working/14231/3 "2017-03-17T08:55:36Z")

</div>

Adding the following dependencies should fix the mentioned issue related to slf4j.

**hibernatetool group: ‘org.slf4j’, name: ‘slf4j-simple’, version: '1.6.6’**  
**hibernatetool group: ‘org.slf4j’, name: ‘jcl-over-slf4j’, version: ‘1.6.6’**

It would also be required to add this log4j dependency in order to fix java.lang.NoClassDefFoundError: org/apache/log4j/Priority this error.

**hibernatetool group: ‘log4j’, name: ‘log4j’, version: ‘1.2.17’**
