Deprecated: Assigning the return value of new by reference is deprecated in /home/therning/public_html/niklas/wp-settings.php on line 472

Deprecated: Assigning the return value of new by reference is deprecated in /home/therning/public_html/niklas/wp-settings.php on line 487

Deprecated: Assigning the return value of new by reference is deprecated in /home/therning/public_html/niklas/wp-settings.php on line 494

Deprecated: Assigning the return value of new by reference is deprecated in /home/therning/public_html/niklas/wp-settings.php on line 530

Deprecated: Assigning the return value of new by reference is deprecated in /home/therning/public_html/niklas/wp-includes/cache.php on line 103

Deprecated: Assigning the return value of new by reference is deprecated in /home/therning/public_html/niklas/wp-includes/query.php on line 21

Deprecated: Assigning the return value of new by reference is deprecated in /home/therning/public_html/niklas/wp-includes/theme.php on line 623
Niklas blog » Blog Archive » Ant + Log4j

Niklas blog

Just another WordPress weblog

Ant + Log4j

March 15th, 2007 in Uncategorized

Hibernate’s SchemaExportTask ant task always gives very informative error messages (not! Smiling). Here’s an example:

BUILD FAILED
build.xml:267: Schema text failed: Could not parse mapping document from file SomeClass.hbm.xml

To get some useful info on what went wrong we need to specify a log4j configuration file:

niklas@niklas:~$ ANT_OPTS=-Dlog4j.configuration=file:///path/to/log4j.properties ant some-task

Don’t forget file://!

Here’s a simple log4j.properties file you could use:

log4j.rootLogger=DEBUG, consoleAppender
log4j.appender.consoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.consoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.consoleAppender.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n

One Response to “Ant + Log4j”

  • Thomas
    March 6th, 2009 at 13:04

    THX a lot, very useful and helped me to fix my problem.