[ 
https://issues.apache.org/jira/browse/OFBIZ-9444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16079544#comment-16079544
 ] 

Renuka Srishti commented on OFBIZ-9444:
---------------------------------------

Hii Michael,
Add dependency in main build.gradle
{code}
compile group: 'com.google.guava', name: 'guava', version: '20.0'
{code}
I have tried this and it's not showing any error. Please check and let me know 
if you find any issue.

> Dependency problem between Solr 6.6.0 and Guava
> -----------------------------------------------
>
>                 Key: OFBIZ-9444
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-9444
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: solr
>    Affects Versions: Trunk
>            Reporter: Michael Brohl
>         Attachments: dependencies.txt
>
>
> It seems we have a dependency problem in our codebase.
> The Solr code needs access to a method 
> com.google.common.base.Objects.firstNonNull, which was removed from Guava 
> from version 21 (see [1]).
> I tried to add the dependency both through the Solr build.gradle with
> {code:java}
> dependencies {
>     pluginLibsCompile 'org.apache.solr:solr-core:6.6.0'
>     pluginLibsCompile 'com.google.guava:guava:20.0'
> }
> {code}
> and also as a runtime dependency in main build.gradle
> {code:java}
> dependencies {
>     // ofbiz compile libs
> ...
>     runtime 'com.google.guava:guava:20.0'
> ...
> }
> {code}
> Both did not work. Running my Solo tests I get the error
> {code:java}
> 2017-07-01 14:25:18,049 |jsse-nio-8443-exec-4 |HttpSolrCall                  
> |E| null:java.lang.RuntimeException: java.lang.NoSuchMethodError: 
> com.google.common.base.Objects.firstNonNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
>         at 
> org.apache.solr.servlet.HttpSolrCall.sendError(HttpSolrCall.java:676)
>         at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:544)
>         at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:361)
>         at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:305)
>         at 
> org.apache.ofbiz.solr.webapp.OFBizSolrContextFilter.doFilter(OFBizSolrContextFilter.java:151)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>         at 
> org.apache.ofbiz.webapp.control.ControlFilter.doFilter(ControlFilter.java:156)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
>         at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
>         at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
>         at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
>         at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
>         at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
>         at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
>         at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
>         at 
> org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
>         at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
>         at 
> org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
>         at 
> org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
>         at 
> org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
>         at 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
>         at 
> org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at 
> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: java.lang.NoSuchMethodError: 
> com.google.common.base.Objects.firstNonNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
>         at 
> org.apache.solr.handler.component.HighlightComponent.prepare(HighlightComponent.java:118)
>         at 
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:270)
>         at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)
>         at org.apache.solr.core.SolrCore.execute(SolrCore.java:2477)
>         at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)
>         at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)
>         ... 25 more
> {code}
> After removing my grade cache and doing a fresh
> {code:java}
> ./gradlew cleanAll loadAll testIntegration
> {code}
> the cradle cache contains both libraries from Guava 20.0 and 22.0 so I guess 
> there must be some other dependency somewhere.
> [1] https://issues.apache.org/jira/browse/SOLR-10308



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to