Issue
We have a JAR that is run from the command prompt in Windows with the following parameter for log4J:
-Dlog4.properties.file=C:/[folderName]/apps/[appName]/config/log4j.properties
Even though the log4j.properties file is indeed in the path above, log4j fails to find it and thus fails to configure properly, and running the command with the parameter -Dlog4j.debug doesn't give me much more information:
log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$Ap
pClassLoader@92e78c.
log4j: Trying to find [log4j.xml] using sun.misc.Launcher$AppClassLoader@92e78c
class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader sun.misc.Laun
cher$AppClassLoader@92e78c.
log4j: Trying to find [log4j.properties] using sun.misc.Launcher$AppClassLoader@
92e78c class loader.
log4j: Trying to find [log4j.properties] using ClassLoader.getSystemResource().
log4j: Could not find resource: [null].
log4j:WARN No appenders could be found for logger (com.xxx.yyy.appName.Main).
log4j:WARN Please initialize the log4j system properly.
I feel like I'm missing somrthing fundamental, so I'm open to ideas...
Solution
It looks as though my problem was due to a Java version mismatch. The application in question currently only runs on 1.5, and I built the JAR accordingly. But one of its dependencies (i.e., another JAR) was built with 1.6. Rebuilt this other JAR with 1.5 and the problem went away...
Answered By - Sheldon R.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.