You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Per Halvor Tryggeseth <pe...@bokklubben.no> on 2009/11/17 11:08:02 UTC

Missing slf4j jar in solr 1.4.0 distribution?

I downloaded solr 1.4.0 but discovered when using solrj 1.4 that a required slf4j jar was missing in the distribution (i.e. apache-solr-1.4.0/dist). I got a java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder when using solrj

I solved the problem according to http://www.slf4j.org/codes.html#StaticLoggerBinder
by downloading and including slf4j-nop.jar in my class path
or in maven pom file:
<dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-nop</artifactId>
      <version>1.5.5</version>
 </dependency>

Have I overlooked something or are not all necessary classes required for using solrj in solr 1.4.0 included in the distribution?

Per Halvor

Re: Missing slf4j jar in solr 1.4.0 distribution?

Posted by Jason Rutherglen <ja...@gmail.com>.
Ah, thanks for the tip about switching out the jdk jar with the
log4j jar. I think I was running into this issue and couldn't
figure out why Solr logging couldn't be configured when running
inside Hadoop which uses log4j, maybe this was the issue?

On Wed, Nov 18, 2009 at 9:11 AM, Ryan McKinley <ry...@gmail.com> wrote:
> Solr includes slf4j-jdk14-1.5.5.jar, if you want to use the nop (or log4j,
> or loopback) impl you will need to include that in your own project.
>
> Solr uses slf4j so that each user can decide their logging implementation,
> it includes the jdk version so that something works off-the-shelf, but if
> you want more control, then you can switch in whatever you want.
>
> ryan
>
>
> On Nov 18, 2009, at 1:22 AM, Per Halvor Tryggeseth wrote:
>
>> Thanks. I see. It seems that slf4j-nop-1.5.5.jar is the only jar file
>> missing in solrj-lib, so I suggest that it should be included in the next
>> release.
>>
>> Per Halvor
>>
>>
>>
>>
>>
>> -----Opprinnelig melding-----
>> Fra: Chris Hostetter [mailto:hossman_lucene@fucit.org]
>> Sendt: 17. november 2009 20:51
>> Til: 'solr-user@lucene.apache.org'
>> Emne: Re: Missing slf4j jar in solr 1.4.0 distribution?
>>
>>
>> : I downloaded solr 1.4.0 but discovered when using solrj 1.4 that a
>> : required slf4j jar was missing in the distribution (i.e.
>> : apache-solr-1.4.0/dist). I got a java.lang.NoClassDefFoundError:
>> : org/slf4j/impl/StaticLoggerBinder when using solrj
>>       ...
>> : Have I overlooked something or are not all necessary classes required
>> : for using solrj in solr 1.4.0 included in the distribution?
>>
>> Regretably, Solr releases aren't particularly consistent about where
>> third-party libraries can be found.
>>
>> If you use the the pre-built war, the 'main' dependencies are allready
>> bunlded into it.  If you want to roll your own, you need to look at the
>> "./lib" directory -- "./dist" is only *suppose* to contain the artifacts
>> built from solr source But that solrj-lib directory can be confusing)...
>>
>> hossman@brunner:apache-solr-1.4.0$ ls ./lib/slf4j-*
>> lib/slf4j-api-1.5.5.jar         lib/slf4j-jdk14-1.5.5.jar
>>
>> -Hoss
>>
>
>

Re: Missing slf4j jar in solr 1.4.0 distribution?

Posted by Chris Hostetter <ho...@fucit.org>.
: Thank you! There is a nice wiki page for solrj 1.3, 
: http://wiki.apache.org/solr/Solrj If someone have time and is competent 
: it would have been nice to have a similar page for solrj4 where all 
: these things and more is described.

You mean like this one...

	http://wiki.apache.org/solr/SolrLogging

...people are free to add any details they think are helpful to the wiki.



-Hoss


Re: Missing slf4j jar in solr 1.4.0 distribution?

Posted by Per Halvor Tryggeseth <pe...@bokklubben.no>.
Thank you! There is a nice wiki page for solrj 1.3, http://wiki.apache.org/solr/Solrj If someone have time and is competent it would have been nice to have a similar page for solrj4 where all these things and more is described.

Per Halvor

-----Opprinnelig melding-----
Fra: Ryan McKinley [mailto:ryantxu@gmail.com]
Sendt: 18. november 2009 18:12
Til: solr-user@lucene.apache.org
Emne: Re: Missing slf4j jar in solr 1.4.0 distribution?

Solr includes slf4j-jdk14-1.5.5.jar, if you want to use the nop (or log4j, or loopback) impl you will need to include that in your own project.

Solr uses slf4j so that each user can decide their logging implementation, it includes the jdk version so that something works off-the-shelf, but if you want more control, then you can switch in whatever you want.

ryan


On Nov 18, 2009, at 1:22 AM, Per Halvor Tryggeseth wrote:

