I am having some issues with Java (OpenJDK Java 7 Runtime) on Ubuntu 12.04, and just want to make sure I have my CLASSPATH and JAVA_HOME variables set correctly.
CLASSPATH=".:/usr/local/sbin:/home/king/Documents/bin/java/jar/*:/home/king/Documents/bin/java/jar/log4j.xml:/opt/fop/build/fop.jar"
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-i386/bin"Is my JAVA_HOME varibale set right here? I am wondering if it should be set to
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-i386/jre"instead?
My main issue I am having is with log4j
log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry).
log4j:WARN Please initialize the log4j system properly.I have the file "log4j.xml" in a location on the classpath, so I am confused about the problem.
41 Answer
If I understand correctly the problem is not with java. The problem is in your log4j.xml file.
Inside the class org.apache.fop.util.ContentHandlerFactoryRegistry it would have a : logger.error("Error Message/Exception") or logger.debug . . .
something along these lines and it is trying to write it to your logger that you have set up.
Essentially, you want to have something like
<logger name="org.apache.fop"> <level value="info"/>
</logger>in your log file that will pick up logging messages from that class.
if you have multiple appenders then add
<appender-ref ref="appenderName" />underneath the level tag.
1