Make sure you have a log4j.properties file in you classpath. You should be able to find details on http://logging.apache.org/log4j

Andreas

Ray Tayek wrote:

Hi, newbie here. Trying to hack up the middlegen sample project so that it
just does middlegen for hibernate (not hvn2java) and only has the jars that
I need. It works fine, reverses and makes the hibername mapping files.
Except that its says:

middlegen:
       [echo] Class path = U:\projects\mg0\samples
  [middlegen] log4j:WARN No appenders could be found for logger
(middlegen.Middlegen).
  [middlegen] log4j:WARN Please initialize the log4j system properly.
        ....

I have moved the jars that I do not think I need into ./lib/tmp (please see
file listing and build file below). I have tried to move the commons logging
and log4j jars back into lib/ but no joy (moving both does not work either).

Does anyone know what combinations of which jars are needed to get rid of
the: "log4j:WARN No appenders could be found ..." message?

Any pointers will be appreciated.

thanks

lib:
        commons-collections-2.1.jar*
        commons-lang.jar*
        commons-logging.jar*
        entityfacade.xdt*
        hibernate2.jar*
        hibernate-tools.jar*
        jdom.jar*
        log4j.jar*
        mysql-connector-java-3.0.0-beta-bin.jar*
        velocity-1.4-dev.jar*
        tmp/
                commons-collections-2.0.jar*
                commons-logging-1.1-dev.jar*
                hsqldb-1.7.1.jar*
                hsqldb.jar*
                jdbc2_0-stdext.jar*
                jdo.jar*
                log4j-1.2.7.jar*
                mysql-connector-java-2.0.14-bin.jar*
                velocity-1.3.jar*
                xdoclet-1.2b3-dev.jar*
                xdoclet-apache-module-1.2b3-dev.jar*
                xdoclet-hibernate-module-1.2b3-dev.jar*
                xdoclet-java-module-1.2b3-dev.jar*
                xdoclet-jmx-module-1.2b3-dev.jar*
                xdoclet-mockobjects-module-1.2b3-dev.jar*
                xdoclet-mx4j-module-1.2b3-dev.jar*
                xdoclet-objectweb-module-1.2b3-dev.jar*
                xdoclet-sun-module-1.2b3-dev.jar*
                xdoclet-web-module-1.2b3-dev.jar*
                xdoclet-xdoclet-module-1.2b3-dev.jar*
                xerces.jar*
                xjavadoc-1.0-SNAPSHOT.jar*
                xml-apis.jar*

<?xml version="1.0"?>
<project name="mg0" default="all" basedir=".">
<!-- this does not seem to work. set CLASSPATH= on linux -->
<!-- on windows, don't know, but the logging is different -->
<property name="build.sysclasspath" value="ignore"/> <property file="${basedir}/build.properties"/>
<property name="unique.name" value="${name}"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="java.src.dir" value="${src.dir}/java"/>
<property name="build.dir"
value="${basedir}/build"/>
<property name="build.java.dir"
value="${build.dir}/java"/>
<property name="build.gen-src.dir"
value="${build.dir}/gen-src"/>
<property name="build.classes.dir"
value="${build.dir}/classes"/>
<property name="build.xmi.dir"
value="${build.dir}/xmi"/>
<path id="lib.class.path">
<pathelement path="${database.driver.classpath}"/>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="${basedir}/..">
<include name="*.jar"/>
</fileset>
</path>
<target name="init">
<echo message="build.sysclasspath=${build.sysclasspath}"/>
<available property="xdoclet1.2+"
classname="xdoclet.modules.ejb.EjbDocletTask"
classpathref="lib.class.path"/>
</target>
<target name="check-driver-present">
<available file="${database.driver.file}" type="file"
property="driver.present"/>
</target>
<target name="panic-if-driver-not-present" unless="driver.present">
<fail>no jdbc driver</fail>
</target>
<target name="middlegen" description="Run Middlegen" unless="middlegen.skip"
depends="init,check-driver-present,panic-if-driver-not-present">
<mkdir dir="${build.gen-src.dir}"/>
<echo message="Class path = ${basedir}"/>
<taskdef name="middlegen" classname="middlegen.MiddlegenTask"
classpathref="lib.class.path"/>
<middlegen
appname="${name}"
prefsdir="${src.dir}"
gui="${gui}"
databaseurl="${database.url}"
initialContextFactory="${java.naming.factory.initial}"
providerURL="${java.naming.provider.url}"
datasourceJNDIName="${datasource.jndi.name}"
driver="${database.driver}"
username="${database.userid}"
password="${database.password}"
schema="${database.schema}"
catalog="${database.catalog}"
>
<hibernate
destination="${build.gen-src.dir}"
package="${name}.hibernate"
genXDocletTags="true"
genIntergratedCompositeKeys="true"
javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper"
/>
</middlegen>
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="all" description="Build everything" depends="hbm2java"/>
<target name="clean" description="Clean all generated stuff">
<delete dir="${build.dir}"/>
</target>
<target name="hbm2java" depends="middlegen" description="Generate
.java from .hbm files.">
<taskdef name="hbm2java"
classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
classpathref="lib.class.path"/>
<hbm2java output="${build.gen-src.dir}">
<fileset dir="${build.gen-src.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>
</target>
</project>









------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ middlegen-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/middlegen-user

Reply via email to