These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: hbm2ddl - schema update using ant task - exception
PostPosted: Mon Apr 02, 2007 4:22 am 
Newbie

Joined: Fri Mar 16, 2007 6:04 am
Posts: 14
IDE: Netbeans 5.0
Hibernate-Version: 3.2.2.ga

Hi,

I am using hbm2ddl for schema updates and I am trying to define this as an ant task. I use the IDE's embedded ant, so I mess with the build.xml.

This is the build.xml file:

<?xml version="1.0" encoding="UTF-8"?>

<project name="foo" default="default" basedir=".">
<import file="nbproject/build-impl.xml"/>
<property name="lib.home" location="${basedir}/build/web/WEB-INF/lib" />
<property name="src.home" location="${basedir}/build/web/WEB-INF/classes" />

<path id="lib">
<fileset dir="${lib.home}\" includes="**/*.jar" />
<fileset dir="${src.home}\"/>
</path>

<target name="-post-compile">
<taskdef name="schemaupdate"
classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask"
classpathref="lib" />

<schemaupdate
config="${src.home}/hibernate.cfg.xml"
quiet="no"
text="yes">
</schemaupdate>
</target>

</project>

My hibernate mapping is like this:

<mapping resource="gr/foo/bar/model/User.hbm.xml" />
<mapping resource="gr/foo/bar/model/Node.hbm.xml" />
<mapping resource="gr/foo/bar/model/Person.hbm.xml" />
<mapping resource="gr/foo/bar/model/City.hbm.xml" />
<mapping resource="gr/foo/bar/model/Band.hbm.xml" />

When I try to build the project, I get the following exception:

java.util.zip.ZipException: error in opening zip file

at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:112)
at java.util.zip.ZipFile.<init>(ZipFile.java:128)
at org.apache.tools.ant.AntClassLoader.getResourceURL(AntClassLoader.java:919)
at org.apache.tools.ant.AntClassLoader.getResource(AntClassLoader.java:832)
at org.apache.log4j.helpers.Loader.getResource(Loader.java:109)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:105)
at org.apache.log4j.Logger.getLogger(Logger.java:104)
at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
at org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:65)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:120)
at org.hibernate.tool.hbm2ddl.SchemaUpdateTask.getConfiguration(SchemaUpdateTask.java:142)
at org.hibernate.tool.hbm2ddl.SchemaUpdateTask.execute(SchemaUpdateTask.java:102)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:234)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:287)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:125)


and build fails along with this message:

Schema text failed: resource: gr/foo/bar/model/User.hbm.xml not found


What am I doing wrong here and how can I fix the problem?

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.