4

I am trying to integrate Apache Solr into Moqui. I am not able to access the Solr API. I have placed the solr jar in framework/lib directory but I am getting this exception when trying to run the service from the tools section.

Error running groovy script (org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: java.lang.NoClassDefFoundError: Unable to load class org.apache.solr.client.solrj.impl.HttpSolrClient due to missing dependency org/apache/http/entity/mime/content/ContentBody

Is there any other configuration that I need to do, to use the Solr API?

adityazoso
  • 514
  • 5
  • 15

1 Answers1

0

In general it is best to not modify anything under the framework directory, even configuration files such as properties files should be overridden by adding them in the runtime/classes directory or in a /classes directory.

In this case to have a jar from the framework/lib directory you have to add it to the framework/build.gradle file and then do a gradle build so the jar file will be added to the Moqui WAR file.

The better approach is to add it to the runtime/lib directory or even better when using a jar file in code in your component add it to the /classes directory (the Making Apps with Moqui book has more info about this).

More generally, why use Solr? ElasticSearch is included with Moqui and used (and enhanced) by various framework features.

David E. Jones
  • 1,721
  • 1
  • 9
  • 8