Search code examples
solrsolrj

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory in solrj and jsf context


I'm getting above exception for this line:

SolrClient client = new HttpSolrClient("<host>");

Adding commons-logging-1.2.jar as suggested here didn't change anything; nor did adding commons-codec-1.10.jar suggested here.

My app is a JSF web application deployed in Glassfish 4.0 .


Solution

  • I was only adding the jars locally in the NetBeans IDE. Once I added them as dependencies in the maven file instead, all is good.