Hi,
I´m using the hbm2java task and this error has appeared:
BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
The strange is that the jar that contaiins this class is in the class path.
My ant project:
Code:
<project name="hbm2java" default="create" basedir=".">
<description>Cria codigo Java a partir de arquivos .hbm.xml</description>
<!-- set global properties for this build -->
<property name="out" value="${basedir}/out"/>
<property name="xxx.path" value="c:/xxx/xxx/src/"/>
<path id="class.path">
<fileset dir="C:/eclipse/plugins/org.hibernate.eclipse_3.0.0.alpha4/lib/">
<include name="*.jar" />
<include name="commons-collections-2.1.1.jar" />
</fileset>
<pathelement location="c:/xxx/xxx/src/"/>
<pathelement location="c:/xxx/out/"/>
</path>
<taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="class.path"/>
<target name="clean" description="clean up" >
<delete dir="${out}"/>
<mkdir dir="${out}"/>
</target>
<target name="create" depends="clean">
<hibernatetool destdir="${out}" classpath="C:/eclipse/plugins/org.hibernate.eclipse_3.0.0.alpha4/lib/commons-collections-2.1.1.jar;${xxx.path}">
<configuration configurationfile="c:/xxxx/mappings.cfg.xml" />
<hbm2java />
</hibernatetool>
</target>
</project>
Note that I have made redundant references to the collections jar in the try to make it works.
The ant trace (no debug):
Code:
C:\Bancos\hibernate_ant>ant -f exemplo.xml
Buildfile: exemplo.xml
clean:
[delete] Deleting directory C:\Bancos\hibernate_ant\out
[mkdir] Created dir: C:\Bancos\hibernate_ant\out
create:
[hibernatetool] Executing Hibernate Tool with a Standard Configuration
[hibernatetool] 1. task: hbm2java (Generates a set of .java files)
[hibernatetool] 15/06/2005 17:29:09 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: Hibernate 3.0.5
[hibernatetool] 15/06/2005 17:29:09 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: hibernate.properties not found
[hibernatetool] 15/06/2005 17:29:09 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: using CGLIB reflection optimizer
[hibernatetool] 15/06/2005 17:29:09 org.hibernate.cfg.Environment <clinit>
[hibernatetool] INFO: using JDK 1.4 java.sql.Timestamp handling
[hibernatetool] 15/06/2005 17:29:09 org.hibernate.cfg.Configuration configure
[hibernatetool] INFO: configuring from file: mapeamentos.cfg.xml
[hibernatetool] 15/06/2005 17:29:09 org.hibernate.cfg.Configuration addResource
[hibernatetool] INFO: Mapping resource: xxx/hibernate/map/GraphicElement.hbm.
xml
BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/commons/collections/SequencedHashMap
Total time: 3 seconds
Can see the problem ???