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 Aaron Kamienski <aa...@vidiom.com> on 2003/06/18 00:41:11 UTC

Layout.activateOptions() missing?

Hello,

I'm running into a problem with the org.apache.log4j.Layout
abstract class and (I believe) with the way in which the distributed
classes are compiled.  The problem is that I have found that some
VM's expect the Layout class to have an entry for the abstract activateOptions()
method.  Otherwise an IncompatibleClassChangeError is thrown --
presumably because it looks as if the OptionHandler interface (which
specifies activateOptions()) was changed to add the method AFTER
Layout was built.

Rebuilding Log4J eliminates this problem for me.  Apparently the
compiler that I am using (JDK 1.3.1_06 for Win32) will implicitly
add this method to the abstract Layout class as abstract.  To demonstrate,
here is what javap shows for the Layout class in the distribution
jar:

 >javap -classpath log4j-1.2.8.jar org.apache.log4j.Layout
Compiled from Layout.java
public abstract class org.apache.log4j.Layout extends java.lang.Object implements org.apache.log4j.spi.OptionHandler {
     public static final java.lang.String LINE_SEP;
     public static final int LINE_SEP_LEN;
     public org.apache.log4j.Layout();
     public abstract java.lang.String format(org.apache.log4j.spi.LoggingEvent);
     public java.lang.String getContentType();
     public java.lang.String getHeader();
     public java.lang.String getFooter();
     public abstract boolean ignoresThrowable();
     static {};
}

Note the lack of activateOptions().
However, if I rebuild the distribution it shows:

 >javap -classpath c:\JAVA\jakarta-log4j-1.2.8\dist\lib\log4j-1.2.8.jar org.apache.log4j.Layout
Compiled from Layout.java
public abstract class org.apache.log4j.Layout extends java.lang.Object implements org.apache.log4j.spi.OptionHandler {
     public static final java.lang.String LINE_SEP;
     public static final int LINE_SEP_LEN;
     public org.apache.log4j.Layout();
     public abstract java.lang.String format(org.apache.log4j.spi.LoggingEvent);
     public java.lang.String getContentType();
     public java.lang.String getHeader();
     public java.lang.String getFooter();
     public abstract boolean ignoresThrowable();
     public abstract void activateOptions();
     static {};
}

Note the abstract activateOptions().

Also, I noticed that the class files have a class file version of 46.0
(consistent w/ a Java2 compiler).  This is inconsistent with the ability
to use Log4J on a 1.1.8 or similar system.  However the log4j site FAQ
says that "Log4j is JDK 1.1.x compatible."

thanks,

ajk

-- 
Aaron Kamienski


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org