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 David Thielen <da...@windward.net> on 2003/04/23 20:33:56 UTC

log4j version number

Hi;

Is there any log4j static method or field that will give the version number? I have users that are using older versions that is causing trouble so I want to print the version number so I know what is going on.

thanks - dave

Re: Problem with Commons and Log4j

Posted by Jacob Kjome <ho...@visi.com>.
This is an issue with commons-logging, not Log4j.  The best way around this 
issue is to dump commons-logging like a bad habit ASAP.  Oh, and 
read  http://www.qos.ch/logging/thinkAgain.html .

Jake

At 08:46 AM 4/24/2003 -0700, you wrote:
>All,
>I am using ANT with weblogic 7.0 and Commons with log4j.When I run the
>ejbc task I get the following error.
>
>Any suggestions on why this is happening?
>
>Thanks in Advance,
>Chandrav
>
>: ServiceProviderInterfaceEntityBean has a class
>com.wisor.validator.serviceprov
>idermanagement.entitybean.ServiceProviderInterfaceEntityLocalHome which is
>in th
>e classpath. This class should only be located in the ejb-jar file.>
>      [java]
>      [java]
>      [java] ERROR: Error from ejbc: Class not found:
>Lorg/apache/commons/logging
>/Log;
>       [java] <Apr 23, 2003 1:59:58 PM PDT> <Warning> <EJB> <010054> <EJB
>Deploym
>ent: ServiceProviderInterfaceEntityBean has a class
>com.wisor.validator.servicep
>rovidermanagement.entitybean.ServiceProviderInterfaceEntityLocal which is in
>the
>  classpath. This class should only be located in the ejb-jar file.>
>      [java] [EJBCompiler] : Recompiling because no previous hashes found
>     [java]
>      [java] java.lang.NoClassDefFoundError: Class not found:
>Lorg/apache/commons
>/logging/Log;
>      [java]     at
>weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBCompl
>ianceChecker.java:282)
>      [java]     at
>weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymen
>tInfo(EJBComplianceChecker.java:227)
>      [java]     at
>weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompile
>r.java:923)
>      [java]     at
>weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.j
>ava:879)
>      [java]     at
>weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:23
>2)
>      [java]     at
>weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:3
>96)
>      [java]     at weblogic.ejbc20.runBody(ejbc20.java:459)
>      [java]     at weblogic.utils.compiler.Tool.run(Tool.java:126)
>      [java]     at weblogic.ejbc.main(ejbc.java:21)
>      [java]
>      [java]
>      [java] ERROR: ejbc found errors
>      [java]
>
>BUILD FAILED
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

Problem with Commons and Log4j

Posted by "Chandrasekaran.V" <ch...@wisorindia.soft.net>.
All,
I am using ANT with weblogic 7.0 and Commons with log4j.When I run the
ejbc task I get the following error.

Any suggestions on why this is happening?

Thanks in Advance,
Chandrav

: ServiceProviderInterfaceEntityBean has a class
com.wisor.validator.serviceprov
idermanagement.entitybean.ServiceProviderInterfaceEntityLocalHome which is
in th
e classpath. This class should only be located in the ejb-jar file.>
     [java]
     [java]
     [java] ERROR: Error from ejbc: Class not found:
Lorg/apache/commons/logging
/Log;
      [java] <Apr 23, 2003 1:59:58 PM PDT> <Warning> <EJB> <010054> <EJB
Deploym
ent: ServiceProviderInterfaceEntityBean has a class
com.wisor.validator.servicep
rovidermanagement.entitybean.ServiceProviderInterfaceEntityLocal which is in
the
 classpath. This class should only be located in the ejb-jar file.>
     [java] [EJBCompiler] : Recompiling because no previous hashes found
    [java]
     [java] java.lang.NoClassDefFoundError: Class not found:
Lorg/apache/commons
/logging/Log;
     [java]     at
weblogic.ejb20.compliance.EJBComplianceChecker.check(EJBCompl
ianceChecker.java:282)
     [java]     at
weblogic.ejb20.compliance.EJBComplianceChecker.checkDeploymen
tInfo(EJBComplianceChecker.java:227)
     [java]     at
weblogic.ejb20.ejbc.EJBCompiler.complianceCheckJar(EJBCompile
r.java:923)
     [java]     at
weblogic.ejb20.ejbc.EJBCompiler.checkCompliance(EJBCompiler.j
ava:879)
     [java]     at
weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:23
2)
     [java]     at
weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:3
96)
     [java]     at weblogic.ejbc20.runBody(ejbc20.java:459)
     [java]     at weblogic.utils.compiler.Tool.run(Tool.java:126)
     [java]     at weblogic.ejbc.main(ejbc.java:21)
     [java]
     [java]
     [java] ERROR: ejbc found errors
     [java]

BUILD FAILED


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


Re: log4j version number

Posted by Martin Bosak <bo...@fmctc.com>.
Ceki:

