views:

692

answers:

0

I want to generate my database schema with Ant. I am using hbm2ddl task.

I am using Hibernate with JNDI. My hibernate.cfg.xml looks like:

<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;

<hibernate-configuration>
    <session-factory>
        <!-- Database connection settings -->
        <property name="connection.datasource">java:comp/env/jdbc/my_app</property>
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="current_session_context_class">thread</property>

            <!-- Mapping -->   
  </session-factory>  
</hibernate-configuration>

My $CATALINA_HOME/webapps/myapp/META-INF/context.xml looks like:

<Context>
    <Resource name="jdbc/my_app" 
            global="jdbc/my_app"
            auth="Container"
            type="javax.sql.DataSource" 
            username="userA"
            password="userA123"
            driverClassName="com.mysql.jdbc.Driver"
      url="jdbc:mysql://localhost:3306/myapp?autoReconnect=true"
            maxActive="8" 
            maxIdle="4"/>
</Context>

And inside $CATALINA_HOME/webapps/myapp/WEB-INF/web.xml I have:

     <resource-ref>
 <description>DB Connection</description>
 <res-ref-name>jdbc/my_app</res-ref-name>
 <res-type>javax.sql.DataSource</res-type>
 <res-auth>Container</res-auth>
</resource-ref>

Inside build.xml I have the next target.

<target name="schema" description="Generate DB schema from the O/R mapping files">
 <hibernatetool destdir="${basedir}">
     <classpath path="${java.src.home}">
       <fileset dir="${java.src.home}">
               <include name="**/*.hbm.xml"/>
       </fileset>
     </classpath>
 <configuration configurationfile="${java.src.home}/hibernate.cfg.xml"/>      
     <hbm2ddl 
      drop="true" 
      create="true"
      export="true"
      outputfilename="myapp-ddl.sql"
        delimiter=";"
      format="true"/>       
    </hibernatetool>
</target>

The problem is that ant is not finding the Resource element stored in context.xml.

[hibernatetool] Error #1: org.hibernate.HibernateException: Could not find datasource

I tried, without success, to add the nex snippet inside the classpath element.

 <fileset dir="${web.home}/META-INF">
       <include name="context.xml"/>
   </fileset>

How can i point Ant to find the Resource defined in context.xml?

I post a complete error stacktrace.

