简体   繁体   English

Solr,clustering(胡萝卜)和NoClassDefFoundError

[英]Solr, clustering (carrot) and NoClassDefFoundError

i'm running Solr 3.4 and would like to use the clusteringComponent. 我正在运行Solr 3.4并想使用clusteringComponent。 Following this tutorial: http://wiki.apache.org/solr/ClusteringComponent in combination with default entries at the solrconfig.xml i have the following configuration @solrconfig.xml 遵循本教程: http ://wiki.apache.org/solr/ClusteringComponent与solrconfig.xml中的默认条目相结合我有以下配置@ solrconfig.xml

  <searchComponent name="clustering" 
                   enable="${solr.clustering.enabled:true}"
                   class="org.apache.solr.handler.clustering.ClusteringComponent" >

    <!-- Declare an engine -->
    <lst name="engine">
      <str name="name">default</str>
      <str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
      <str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
    </lst>

    <lst name="engine">
      <str name="name">stc</str>
      <str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
    </lst>
  </searchComponent>


<requestHandler name="/cl" class="solr.SearchHandler" >
  <lst name="defaults">
    <str name="echoParams">explicit</str>

    <bool name="clustering">true</bool>
    <str name="clustering.engine">default</str>
    <bool name="clustering.results">true</bool>

    <!-- Fields to cluster on -->
    <str name="carrot.title">UEBSCHRIFT</str>
    <str name="carrot.snippet">TEXT</str>
  </lst>

So if i try to use the requestHandler http://server:8080/solr/mycore/cl?q=*:* i get the following Java exception: 所以如果我尝试使用requestHandler http://server:8080/solr/mycore/cl?q=*:*我得到以下Java异常:

java.lang.NoClassDefFoundError: com.carrotsearch.hppc.ObjectContainer
    at java.lang.J9VMInternals.verifyImpl(Native Method)
    at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
    at org.carrot2.text.preprocessing.pipeline.BasicPreprocessingPipeline.&lt;init&gt;(BasicPreprocessingPipeline.java:106)
    at org.carrot2.text.preprocessing.pipeline.CompletePreprocessingPipeline.&lt;init&gt;(CompletePreprocessingPipeline.java:32)
    at org.carrot2.clustering.lingo.LingoClusteringAlgorithm.&lt;init&gt;(LingoClusteringAlgorithm.java:129)
    at java.lang.J9VMInternals.newInstanceImpl(Native Method)
    at java.lang.Class.newInstance(Class.java:1325)
    at org.carrot2.util.pool.SoftUnboundedPool.borrowObject(SoftUnboundedPool.java:80)
    at org.carrot2.core.PoolingProcessingComponentManager.prepare(PoolingProcessingComponentManager.java:128)
    at org.carrot2.core.Controller.process(Controller.java:333)
    at org.carrot2.core.Controller.process(Controller.java:240)
    at org.apache.solr.handler.clustering.carrot2.CarrotClusteringEngine.cluster(CarrotClusteringEngine.java:136)
    at org.apache.solr.handler.clustering.ClusteringComponent.process(ClusteringComponent.java:91)
    at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194)
    at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
    at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
    at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:735)
Caused by: java.lang.ClassNotFoundException: com.carrotsearch.hppc.ObjectContainer
    at java.lang.Throwable.&lt;init&gt;(Throwable.java:80)
    at java.lang.ClassNotFoundException.&lt;init&gt;(ClassNotFoundException.java:76)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
    at java.lang.ClassLoader.loadClass(ClassLoader.java)
    at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:923)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
    ... 31 more

The point is, that I have no idea what this mean. 关键是,我不知道这意味着什么。 I'm searching for hours without finding an solution. 我正在寻找几个小时而没有找到解决方案。

By the way: I'm running on tomcat with the following options: 顺便说一句:我在tomcat上使用以下选项运行:

export CATALINA_OPTS="-Dsolr.clustering.enabled=true"

(is this still required in Solr 3.4?) (这在Solr 3.4中仍然需要吗?)

The catalina option is part of the java command, as you can see with ps -efa catalina选项是java命令的一部分,您可以使用ps -efa查看

/usr/lib64/jvm/java-1_6_0-ibm-1.6.0/jre//bin/java -Djava.util.logging.config.file=/opt/tomcat6/conf/logging.properties -Xms2048m -Xmx2048m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dsolr.clustering.enabled=true -Djava.endorsed.dirs=/opt/tomcat6/endorsed -classpath /opt/tomcat6/bin/bootstrap.jar -Dcatalina.base=/opt/tomcat6 -Dcatalina.home=/opt/tomcat6 -Djava.io.tmpdir=/opt/tomcat6/temp org.apache.catalina.startup.Bootstrap start /usr/lib64/jvm/java-1_6_0-ibm-1.6.0/jre//bin/java -Djava.util.logging.config.file = / opt / tomcat6 / conf / logging.properties -Xms2048m -Xmx2048m -Djava .util.logging.manager = org.apache.juli.ClassLoaderLogManager -Dsolr.clustering.enabled = true -Djava.endorsed.dirs = / opt / tomcat6 / endorsed -classpath /opt/tomcat6/bin/bootstrap.jar -Dcatalina。 base = / opt / tomcat6 -Dcatalina.home = / opt / tomcat6 -Djava.io.tmpdir = / opt / tomcat6 / temp org.apache.catalina.startup.Bootstrap start

