As often the solution comes right after the help-in-a-bottle was thrown
out to sea: it turns out I copied a little too much of the parameters
from the command line script to the Eclipse run box, specifically the
main class name was copied. Logically this could result in a duplicate
(but identical) main class name, so I have no idea why Eclipse has
loading problems, but the main things is that I found the culprit.

 

Tom

 

 

-----Original Message-----
From: Tom 
Sent: Monday, August 21, 2006 12:13
To: '[email protected]'
Subject: log4j 1.2.13

 

I've upgraded a supporting library to 1.2.13 and as a result the main
program needed also upgrading to 1.2.13.

 

A class in the supporting library runs perfectly using 1.2.13, however
if that class is loaded from the main of the main program I get an
exception. 

 

java.lang.NoSuchFieldError: level

      at org.apache.log4j.spi.RootLogger.setLevel(RootLogger.java:65)

      at org.apache.log4j.spi.RootLogger.<init>(RootLogger.java:44)

      at org.apache.log4j.LogManager.<clinit>(LogManager.java:78)

      at org.apache.log4j.Logger.getLogger(Logger.java:104)

      at
org.tbee.swing.ThreadCheckingRepaintManager.<clinit>(ThreadCheckingRepai
ntManager.java:35)

      at nl.reinders.Reinders.main(Reinders.java:266)

 

 

This is the very very first line being excuted, calling a component in
the library that checks if all Swing code is run by the EDT.

 

      public static void main(String[] argv)

      {

            try

            {

                  // check the EDT              

                  ThreadCheckingRepaintManager.install(true); 

 

 

Now for the fun part: this only happens in Eclipse (3.1.2 and 3.2). So:

- Eclipse compiles correctly.

- It cannot start the application's main.

- It can start the Components test-main (using log4j 1.2.13).

- When run from the command line, the application works ok.

- I do not have this problem with an older version of log4j (1.1.3)

 

It appears that at runtime Eclipse takes the wrong log4j, but all my
tests and knowledge of Eclipse says it is using the correct version. I
made complete clean installs of Eclipse, but I can get it to work.
Anyone ever seen something like this? Any suggestions on how to proceed?

 

Tom

 

 

Reply via email to