Unable to create collection with custom queryParser Plugin

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Unable to create collection with custom queryParser Plugin

Aroop Ganguly
Hi Team

I thought this was simple, but I am just missing something here. Any guidance would be very appreciated.

What have I done so far:
        1. I have created a custom querParser (class SamplePluggin extends QParserPlugin { ), which right now does nothing but logs an info message, and returns a new LuceneQParser() instance with the same parameters.
        2. I am on solr 7.5 and I have added the path to the jar and referenced the plugin in the following ways in my solrconfig.xml:

        <lib path="/Users/aroopganguly/libs/test-plugins-aroop-all.jar" />
        <queryParser name="sampleparser" class="com.aroop.plugins.SamplePluggin"/>

Now when I create a collection with this solrconfig, I keep getting this exception stack:
I have tried debugging the live solr instance and for the life of me, I cannot understand why am I getting this cast exception
2019-02-11 03:57:10.410 ERROR (qtp1594873248-62) [c:cvp2 s:shard1 r:core_node2 x:testCollection_shard1_replica_n1] o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: Error CREATEing SolrCore 'testCollection_shard1_replica_n1': Unable to create core [testCollection_shard1_replica_n1] Caused by: class com.aroop.plugins.SamplePluggin
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1087)
        at org.apache.solr.handler.admin.CoreAdminOperation.lambda$static$247(CoreAdminOperation.java:92)
        at org.apache.solr.handler.admin.CoreAdminOperation.execute(CoreAdminOperation.java:360)
        at org.apache.solr.handler.admin.CoreAdminHandler$CallInfo.call(CoreAdminHandler.java:395)
        at org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:180)
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:199)
        at org.apache.solr.servlet.HttpSolrCall.handleAdmin(HttpSolrCall.java:734)
        at org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:715)
        at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:496)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:377)
        at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:323)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.Server.handle(Server.java:531)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
        at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.solr.common.SolrException: Unable to create core [testCollection_shard1_replica_n1]
        at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1159)
        at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1048)
        ... 44 more
Caused by: org.apache.solr.common.SolrException: Error Instantiating queryParser, com.aroop.plugins.SamplePluggin failed to instantiate org.apache.solr.search.QParserPlugin
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:1014)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:869)
        at org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:1138)
        ... 45 more
Caused by: org.apache.solr.common.SolrException: Error Instantiating queryParser, com.aroop.plugins.SamplePluggin failed to instantiate org.apache.solr.search.QParserPlugin
        at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:813)
        at org.apache.solr.core.PluginBag.createPlugin(PluginBag.java:141)
        at org.apache.solr.core.PluginBag.init(PluginBag.java:277)
        at org.apache.solr.core.PluginBag.init(PluginBag.java:266)
        at org.apache.solr.core.SolrCore.<init>(SolrCore.java:963)
        ... 47 more
Caused by: java.lang.ClassCastException: class com.aroop.plugins.SamplePluggin
        at java.lang.Class.asSubclass(Class.java:3404)
        at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:541)
        at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:488)
        at org.apache.solr.core.SolrCore.createInstance(SolrCore.java:792)
        ... 51 more