Does anyone has an idea what i could do to solve this problem? 有谁知道我能做些什么来解决这个问题?

//Update: if i add hppc-0.3.4-jdk15.jar, i get the following error: //更新:如果我添加hppc-0.3.4-jdk15.jar,我收到以下错误:

java.lang.NoClassDefFoundError: org.apache.mahout.math.matrix.DoubleMatrix2D
    at java.lang.J9VMInternals.verifyImpl(Native Method)
    at java.lang.J9VMInternals.verify(J9VMInternals.java:72)
    at java.lang.J9VMInternals.initialize(J9VMInternals.java:134)
    at org.carrot2.clustering.lingo.LingoClusteringAlgorithm.&lt;init&gt;(LingoClusteringAlgorithm.java:134)
[...]
Caused by: java.lang.ClassNotFoundException: org.apache.mahout.math.matrix.DoubleMatrix2D
    at java.lang.Throwable.&lt;init&gt;(Throwable.java:80)
    at java.lang.ClassNotFoundException.&lt;init&gt;(ClassNotFoundException.java:76)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
    at java.lang.ClassLoader.loadClass(ClassLoader.java)
    at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:923)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
    ... 29 more

it looks like, i have to install an mahout archive, but i think, all packages for clustering are included in Solr 3.4?! 看起来,我必须安装一个mahout存档,但我认为,所有用于集群的软件包都包含在Solr 3.4中! It looks like, i'm on the wrong way?! 看起来,我的方向错了?!

If you are using Solr with tomcat as a seperate instance, you would need to copy the jars so that they are available for Solr. 如果您将Solr与tomcat一起用作单独的实例,则需要复制jar以便它们可用于Solr。

Quote from README.txt README.txt引用

NOTE: This Solr example server references certain Solr jars outside of this server directory for non-core modules with statements in solrconfig.xml. 注意:此Solr示例服务器使用solrconfig.xml中的语句为非核心模块引用此服务器目录之外的某些Solr jar。 If you make a copy of this example server and wish to use the ExtractingRequestHandler (SolrCell), DataImportHandler (DIH), UIMA, the clustering component, or other modules in "contrib", you will need to copy the required jars into solr/lib or update the paths to the jars in your solrconfig.xml. 如果您复制此示例服务器并希望使用ExtractingRequestHandler(SolrCell),DataImportHandler(DIH),UIMA,集群组件或“contrib”中的其他模块,则需要将所需的jar复制到solr / lib中或者更新solrconfig.xml中jar的路径。

Check for the clustering and carrot jars in solrconfig.xml. 检查solrconfig.xml中的群集和胡萝卜罐。
Probably you are missing hppc-0.3.4-jdk15.jar 可能你缺少hppc-0.3.4-jdk15.jar

Did you add the Mahout Math package? 你添加了Mahout Math包吗?

It seems to be a separate package. 它似乎是一个单独的包。

NoClassDefFoundError: org.apache.mahout.math.matrix.DoubleMatrix2D
                      ^^^^^^^^^^^^^^^^^^^^^^

Why not use Solr's default packaging (this is officially supported)? 为什么不使用Solr的默认包装(这是官方支持的)? It ships with Jetty and will save you the headaches connected with classpath because things are already configured. 它附带了Jetty,可以节省与classpath相关的麻烦,因为已经配置好了。

Answering your question, you'll need all the JARs from Solr's default clustering extension folders; 回答你的问题,你需要Solr的默认群集扩展文件夹中的所有JAR; for 4.0 alpha this would be: contrib/clustering/lib/*.jar 对于4.0 alpha,这将是:contrib / clustering / lib / * .jar

carrot2-core-3.5.0.jar hppc-0.3.3.jar jackson-core-asl-1.7.4.jar jackson-mapper-asl-1.7.4.jar mahout-collections-0.3.jar mahout-math-0.3.jar simple-xml-2.4.1.jar carrot2-core-3.5.0.jar hppc-0.3.3.jar jackson-core-asl-1.7.4.jar jackson-mapper-asl-1.7.4.jar mahout-collections-0.3.jar mahout-math-0.3 .jar simple-xml-2.4.1.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM