java - Problem running task using log4j using Ant -
my java application uses log4j logging. using ant project builds successfully, unable run it. error
exception in thread "main" java.lang.noclassdeffounderror: org/apache/commons/logging/log ......... caused by: java.lang.classnotfoundexception: org.apache.commons.logging.log
my classpath contains log4j jar.
[echo] ..../apache-log4j-1.2.15/log4j-1.2.15.jar: .....
my ant version 1.7.1. missing?
[edit] application referencing project required commons logging jar. tried creating executable jar of referenced project dependencies carried over. ant task create executable jar follows:
<target name="executablejar" depends="compile"> <delete file="${dist}/app.jar" /> <javac debug="true" srcdir="${src}" destdir="${classes}" classpath="${javac.classpath}"/> <copy todir="classes" flatten="true"> <path> <pathelement path="${javac.classpath}"/> </path> </copy> <jar jarfile="${dist}/app.jar" basedir="${classes}" /> </target>
however error still persists. creating executable jar correctly?
you may have inadvertently imported class org.apache.commons.logging
, now, might expect, jvm expecting find class definition on classpath @ runtime.
i'd recommend looking usages of commons-logging package in code.
Comments
Post a Comment