One thing to be aware of (you probably are already; but for those who
aren't):

The Package Object is obtained from reading the jar's manifest file.
Normally for user's, this should be no problem.  If executed with the
classes not in a .jar file (i.e., in a log4j development environment), you
may get null from the classloader unless the manifest file itself is also in
the directory tree.  Also, I believe this was added in JDK 1.2.  If the use
is still on a prior version, a you will get an error.

Marty
----- Original Message -----
From: "Ceki Gülcü" <ce...@qos.ch>
To: "Log4J Users List" <lo...@jakarta.apache.org>
Sent: Wednesday, April 23, 2003 2:54 PM
Subject: Re: log4j version number



Very nice.

Executing the following class using log4j version 1.2.8

import  org.apache.log4j.Layout;
public class X {
   public static void main(String[] a) {
     Package p = Layout.class.getPackage();
     System.out.println(p);
     System.out.println("Implementation title:
"+p.getImplementationTitle());
     System.out.println("Implementation
vendor:  "+p.getImplementationVendor());
     System.out.println("Implementation version:
"+p.getImplementationVersion());
   }
}

yields:

package org.apache.log4j
Implementation title:   log4j
Implementation vendor:  "Apache Software Foundation"
Implementation version: 1.2.8   <-- that's what you are looking for

More importantly, it will yield the expected results with log4j 1.1.x as
well as 1.2.x.

At 04:29 PM 4/23/2003 -0300, you wrote:
>How about
>someLog4jObject.getClass().getPackage().getImplementationVersion()) ?
>
>[]'s
>Daniel Serodio
>
>On Wed, 2003-04-23 at 16:18, Ceki Gülcü wrote:
> > Unfortunately, there is no method or field that contains the version
> > number. I'll add an enhancement request to bugzilla for log4j 1.3.
> >
> > At 12:33 PM 4/23/2003 -0600, you wrote:
> > >Hi;
> > >
> > >Is there any log4j static method or field that will give the version
> > >number? I have users that are using older versions that is causing
> trouble
> > >so I want to print the version number so I know what is going on.
> > >
> > >thanks - dave
> >
> > --
> > Ceki  For log4j documentation consider "The complete log4j manual"
> >        http://www.qos.ch/shop/products/clm_t.jsp
>--
>Daniel Serodio
>CheckForte  5582-6016

--
Ceki  For log4j documentation consider "The complete log4j manual"
       http://www.qos.ch/shop/products/clm_t.jsp


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



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


Re: log4j version number

Posted by Ceki Gülcü <ce...@qos.ch>.
Very nice.

Executing the following class using log4j version 1.2.8

import  org.apache.log4j.Layout;
public class X {
   public static void main(String[] a) {
     Package p = Layout.class.getPackage();
     System.out.println(p);
     System.out.println("Implementation title:   "+p.getImplementationTitle());
     System.out.println("Implementation 
vendor:  "+p.getImplementationVendor());
     System.out.println("Implementation version: 
"+p.getImplementationVersion());
   }
}

yields:

package org.apache.log4j
Implementation title:   log4j
Implementation vendor:  "Apache Software Foundation"
Implementation version: 1.2.8   <-- that's what you are looking for

More importantly, it will yield the expected results with log4j 1.1.x as 
well as 1.2.x.

At 04:29 PM 4/23/2003 -0300, you wrote:
>How about
>someLog4jObject.getClass().getPackage().getImplementationVersion()) ?
>
>[]'s
>Daniel Serodio
>
>On Wed, 2003-04-23 at 16:18, Ceki Gülcü wrote:
> > Unfortunately, there is no method or field that contains the version
> > number. I'll add an enhancement request to bugzilla for log4j 1.3.
> >
> > At 12:33 PM 4/23/2003 -0600, you wrote:
> > >Hi;
> > >
> > >Is there any log4j static method or field that will give the version
> > >number? I have users that are using older versions that is causing 
> trouble
> > >so I want to print the version number so I know what is going on.
> > >
> > >thanks - dave
> >
> > --
> > Ceki  For log4j documentation consider "The complete log4j manual"
> >        http://www.qos.ch/shop/products/clm_t.jsp
>--
>Daniel Serodio
>CheckForte  5582-6016

--
Ceki  For log4j documentation consider "The complete log4j manual"
       http://www.qos.ch/shop/products/clm_t.jsp 


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


Re: log4j version number

Posted by Daniel Serodio <da...@checkforte.com.br>.
How about
someLog4jObject.getClass().getPackage().getImplementationVersion()) ?

[]'s
Daniel Serodio

On Wed, 2003-04-23 at 16:18, Ceki Gülcü wrote:
> Unfortunately, there is no method or field that contains the version 
> number. I'll add an enhancement request to bugzilla for log4j 1.3.
> 
> At 12:33 PM 4/23/2003 -0600, you wrote:
> >Hi;
> >
> >Is there any log4j static method or field that will give the version 
> >number? I have users that are using older versions that is causing trouble 
> >so I want to print the version number so I know what is going on.
> >
> >thanks - dave
> 
> --
> Ceki  For log4j documentation consider "The complete log4j manual"
>        http://www.qos.ch/shop/products/clm_t.jsp
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
-- 
Daniel Serodio
CheckForte  5582-6016


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


Re: log4j version number

Posted by Ceki Gülcü <ce...@qos.ch>.
Unfortunately, there is no method or field that contains the version 
number. I'll add an enhancement request to bugzilla for log4j 1.3.

At 12:33 PM 4/23/2003 -0600, you wrote:
>Hi;
>
>Is there any log4j static method or field that will give the version 
>number? I have users that are using older versions that is causing trouble 
>so I want to print the version number so I know what is going on.
>
>thanks - dave

--
Ceki  For log4j documentation consider "The complete log4j manual"
       http://www.qos.ch/shop/products/clm_t.jsp 


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