You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Jeroen C. van Gelderen" <je...@vangelderen.org> on 2001/08/22 21:56:11 UTC

Re: problem integrating logger with 1.2-dev (Tip)

Hi Will,

Will Glass-Husain wrote:
> I'm doing a simple Proxy of the Velocity Logger, similar to a recent email
> message.  (See short code block at end of message).  When I try to compile
> this, however, my java compiler gives me an error:
> 
> Declare the class abstract, or implement abstract member 'void
> LogSystem.init(RunTimeServices)'.
> 
> A quick look at the code for LogSystem does not reveal an init routine, or a
> RunTimeServices class or interface.
> 
> I'm using Velocity 1.2-dev, and Microsoft J++ compiler (with JDK 1.3.1).
> 
> Any suggestions?  Could this be an issue with the 1.2-dev version?

Here is a tip for you! if you encounter such a question you can use the
javap tool to check the class' signature. Ideal for when you run into
strange compiler errors or for when the documentation for a particular
JAR is outdated.

For instance, running javap on my custom Velocity 1.2-dev JAR yields:

cudomix$ javap org.apache.velocity.runtime.log.LogSystem
Compiled from LogSystem.java
public interface org.apache.velocity.runtime.log.LogSystem
     /* ACC_SUPER bit NOT set */
{
     public static final boolean DEBUG_ON;
     public static final int DEBUG_ID;
     public static final int INFO_ID;
     public static final int WARN_ID;
     public static final int ERROR_ID;
     public abstract void init(org.apache.velocity.runtime.RuntimeServices);
     public abstract void logVelocityMessage(int, java.lang.String);
     public abstract void logVelocityMessage(int, java.lang.Throwable);
}
cudomix$

In the case of open-source projects you are often even luckier as they
generally make CVSweb available. For Velocity it is at:
  http://cvs.apache.org/viewcvs/jakarta-velocity/
Check out LogSystem.java at:
  http://cvs.apache.org/viewcvs/jakarta-velocity/src/java/org/apache/velocity/runtime/log/LogSystem.java
the abstract init method was added in revision 1.6.

Cheers!
-Jeroen


RE: problem integrating logger with 1.2-dev (Tip)

Posted by Will Glass-Husain <wg...@forio.com>.
Thanks for the tip!

I did look at the source code, actually, but foolishly at the wrong version.
(1.1).

Although I should note... I've studied the source code a few times to figure
things out.  As a general compliment to the Velocity developers, it's really
quite readable with good self-documentation.  However, it's good to learn
about javap -- that might be simpler to work with.

WILL

-----Original Message-----
From: Jeroen C. van Gelderen [mailto:jeroen@vangelderen.org]
Sent: Wednesday, August 22, 2001 12:56 PM
To: velocity-user@jakarta.apache.org
Subject: Re: problem integrating logger with 1.2-dev (Tip)


Hi Will,

Will Glass-Husain wrote:
> I'm doing a simple Proxy of the Velocity Logger, similar to a recent email
> message.  (See short code block at end of message).  When I try to compile
> this, however, my java compiler gives me an error:
>
> Declare the class abstract, or implement abstract member 'void
> LogSystem.init(RunTimeServices)'.
>
> A quick look at the code for LogSystem does not reveal an init routine, or
a
> RunTimeServices class or interface.
>
> I'm using Velocity 1.2-dev, and Microsoft J++ compiler (with JDK 1.3.1).
>
> Any suggestions?  Could this be an issue with the 1.2-dev version?

Here is a tip for you! if you encounter such a question you can use the
javap tool to check the class' signature. Ideal for when you run into
strange compiler errors or for when the documentation for a particular
JAR is outdated.

For instance, running javap on my custom Velocity 1.2-dev JAR yields:

cudomix$ javap org.apache.velocity.runtime.log.LogSystem
Compiled from LogSystem.java
public interface org.apache.velocity.runtime.log.LogSystem
     /* ACC_SUPER bit NOT set */
{
     public static final boolean DEBUG_ON;
     public static final int DEBUG_ID;
     public static final int INFO_ID;
     public static final int WARN_ID;
     public static final int ERROR_ID;
     public abstract void init(org.apache.velocity.runtime.RuntimeServices);
     public abstract void logVelocityMessage(int, java.lang.String);
     public abstract void logVelocityMessage(int, java.lang.Throwable);
}
cudomix$

In the case of open-source projects you are often even luckier as they
generally make CVSweb available. For Velocity it is at:
  http://cvs.apache.org/viewcvs/jakarta-velocity/
Check out LogSystem.java at:

http://cvs.apache.org/viewcvs/jakarta-velocity/src/java/org/apache/velocity/
runtime/log/LogSystem.java
the abstract init method was added in revision 1.6.

Cheers!
-Jeroen