在Solr 5

时间:2016-03-09 21:17:31

标签: solr

我正在尝试将SOLR 3升级到5,我们有一个基于本教程的自定义函数http://www.solrtutorial.com/custom-solr-functionquery.html 不幸的是,SOLR 5似乎已经过时了。

我做了一些替换如下(省略org.apache)

solr.search.function.ValueSource - > lucene.queries.function.ValueSource
solr.search.function.DocValues - > org.apache.lucene.queries.function.FunctionValues
lucene.index.IndexReader - > lucene.index.LeafReaderContext
lucene.search.Searcher - > lucene.search.IndexSearcher
lucene.queryParser.ParseException - > solr.search.SyntaxError

现在,当我尝试在SOLR中更新文档时,我能够编译插件但遇到异常(请参阅下面的日志)。知道如何使其发挥作用吗?

2016-03-09 20:49:28.584 ERROR (qtp1450821318-14) [   ] o.a.s.s.HttpSolrCall null:org.apache.solr.common.SolrException: SolrCore 'services' is not available due to init failure: Error loading class 'solr.XmlUpdateRequestHandler'
    at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:1066)
    at org.apache.solr.servlet.HttpSolrCall.init(HttpSolrCall.java:250)
    at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:412)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:225)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:183)

[更新] 发现上面的错误实际上是我的jar没有加载,这是放在server / solr / lib中,不知道为什么我已经在server / solr / solr.xml中添加了<str name="sharedLib">.lib</str>。无论如何,这是另一个问题,现在我把它移到了server / lib并加载了。但是我得到了错误java.lang.NoClassDefFoundError,如:

350825 ERROR (qtp434176574-15) [   ] o.a.s.s.HttpSolrCall An Error was wrapped in another exception - please report complete stacktrace on SOLR-6161
org.apache.solr.common.SolrException: SolrCore 'services' is not available due to init failure: org/apache/solr/search/ValueSourceParser
    at org.apache.solr.core.CoreContainer.getCore(CoreContainer.java:1066)
    at org.apache.solr.servlet.HttpSolrCall.init(HttpSolrCall.java:250)
    at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:412)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:225)
    at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:183)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:499)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: org/apache/solr/search/ValueSourceParser
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:820)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:658)
    at org.apache.solr.core.CoreContainer.create(CoreContainer.java:814)
    at org.apache.solr.core.CoreContainer.access$000(CoreContainer.java:87)
    at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:467)
    at org.apache.solr.core.CoreContainer$1.call(CoreContainer.java:458)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor$1.run(ExecutorUtil.java:231)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    ... 1 more
Caused by: java.lang.NoClassDefFoundError: org/apache/solr/search/ValueSourceParser
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:450)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:542)
    at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:489)
    at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:566)
    at org.apache.solr.core.PluginBag.createPlugin(PluginBag.java:121)
    at org.apache.solr.core.PluginBag.init(PluginBag.java:221)
    at org.apache.solr.core.PluginBag.init(PluginBag.java:210)
    at org.apache.solr.core.SolrCore.<init>(SolrCore.java:765)
    ... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.solr.search.ValueSourceParser
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 34 more

0 个答案:

没有答案