[hibernatetool] INFO: JNDI InitialContext properties:{}
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool]     at java.util.zip.ZipFile.open(Native Method)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1014)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:146)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:108)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:958)
[hibernatetool]     at java.lang.ClassLoader.getResources(ClassLoader.java:1016)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12$5.run(VersionHelper12.java:149)
[hibernatetool]     at java.security.AccessController.doPrivileged(Native Method)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12.getResources(VersionHelper12.java:146)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:468)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
[hibernatetool]     at javax.naming.InitialContext.init(InitialContext.java:219)
[hibernatetool]     at javax.naming.InitialContext.<init>(InitialContext.java:175)
[hibernatetool]     at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
[hibernatetool]     at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:27)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
[hibernatetool]     at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:55)
[hibernatetool]     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
[hibernatetool]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
[hibernatetool]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool]     at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool]     at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool]     at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool]     at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool]     at java.util.zip.ZipFile.open(Native Method)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1014)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:146)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:108)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:958)
[hibernatetool]     at java.lang.ClassLoader.getResources(ClassLoader.java:1016)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12$5.run(VersionHelper12.java:149)
[hibernatetool]     at java.security.AccessController.doPrivileged(Native Method)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12.getResources(VersionHelper12.java:146)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:468)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
[hibernatetool]     at javax.naming.InitialContext.init(InitialContext.java:219)
[hibernatetool]     at javax.naming.InitialContext.<init>(InitialContext.java:175)
[hibernatetool]     at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
[hibernatetool]     at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:27)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
[hibernatetool]     at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:55)
[hibernatetool]     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
[hibernatetool]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
[hibernatetool]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool]     at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool]     at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool]     at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool]     at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool]     at java.util.zip.ZipFile.open(Native Method)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1014)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:146)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:108)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:958)
[hibernatetool]     at java.lang.ClassLoader.getResources(ClassLoader.java:1016)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12$5.run(VersionHelper12.java:149)
[hibernatetool]     at java.security.AccessController.doPrivileged(Native Method)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12.getResources(VersionHelper12.java:146)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:468)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
[hibernatetool]     at javax.naming.InitialContext.init(InitialContext.java:219)
[hibernatetool]     at javax.naming.InitialContext.<init>(InitialContext.java:175)
[hibernatetool]     at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
[hibernatetool]     at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:27)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
[hibernatetool]     at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:55)
[hibernatetool]     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
[hibernatetool]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
[hibernatetool]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool]     at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool]     at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool]     at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool]     at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool]     at java.util.zip.ZipFile.open(Native Method)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1014)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:146)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:108)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:958)
[hibernatetool]     at java.lang.ClassLoader.getResources(ClassLoader.java:1016)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12$5.run(VersionHelper12.java:149)
[hibernatetool]     at java.security.AccessController.doPrivileged(Native Method)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12.getResources(VersionHelper12.java:146)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:468)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
[hibernatetool]     at javax.naming.InitialContext.init(InitialContext.java:219)
[hibernatetool]     at javax.naming.InitialContext.<init>(InitialContext.java:175)
[hibernatetool]     at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
[hibernatetool]     at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:27)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
[hibernatetool]     at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:55)
[hibernatetool]     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
[hibernatetool]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
[hibernatetool]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool]     at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool]     at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool]     at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool]     at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool]     at java.util.zip.ZipFile.open(Native Method)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1014)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:146)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:108)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:958)
[hibernatetool]     at java.lang.ClassLoader.getResources(ClassLoader.java:1016)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12$5.run(VersionHelper12.java:149)
[hibernatetool]     at java.security.AccessController.doPrivileged(Native Method)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12.getResources(VersionHelper12.java:146)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:468)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
[hibernatetool]     at javax.naming.InitialContext.init(InitialContext.java:219)
[hibernatetool]     at javax.naming.InitialContext.<init>(InitialContext.java:175)
[hibernatetool]     at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
[hibernatetool]     at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:27)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
[hibernatetool]     at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:55)
[hibernatetool]     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
[hibernatetool]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
[hibernatetool]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool]     at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool]     at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool]     at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool]     at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool]     at java.util.zip.ZipFile.open(Native Method)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1014)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:146)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:108)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:958)
[hibernatetool]     at java.lang.ClassLoader.getResources(ClassLoader.java:1016)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12$5.run(VersionHelper12.java:149)
[hibernatetool]     at java.security.AccessController.doPrivileged(Native Method)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12.getResources(VersionHelper12.java:146)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:468)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
[hibernatetool]     at javax.naming.InitialContext.init(InitialContext.java:219)
[hibernatetool]     at javax.naming.InitialContext.<init>(InitialContext.java:175)
[hibernatetool]     at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
[hibernatetool]     at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:27)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
[hibernatetool]     at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:55)
[hibernatetool]     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
[hibernatetool]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
[hibernatetool]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool]     at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool]     at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool]     at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[hibernatetool]     at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
[hibernatetool]     at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
[hibernatetool] java.util.zip.ZipException: error in opening zip file
[hibernatetool]     at java.util.zip.ZipFile.open(Native Method)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:114)
[hibernatetool]     at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:1014)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.findNextResource(AntClassLoader.java:146)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader$ResourceEnumeration.<init>(AntClassLoader.java:108)
[hibernatetool]     at org.apache.tools.ant.AntClassLoader.findResources(AntClassLoader.java:958)
[hibernatetool]     at java.lang.ClassLoader.getResources(ClassLoader.java:1016)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12$5.run(VersionHelper12.java:149)
[hibernatetool]     at java.security.AccessController.doPrivileged(Native Method)
[hibernatetool]     at com.sun.naming.internal.VersionHelper12.getResources(VersionHelper12.java:146)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getApplicationResources(ResourceManager.java:468)
[hibernatetool]     at com.sun.naming.internal.ResourceManager.getInitialEnvironment(ResourceManager.java:159)
[hibernatetool]     at javax.naming.InitialContext.init(InitialContext.java:219)
[hibernatetool]     at javax.naming.InitialContext.<init>(InitialContext.java:175)
[hibernatetool]     at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:28)
[hibernatetool]     at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
[hibernatetool]     at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:27)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:180)
[hibernatetool]     at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:133)
[hibernatetool]     at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:55)
[hibernatetool]     at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
[hibernatetool]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[hibernatetool]     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
[hibernatetool]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[hibernatetool]     at java.lang.reflect.Method.invoke(Method.java:597)
[hibernatetool]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[hibernatetool]     at org.apache.tools.ant.Task.perform(Task.java:348)
[hibernatetool]     at org.apache.tools.ant.Target.execute(Target.java:357)
[hibernatetool]     at org.apache.tools.ant.Target.performTasks(Target.java:385)
[hibernatetool]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[hibernatetool]     at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[hibernatetool]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultE