Hibernate version: 2.1
I have this project file tree:
Code:
/
/bin
HTest.class
...
/src
HTest.java
...
/lib
hibernate2.jar
log4j.jar
...
build.xml
hibernate.properties
log4j.properties
...
On run I get:
Code:
log4j:WARN No appenders could be found for logger (net.sf.hibernate.util.DTDEntityResolver).
log4j:WARN Please initialize the log4j system properly.
If I move log4j.properties to bin directory all works fine. How can I run project with log4j.properties in / ?
hibernate.properties:
Code:
hibernate.dialect net.sf.hibernate.dialect.FirebirdDialect
hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
hibernate.connection.url jdbc:firebirdsql:192.168.46.1:test
hibernate.connection.username sysdba
hibernate.connection.password ats45system
hibernate.hbm2ddl.auto create
hibernate.show_sql true
build.xml:
Code:
<?xml version="1.0"?>
<project name="HTest" basedir="." default="run">
<property name="build.src" value="src"/>
<property name="build.destdir" value="bin"/>
<path id="project.class.path">
<pathelement path="bin"/>
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<fileset id="hibernate.mapping.files" dir="${build.src}">
<include name="**/*.hbm.xml" />
</fileset>
<target name="gen-classes" description="Creates the code based on the Hibernate mapping docs.">
<pathconvert refid="hibernate.mapping.files" property="hibernate.mappings" pathsep=" "/>
<java classname="net.sf.hibernate.tool.hbm2java.CodeGenerator" fork="true">
<classpath refid="project.class.path" />
<arg line="--output=${build.src}"/>
<arg line="${hibernate.mappings}"/>
</java>
</target>
<target name="compile" depends="gen-classes" description="Compiles source.">
<mkdir dir="${build.destdir}"/>
<javac srcdir="${build.src}" destdir="${build.destdir}" debug="true" classpathref="project.class.path"/>
<copy todir="${build.destdir}" >
<fileset dir="${build.src}" >
<include name="**/*.hbm.xml"/>
<include name="**/*.sql"/>
</fileset>
</copy>
</target>
<target name="run" depends="compile">
<java classname="HTest" fork="true">
<classpath refid="project.class.path" />
</java>
</target>
</project>