hibernate 中使用hbm2java 的問題

newpaul發表於2003-08-10
再ant中
<target name="generate-code" depends="middlegen" description="generate java code with hbm2java tool ">
<java classname="net.sf.hibernate.tool.hbm2java.CodeGenerator" classpathref="lib.class.path" fork="true">
<arg value="--output=${build.java.dir}"/>
<arg value="${build.gen-src.dir}/Order.hbm.xml"/>
</java>
</target>

執行時報錯
generate-code:
[java] java.lang.NoSuchMethodError: org.jdom.input.SAXBuilder.setEntityReso
lver(Lorg/xml/sax/EntityResolver;)V
[java] at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerat
or.java:38)
[java] Exception in thread "main"
[java] Java Result: 1

Order.hbm.xml為
?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping>

<!--
Created by Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->

<class
name="order.hibernate.Order"
table="orders"
。。。。。。。。。。。。。。

怎麼會出現這樣的錯誤 ,該怎麼解決阿?

相關文章