You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by zhao zhendong <zh...@gmail.com> on 2010/01/09 13:22:15 UTC

slf4j library lost?

Hi all,

When I new a SparseVector, the mahout-core always failed with
"
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
details.
Exception in thread "main" java.lang.NoClassDefFoundError:
org/slf4j/impl/StaticLoggerBinder
        at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
        at
org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
        at
org.apache.mahout.math.map.PrimeFinder.<clinit>(PrimeFinder.java:24)
        at
org.apache.mahout.math.map.AbstractMap.nextPrime(AbstractMap.java:141)
        at
org.apache.mahout.math.map.OpenIntDoubleHashMap.setUp(OpenIntDoubleHashMap.java:578)
        at
org.apache.mahout.math.map.OpenIntDoubleHashMap.<init>(OpenIntDoubleHashMap.java:66)
        at
org.apache.mahout.math.map.OpenIntDoubleHashMap.<init>(OpenIntDoubleHashMap.java:52)
        at org.apache.mahout.math.SparseVector.<init>(SparseVector.java:50)
        at org.apache.mahout.math.SparseVector.<init>(SparseVector.java:60)
"
The testing code is extremely simple:

    public static void main(String [] args){
            System.out.println("hello world!");
            SparseVector v = new SparseVector(11);
            System.out.println(v.size());
     }

I've checked the reason from:
http://www.slf4j.org/codes.html#StaticLoggerBinder

Failed to load class org.slf4j.impl.StaticLoggerBinder <#StaticLoggerBinder>

This error is reported when the org.slf4j.impl.StaticLoggerBinder class
could not be loaded into memory. This happens when no appropriate SLF4J
binding could be found on the class path. Placing one (and only one) of *
slf4j-nop.jar*, *slf4j-simple.jar*, *slf4j-log4j12.jar*,*slf4j-jdk14.jar*
 or *logback-classic.jar* on the class path should solve the problem.

You can download SLF4J bindings from the project download
page<http://www.slf4j.org/download.html>
.


Has anybody met the same problem?
-- 
-------------------------------------------------------------

Zhen-Dong Zhao (Maxim)

<><<><><><><><><><>><><><><><>>>>>>

Department of Computer Science
School of Computing
National University of Singapore

><><><><><><><><><><><><><><><><<<<
Homepage:http://zhaozhendong.googlepages.com
Mail: zhaozhendong at gmail dot com
>>>>>>><><><><><><><><<><>><><<<<<<

Re: slf4j library lost?

Posted by zhao zhendong <zh...@gmail.com>.
Sure, I can handle it locally :) Thanks.


On Sat, Jan 9, 2010 at 8:25 PM, Sean Owen <sr...@gmail.com> wrote:

> Drew this is probably an artifact of that last change, which converts
> SLF4J bindings to a runtime dependency.
>
> But Zhendong this is something, I think, you would need to address
> locally. However you run this simple program -- the SLF4J binding has
> to be on the classpath. I would imagine you have always had to do
> this?
>
> On Sat, Jan 9, 2010 at 12:22 PM, zhao zhendong <zh...@gmail.com>
> wrote:
> > Hi all,
> >
> > When I new a SparseVector, the mahout-core always failed with
> > "
> > SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> > SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
> further
> > details.
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > org/slf4j/impl/StaticLoggerBinder
> >        at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
> >        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
> >        at
> > org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
> >        at
> org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
> >        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
> >        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
> >        at
> > org.apache.mahout.math.map.PrimeFinder.<clinit>(PrimeFinder.java:24)
> >        at
> > org.apache.mahout.math.map.AbstractMap.nextPrime(AbstractMap.java:141)
> >        at
> >
> org.apache.mahout.math.map.OpenIntDoubleHashMap.setUp(OpenIntDoubleHashMap.java:578)
> >        at
> >
> org.apache.mahout.math.map.OpenIntDoubleHashMap.<init>(OpenIntDoubleHashMap.java:66)
> >        at
> >
> org.apache.mahout.math.map.OpenIntDoubleHashMap.<init>(OpenIntDoubleHashMap.java:52)
> >        at
> org.apache.mahout.math.SparseVector.<init>(SparseVector.java:50)
> >        at
> org.apache.mahout.math.SparseVector.<init>(SparseVector.java:60)
> > "
> > The testing code is extremely simple:
> >
> >    public static void main(String [] args){
> >            System.out.println("hello world!");
> >            SparseVector v = new SparseVector(11);
> >            System.out.println(v.size());
> >     }
> >
> > I've checked the reason from:
> > http://www.slf4j.org/codes.html#StaticLoggerBinder
> >
> > Failed to load class org.slf4j.impl.StaticLoggerBinder
> <#StaticLoggerBinder>
> >
> > This error is reported when the org.slf4j.impl.StaticLoggerBinder class
> > could not be loaded into memory. This happens when no appropriate SLF4J
> > binding could be found on the class path. Placing one (and only one) of *
> > slf4j-nop.jar*, *slf4j-simple.jar*, *slf4j-log4j12.jar*,*slf4j-jdk14.jar*
> >  or *logback-classic.jar* on the class path should solve the problem.
> >
> > You can download SLF4J bindings from the project download
> > page<http://www.slf4j.org/download.html>
> > .
> >
> >
> > Has anybody met the same problem?
> > --
> > -------------------------------------------------------------
> >
> > Zhen-Dong Zhao (Maxim)
> >
> > <><<><><><><><><><>><><><><><>>>>>>
> >
> > Department of Computer Science
> > School of Computing
> > National University of Singapore
> >
> >><><><><><><><><><><><><><><><><<<<
> > Homepage:http://zhaozhendong.googlepages.com
> > Mail: zhaozhendong at gmail dot com
> >>>>>>>><><><><><><><><<><>><><<<<<<
> >
>