> Thanks. I see. It seems that slf4j-nop-1.5.5.jar is the only jar file
> missing in solrj-lib, so I suggest that it should be included in the
> next release.
>
> Per Halvor
>
>
>
>
>
> -----Opprinnelig melding-----
> Fra: Chris Hostetter [mailto:hossman_lucene@fucit.org]
> Sendt: 17. november 2009 20:51
> Til: 'solr-user@lucene.apache.org'
> Emne: Re: Missing slf4j jar in solr 1.4.0 distribution?
>
>
> : I downloaded solr 1.4.0 but discovered when using solrj 1.4 that a
> : required slf4j jar was missing in the distribution (i.e.
> : apache-solr-1.4.0/dist). I got a java.lang.NoClassDefFoundError:
> : org/slf4j/impl/StaticLoggerBinder when using solrj
>        ...
> : Have I overlooked something or are not all necessary classes
> required
> : for using solrj in solr 1.4.0 included in the distribution?
>
> Regretably, Solr releases aren't particularly consistent about where
> third-party libraries can be found.
>
> If you use the the pre-built war, the 'main' dependencies are allready
> bunlded into it.  If you want to roll your own, you need to look at
> the "./lib" directory -- "./dist" is only *suppose* to contain the
> artifacts built from solr source But that solrj-lib directory can be
> confusing)...
>
> hossman@brunner:apache-solr-1.4.0$ ls ./lib/slf4j-*
> lib/slf4j-api-1.5.5.jar         lib/slf4j-jdk14-1.5.5.jar
>
> -Hoss
>


Re: Missing slf4j jar in solr 1.4.0 distribution?

Posted by Ryan McKinley <ry...@gmail.com>.
Solr includes slf4j-jdk14-1.5.5.jar, if you want to use the nop (or  
log4j, or loopback) impl you will need to include that in your own  
project.

Solr uses slf4j so that each user can decide their logging  
implementation, it includes the jdk version so that something works  
off-the-shelf, but if you want more control, then you can switch in  
whatever you want.

ryan


On Nov 18, 2009, at 1:22 AM, Per Halvor Tryggeseth wrote:

> Thanks. I see. It seems that slf4j-nop-1.5.5.jar is the only jar  
> file missing in solrj-lib, so I suggest that it should be included  
> in the next release.
>
> Per Halvor
>
>
>
>
>
> -----Opprinnelig melding-----
> Fra: Chris Hostetter [mailto:hossman_lucene@fucit.org]
> Sendt: 17. november 2009 20:51
> Til: 'solr-user@lucene.apache.org'
> Emne: Re: Missing slf4j jar in solr 1.4.0 distribution?
>
>
> : I downloaded solr 1.4.0 but discovered when using solrj 1.4 that a
> : required slf4j jar was missing in the distribution (i.e.
> : apache-solr-1.4.0/dist). I got a java.lang.NoClassDefFoundError:
> : org/slf4j/impl/StaticLoggerBinder when using solrj
>        ...
> : Have I overlooked something or are not all necessary classes  
> required
> : for using solrj in solr 1.4.0 included in the distribution?
>
> Regretably, Solr releases aren't particularly consistent about where  
> third-party libraries can be found.
>
> If you use the the pre-built war, the 'main' dependencies are  
> allready bunlded into it.  If you want to roll your own, you need to  
> look at the "./lib" directory -- "./dist" is only *suppose* to  
> contain the artifacts built from solr source But that solrj-lib  
> directory can be confusing)...
>
> hossman@brunner:apache-solr-1.4.0$ ls ./lib/slf4j-*
> lib/slf4j-api-1.5.5.jar         lib/slf4j-jdk14-1.5.5.jar
>
> -Hoss
>


Re: Missing slf4j jar in solr 1.4.0 distribution?

Posted by Per Halvor Tryggeseth <pe...@bokklubben.no>.
Thanks. I see. It seems that slf4j-nop-1.5.5.jar is the only jar file missing in solrj-lib, so I suggest that it should be included in the next release.

Per Halvor





-----Opprinnelig melding-----
Fra: Chris Hostetter [mailto:hossman_lucene@fucit.org]
Sendt: 17. november 2009 20:51
Til: 'solr-user@lucene.apache.org'
Emne: Re: Missing slf4j jar in solr 1.4.0 distribution?


: I downloaded solr 1.4.0 but discovered when using solrj 1.4 that a
: required slf4j jar was missing in the distribution (i.e.
: apache-solr-1.4.0/dist). I got a java.lang.NoClassDefFoundError:
: org/slf4j/impl/StaticLoggerBinder when using solrj
        ...
: Have I overlooked something or are not all necessary classes required
: for using solrj in solr 1.4.0 included in the distribution?

Regretably, Solr releases aren't particularly consistent about where third-party libraries can be found.

If you use the the pre-built war, the 'main' dependencies are allready bunlded into it.  If you want to roll your own, you need to look at the "./lib" directory -- "./dist" is only *suppose* to contain the artifacts built from solr source But that solrj-lib directory can be confusing)...

hossman@brunner:apache-solr-1.4.0$ ls ./lib/slf4j-*
lib/slf4j-api-1.5.5.jar         lib/slf4j-jdk14-1.5.5.jar

-Hoss


Re: Missing slf4j jar in solr 1.4.0 distribution?

Posted by Chris Hostetter <ho...@fucit.org>.
: I downloaded solr 1.4.0 but discovered when using solrj 1.4 that a 
: required slf4j jar was missing in the distribution (i.e. 
: apache-solr-1.4.0/dist). I got a java.lang.NoClassDefFoundError: 
: org/slf4j/impl/StaticLoggerBinder when using solrj
	...
: Have I overlooked something or are not all necessary classes required 
: for using solrj in solr 1.4.0 included in the distribution?

Regretably, Solr releases aren't particularly consistent about where 
third-party libraries can be found.

If you use the the pre-built war, the 'main' dependencies are allready 
bunlded into it.  If you want to roll your own, you need to look at the 
"./lib" directory -- "./dist" is only *suppose* to contain the artifacts 
built from solr source But that solrj-lib directory can be confusing)...

hossman@brunner:apache-solr-1.4.0$ ls ./lib/slf4j-*
lib/slf4j-api-1.5.5.jar         lib/slf4j-jdk14-1.5.5.jar

-Hoss