[ https://issues.apache.org/jira/browse/SOLR-8180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14968473#comment-14968473 ]
Shawn Heisey commented on SOLR-8180: ------------------------------------ I believe that the primary resource requiring commons-logging is HttpClient. I haven't checked to see if it is required by any other dependencies. The commons-logging dependency will normally be satisfied by the jars pulled in for logging -- those other than slf4j-api, which is included in the .war file for Solr and solrj-lib for SolrJ. For the Solr *server*, this is satisfied by jcl-over-slf4j-1.7.7.jar ... which you can find in the Solr download at server/lib/ext, with the other logging jars. That jar captures calls to commons-logging and directs them through slf4j, which then sends them to whatever logging framework is bound. Since 4.3, the bundled example server has used log4j 1.2 as the binding. Versions prior to 4.3 used java.util.logging, and the logging jars were bundled in the .war file. If the user wants to actually use commons-logging for their slf4j binding, then they would not use jcl-over-slf4j-1.7.7.jar ... they would use the actual commons-logging jar and its dependencies. An additional jar would be required to redirect log4j through slf4j. Some generic info about slf4j logging and Solr: https://wiki.apache.org/solr/SolrLogging Just like the Solr server, SolrJ requires additional logging jars not included in solrj-lib. The reason they are not included there is because we do not know what kind of logging the user wants. They are free to choose whatever meets their needs. This probably needs a mention in the docs. > Missing commons-logging dependency in solrj-lib for SolrJ > --------------------------------------------------------- > > Key: SOLR-8180 > URL: https://issues.apache.org/jira/browse/SOLR-8180 > Project: Solr > Issue Type: Bug > Components: SolrJ > Affects Versions: Trunk > Reporter: Kevin Risden > Attachments: SOLR-8180.patch > > > When using DBVisualizer, SquirrelSQL, or Java JDBC with the Solr JDBC driver, > an additional dependency on commons-logging must be added otherwise the > following exception occurs: > {code} > org.apache.solr.common.SolrException: Unable to create HttpClient instance. > at > org.apache.solr.client.solrj.impl.HttpClientUtil$HttpClientFactory.createHttpClient(HttpClientUtil.java:393) > at > org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(HttpClientUtil.java:124) > at > org.apache.solr.client.solrj.impl.CloudSolrClient.<init>(CloudSolrClient.java:196) > at > org.apache.solr.client.solrj.io.SolrClientCache.getCloudSolrClient(SolrClientCache.java:47) > at > org.apache.solr.client.solrj.io.sql.ConnectionImpl.<init>(ConnectionImpl.java:51) > at > org.apache.solr.client.solrj.io.sql.DriverImpl.connect(DriverImpl.java:108) > at > org.apache.solr.client.solrj.io.sql.DriverImpl.connect(DriverImpl.java:76) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at com.onseven.dbvis.h.B.D.ᅣチ(Z:1548) > at com.onseven.dbvis.h.B.F$A.call(Z:1369) > at java.util.concurrent.FutureTask.run(FutureTask.java:266) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.reflect.InvocationTargetException > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) > at > sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) > at > sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) > at java.lang.reflect.Constructor.newInstance(Constructor.java:422) > at > org.apache.solr.client.solrj.impl.HttpClientUtil$HttpClientFactory.createHttpClient(HttpClientUtil.java:391) > ... 16 more > Caused by: java.lang.NoClassDefFoundError: > org/apache/commons/logging/LogFactory > at > org.apache.http.impl.client.CloseableHttpClient.<init>(CloseableHttpClient.java:58) > at > org.apache.http.impl.client.AbstractHttpClient.<init>(AbstractHttpClient.java:287) > at > org.apache.http.impl.client.DefaultHttpClient.<init>(DefaultHttpClient.java:128) > at > org.apache.http.impl.client.SystemDefaultHttpClient.<init>(SystemDefaultHttpClient.java:116) > ... 21 more > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org