-- 
-------------------------------------------------------------

Zhen-Dong Zhao (Maxim)

<><<><><><><><><><>><><><><><>>>>>>

Department of Computer Science
School of Computing
National University of Singapore

><><><><><><><><><><><><><><><><<<<
Homepage:http://zhaozhendong.googlepages.com
Mail: zhaozhendong at gmail dot com
>>>>>>><><><><><><><><<><>><><<<<<<

Re: slf4j library lost?

Posted by zhao zhendong <zh...@gmail.com>.
Hi Drew,

Thanks, I locally add the package slf4j-jcl. And it works. Thanks.

Cheers,
Zhendong

On Sat, Jan 9, 2010 at 11:48 PM, Drew Farris <dr...@gmail.com> wrote:

> Yes, I indeed this is likely related to the dependency cleanup. Zhao,
> slf4j-jcl must be in your classpath. How were you setting up the classpath
> in the case where this worked before the cleanup? I want to be sure
> everything is where it should be.
>
> On Jan 9, 2010 7:26 AM, "Sean Owen" <sr...@gmail.com> wrote:
>
> Drew this is probably an artifact of that last change, which converts
> SLF4J bindings to a runtime dependency.
>
> But Zhendong this is something, I think, you would need to address
> locally. However you run this simple program -- the SLF4J binding has
> to be on the classpath. I would imagine you have always had to do
> this?
>
> On Sat, Jan 9, 2010 at 12:22 PM, zhao zhendong <zh...@gmail.com>
> wrote: > Hi all, > > When I...
>



-- 
-------------------------------------------------------------

Zhen-Dong Zhao (Maxim)

<><<><><><><><><><>><><><><><>>>>>>

Department of Computer Science
School of Computing
National University of Singapore

><><><><><><><><><><><><><><><><<<<
Homepage:http://zhaozhendong.googlepages.com
Mail: zhaozhendong at gmail dot com
>>>>>>><><><><><><><><<><>><><<<<<<

Re: slf4j library lost?

Posted by Drew Farris <dr...@gmail.com>.
Yes, I indeed this is likely related to the dependency cleanup. Zhao,
slf4j-jcl must be in your classpath. How were you setting up the classpath
in the case where this worked before the cleanup? I want to be sure
everything is where it should be.

On Jan 9, 2010 7:26 AM, "Sean Owen" <sr...@gmail.com> wrote:

Drew this is probably an artifact of that last change, which converts
SLF4J bindings to a runtime dependency.

But Zhendong this is something, I think, you would need to address
locally. However you run this simple program -- the SLF4J binding has
to be on the classpath. I would imagine you have always had to do
this?

On Sat, Jan 9, 2010 at 12:22 PM, zhao zhendong <zh...@gmail.com>
wrote: > Hi all, > > When I...

Re: slf4j library lost?

Posted by Sean Owen <sr...@gmail.com>.
Drew this is probably an artifact of that last change, which converts
SLF4J bindings to a runtime dependency.

But Zhendong this is something, I think, you would need to address
locally. However you run this simple program -- the SLF4J binding has
to be on the classpath. I would imagine you have always had to do
this?

On Sat, Jan 9, 2010 at 12:22 PM, zhao zhendong <zh...@gmail.com> wrote:
> Hi all,
>
> When I new a SparseVector, the mahout-core always failed with
> "
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further
> details.
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/slf4j/impl/StaticLoggerBinder
>        at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:223)
>        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:120)
>        at
> org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
>        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:269)
>        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
>        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:255)
>        at
> org.apache.mahout.math.map.PrimeFinder.<clinit>(PrimeFinder.java:24)
>        at
> org.apache.mahout.math.map.AbstractMap.nextPrime(AbstractMap.java:141)
>        at
> org.apache.mahout.math.map.OpenIntDoubleHashMap.setUp(OpenIntDoubleHashMap.java:578)
>        at
> org.apache.mahout.math.map.OpenIntDoubleHashMap.<init>(OpenIntDoubleHashMap.java:66)
>        at
> org.apache.mahout.math.map.OpenIntDoubleHashMap.<init>(OpenIntDoubleHashMap.java:52)
>        at org.apache.mahout.math.SparseVector.<init>(SparseVector.java:50)
>        at org.apache.mahout.math.SparseVector.<init>(SparseVector.java:60)
> "
> The testing code is extremely simple:
>
>    public static void main(String [] args){
>            System.out.println("hello world!");
>            SparseVector v = new SparseVector(11);
>            System.out.println(v.size());
>     }
>
> I've checked the reason from:
> http://www.slf4j.org/codes.html#StaticLoggerBinder
>
> Failed to load class org.slf4j.impl.StaticLoggerBinder <#StaticLoggerBinder>
>
> This error is reported when the org.slf4j.impl.StaticLoggerBinder class
> could not be loaded into memory. This happens when no appropriate SLF4J
> binding could be found on the class path. Placing one (and only one) of *
> slf4j-nop.jar*, *slf4j-simple.jar*, *slf4j-log4j12.jar*,*slf4j-jdk14.jar*
>  or *logback-classic.jar* on the class path should solve the problem.
>
> You can download SLF4J bindings from the project download
> page<http://www.slf4j.org/download.html>
> .
>
>
> Has anybody met the same problem?
> --
> -------------------------------------------------------------
>
> Zhen-Dong Zhao (Maxim)
>
> <><<><><><><><><><>><><><><><>>>>>>
>
> Department of Computer Science
> School of Computing
> National University of Singapore
>
>><><><><><><><><><><><><><><><><<<<
> Homepage:http://zhaozhendong.googlepages.com
> Mail: zhaozhendong at gmail dot com
>>>>>>>><><><><><><><><<><>><><<<<<<
>