You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Rosemary Philip <ph...@accuwx.com> on 2004/04/07 17:58:35 UTC
Newbie- help with log4j
Hi,
I am having some trouble with log4j classpaths so I cant get a program from
the VSS to work. This is not a web-app , just a bunch of java files. The
VSS only had the code a previous programmer wrote, not the external packages
he used in his programs.
( Normally the practise I have seen is to keep the complete .jars together
in a package structure with separate packages for external .jars . But here
external jars were not present.)
I downloaded and copied the log4j-1.2.8.jar to C:\Program
Files\Java\j2re1.4.2_04\lib\ext. Yesterday the program using log4j.Logger
was working fine and compiled correctly. Today it gives me these errors!!!!
----------------------------------------------------------------------------
------------------------------
C:\VSS\USMerge>javac com\accuwx\bussys\usmerge\Main.java
com\accuwx\bussys\usmerge\Main.java:9: package org.apache.log4j does not
exist
import org.apache.log4j.Logger;
^
com\accuwx\bussys\usmerge\Main.java:10: package org.apache.log4j.xml does
not exist
import org.apache.log4j.xml.DOMConfigurator;
^
com\accuwx\bussys\usmerge\Main.java:23: cannot resolve symbol
symbol : class Logger
location: class com.accuwx.bussys.usmerge.Main
static Logger log = Logger.getLogger(Main.class);
^
com\accuwx\bussys\usmerge\Main.java:23: cannot resolve symbol
symbol : variable Logger
location: class com.accuwx.bussys.usmerge.Main
static Logger log = Logger.getLogger(Main.class);
^
com\accuwx\bussys\usmerge\Main.java:66: cannot resolve symbol
symbol : variable DOMConfigurator
location: class com.accuwx.bussys.usmerge.Main
DOMConfigurator.configure(logConfigFile);
----------------------------------------------------------------------------
------------------------------
The import statement in the unhappy program says "import
org.apache.log4j.Logger;" .
I read the INSTALL.TXT in the log4j bundle I downloaded and it says
to -------->
==========
Using log4j from INSTALL.TXT
===========
1) First untar or unzip the distribution file.
2) Assuming you chose to extract the distribution in to the
PATH_OF_YOUR_CHOICE, untarring the distribution file should create
a jakarta-log4j-VERSION directory, where VERSION is the log4j
version number, under PATH_OF_YOUR_CHOICE. We will refer to the
directory PATH_OF_YOUR_CHOICE/jakarta-log4j-VERSION/ as $LOG4J_HOME/.
3) Assuming you are using log4j version 1.2, add
$LOG4J_HOME/dist/lib/log4j-1.2.jar to your CLASSPATH,
--------------------------------------------
So I tried appending that to my classpath. Still no luck.
There was some log4j dependencies which INSTALL.TXT mentioned , one among
them being DOMConfigurator needing the presence of JAXP parser in the
classpath. Is that the problem? But, I dont know how something that worked
last night stopped working today morning, without nothing being changed.
Please let me know if I have left anything out. I think something is pretty
bad with my classpath, but I cant figure out what even after hours on this.
Thanks,
Rosemary Philip
Programmer
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org