Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
2.1.8
Mapping documents:
None
Code between sessionFactory.openSession() and session.close():
None
Full stack trace of any exception that occurs:
[middlegen] BUILD FAILED: file:C:/JAVAProjects/LASer/LASer/LASerWorkspace/DataAccess/build.xml:75: Could not create task of type: middlegen due to java.lang.NoClassDefFoundError: org.apache.log4j.Category
Name and version of the database you are using:
DB2 8.2
The generated SQL (show_sql=true):
None
Debug level Hibernate log excerpt:
None
I am using middlegen to try and generate my hbm files since I must integrate
with a legacy database. Below is the output of my build
Code:
Buildfile: C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\build.xml
init:
[echo] classpath=C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\aopalliance.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\c3p0-0.8.4.5.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\cglib-full-2.0.2.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\commons-collections-2.1.1.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\commons-dbcp-1.2.1.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\commons-lang-1.0.1.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\commons-logging-1.0.4.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\commons-pool-1.2.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\concurrent-1.3.3.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\connector.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\dom4j-1.4.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\ehcache-0.9.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\hibernate2.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\jdbc2_0-stdext.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\jgroups-2.2.7.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\jta.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\log4j-1.2.8.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\log4j.properties;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\odmg-3.0.jar;C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess\lib\spring.jar
middlegen:
[echo] Class path = C:\JAVAProjects\LASer\LASer\LASerWorkspace\DataAccess
[middlegen] BUILD FAILED: file:C:/JAVAProjects/LASer/LASer/LASerWorkspace/DataAccess/build.xml:75: Could not create task of type: middlegen due to java.lang.NoClassDefFoundError: org.apache.log4j.Category
Total time: 218 milliseconds
Here is my build file
Code:
<?xml version="1.0"?>
<project name="Laser Data Acess" default="middlegen" basedir=".">
<property name="lib.dir" value="lib" />
<property name="dist.dir" value="dist" />
<property name="src.dir" value="src" />
<property name="etc.dir" value="etc"/>
<property name="name" value="com.llic.dataaccess"/>
<property name="gui" value="true"/>
<property name="database.url" value="jdbc:db2://ludb.llic.com:50000/LASER"/>
<property name="database.driver" value="com.ibm.db2.jcc.DB2Driver"/>
<property name="database.userid" value="lasertst"/>
<property name="database.password" value="lasertst"/>
<property name="database.schema" value="LASER"/>
<target name="init">
<!-- creates the destination directories -->
<mkdir dir="${compile.dir}" />
<mkdir dir="${dist.dir}" />
<!-- sets the classpath required to compile the classes -->
<path id="classpathref">
<fileset dir="${lib.dir}">
<include name="*.jar" />
<include name="*.properties"/>
</fileset>
</path>
<pathconvert property="classpathrefprint" refid="classpathref" pathsep=";" />
<echo message="classpath=${classpathrefprint}"/>
</target>
<!-- ============================================================== -->
<!-- Run Middlegen -->
<!-- ============================================================== -->
<target
name="middlegen"
description="Run Middlegen"
unless="middlegen.skip"
depends="init"
>
<mkdir dir="${build.gen-src.dir}"/>
<echo message="Class path = ${basedir}"/>
<taskdef
name="middlegen"
classname="middlegen.MiddlegenTask"
classpathref="classpathref"
/>
<middlegen
appname="${name}"
prefsdir="${src.dir}"
gui="${gui}"
databaseurl="${database.url}"
driver="${database.driver}"
username="${database.userid}"
password="${database.password}"
schema="${database.schema}"
catalog="${database.catalog}"
>
<!-- Plugins -->
<hibernate
destination="${build.gen-src.dir}"
package="${name}.hibernate"
javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper"
/>
</middlegen>
<mkdir dir="${build.classes.dir}"/>
</target>
</project>
As you can see from the output, log4j is in my classpath. Has anyone else encountered this?