Page 1 of 1

(new) log4j warning with XSLT transformation via ANT

Posted: Mon Dec 18, 2017 3:04 pm
by Ron Van den Branden
Hi,

When performing an XSLT transformation via an ANT task with Oxygen-19.1, I notice how I'm getting a warning I don't recall seeing before:

Code: Select all

     [java] log4j:WARN No appenders could be found for logger (ro.sync.util.security.f).
     [java] log4j:WARN Please initialize the log4j system properly.

Note: the transformation does succeed without problems, but this warning seems to be new.

This happens with following (simplified) ANT target:

Code: Select all

  <target name="transform-xslt">
    <java classname="net.sf.saxon.Transform">
      <arg value="-s:${cfd}/test-in.xml"/>
      <arg value="-xsl:${cfd}/xslt/doc.xsl"/>
      <arg value="-o:${cfd}/out/test-out.xml"/>
    </java>
  </target>

The ANT transformation is executed with following jars on the classpath:

Code: Select all

${oxygenHome}/lib/oxygen.jar
${oxygenHome}/lib/resolver.jar
${oxygenHome}/lib/xercesImpl.jar
${oxygenHome}/lib/saxon9ee.jar
${oxygenHome}/lib/log4j.jar
${oxygenHome}/lib/fop.jar
${oxygenHome}/lib/batik-all-*.jar
${oxygenHome}/lib/commons-logging-*.jar
${oxygenHome}/lib/xmlgraphics-commons-*.jar
${oxygenHome}/lib/commons-io-*.jar
${oxygenHome}/lib/avalon-framework-*.jar

Is there anything wrong here that should be corrected, in order to make the logging warning disappears?

Best,

Ron

Re: (new) log4j warning with XSLT transformation via ANT

Posted: Mon Dec 18, 2017 4:10 pm
by Radu
Hi Ron,

The warning you receive right now is benign and can be ignored.
But you can add to that classpath list also this entry ${oxygenHome}/ because in the Oxygen installation folder there is a log4j.properties file which is used to initialize the log4j logging facility.

Regards,
Radu

Re: (new) log4j warning with XSLT transformation via ANT

Posted: Mon Dec 18, 2017 4:27 pm
by Ron Van den Branden
Hi Radu,

Thanks, that makes sense. I don't see a ${oxygenHome}/log4j.properties file, though, but it does work with the one I find at ${oxygenHome}/frameworks/dita/DITA-OT/. Adding this path to the classpath indeed solves the issue at hand.

I have control over the framework I'm developing this ANT scenario for, so I'll add a log4j.properties there.

Thanks,

Ron

Re: (new) log4j warning with XSLT transformation via ANT

Posted: Tue Dec 19, 2017 10:55 am
by Radu
Hi Ron,

You did the right thing.
Oxygen 20 (Spring 2018) will no longer issue this warning even if you do not have in the libraries path a reference to a folder containing a "log4j.properties".

Regards,
Radu