java - Solrj NoClassDefFoundError -


i'm using solr perform search on database. added following dependency in pom.xml didn't work.

<dependency>     <groupid>org.apache.solr</groupid>     <artifactid>solr-solrj</artifactid>     <version>5.3.1</version> </dependency> 

i got runtime error java.lang.noclassdeffounderror: org/apache/solr/common/params/solrparams

i got solved putting entire library under web-inf/lib folder. confused me why maven dependency didn't work. i'm using tomcat 8.0.

all jars (libraries) referenced in application should available in application's library path @ run time. in pom have defined libraries or packages using. default repository pom ~/.m2/respository keep references jars.

now need provide them @ rum time well. when mvn clean install application, default packages application source code not libraries. these called thin jar's, because contain application code , light weight.

to access them @ runtime, need either create fat jar, bundle jars defined in pom file or need add them application lib path.

by putting them web-inf/lib, adding jar applications lib path, default lib path tomcat.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -