You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Zahra Aminolroaya <z....@gmail.com> on 2018/08/18 10:16:33 UTC

Error with plugin in Solrcloud

My plugin works correctly in Solr. Now I want to have my plugin in solrCloud
mode:

I have a main jar file named "norm" and I have other jar files that my
"norm" is dependent on them:
"lucene-analyzers-common-6.6.1","lucene-core-6.6.1","slf4j-api-1.7.7","solr-core-6.6.1".

With the help of config and blob API, I transferred my libraries to .system
collection:


 {
        "id":"norm/1",
        "md5":"a4e068a60fb654d77cdb5f7d017bc1ec",
        "blobName":"norm",
        "version":1,
        "timestamp":"2018-07-04T06:07:36.799Z",
        "size":3377,
       
"blob":"UEsDBAoAAAgAABBX2UwAAAAAAAAAAAAAAAAJAAQATUVUQS1JTkYv/soAAFBLAwQKAAAIAAAPV9lMWXZiSjsBA
…………………………………….}

and I add these run time libraries to my collection, so my
configoverlay.json is like this:

{
  "props":{"updateHandler":{"autoSoftCommit":{"maxTime":3000}}},
  "runtimeLib":{
    "norm":{
      "name":"norm",
      "version":1},
    "slf":{
      "name":"slf",
      "version":1},
    "lucene":{
      "name":"lucene",
      "version":1},
    "lucene-ana":{
      "name":"lucene-ana",
      "version":1},
    "solr-core":{
      "name":"solr-core",
      "version":1}}}

I also added my filter to my field type:

 <fieldType name="text_general" class="solr.TextField"
positionIncrementGap="100" multiValued="false" runtimeLib="true">
    <analyzer type="index">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
      <filter class="solr.LowerCaseFilterFactory"/>
     <filter class="norm.myNormalizerFilterFactory" />
    </analyzer>
    <analyzer type="query">
      <tokenizer class="solr.StandardTokenizerFactory"/>
      <filter class="solr.StopFilterFactory" words="stopwords.txt"
ignoreCase="true"/>
      <filter class="solr.SynonymGraphFilterFactory" expand="true"
ignoreCase="true" synonyms="synonyms.txt"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    </analyzer>
  </fieldType>

however, I get class not found exception.

Is there anything else that I should do to have my plugin for solr cloud
mode?







--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Error with plugin in Solrcloud

Posted by Zahra Aminolroaya <z....@gmail.com>.
Thanks Shawn. I wrote my own filter. I attached my jar in hear.

I found your answer in hear: 


http://lucene.472066.n3.nabble.com/How-to-load-plugins-with-Solr-4-9-and-SolrCloud-td4312113.html

Based on your answer, is it possible that blob Api does not work for my own
filter jar?
  norm.jar <http://lucene.472066.n3.nabble.com/file/t493827/norm.jar>  



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Error with plugin in Solrcloud

Posted by Shawn Heisey <ap...@elyograg.org>.
On 8/18/2018 11:03 PM, Zahra Aminolroaya wrote:
> Thanks Shawn. For Solr mode I should include all dependencies in lib, so I
> thought for Solr Cloud mode I should include the dependencies too.

Even for standalone mode, you don't want those dependency jars in the 
lib folder.  The same problems can happen no matter what mode Solr is 
running in.

> Caused by: java.lang.RuntimeException: schema fieldtype
> text_general(org.apache.solr.schema.TextField) invalid
> arguments:{runtimeLib=true}

This is a different error than the one in your second message.  That one 
says it can't find the 'norm.myNormalizerFilterFactory' class.

I have no idea what needs to go into configoverlay.json. I've never 
actually used the config API.  So I do not know whether your config 
there is right or not.

The filter class that you're using strikes me as a little odd.  You've 
got norm.myNormalizerFilterFactory ... if the package line in the .java 
file is just "norm" then that part would be OK. If it's something else, 
then you need to use the entire package name.  The class name 
myNormalizerFilterFactory doesn't follow normal Java convention and 
start with an uppercase letter.  Is this the actual class name in the 
.java file?  If you share a full file listing from the jar (which is a 
zipfile) then I can tell you what your class name should be.

The classes typically used in a schema do start with "solr." which might 
seem like an incomplete package name is acceptablwe.  Solr handles this 
special prefix by checking a number of different packages for the class.

Thanks,
Shawn


Re: Error with plugin in Solrcloud

Posted by Zahra Aminolroaya <z....@gmail.com>.
Thanks Shawn. For Solr mode I should include all dependencies in lib, so I
thought for Solr Cloud mode I should include the dependencies too.


The error is as follows:


java.util.concurrent.ExecutionException:
org.apache.solr.common.SolrException: Unable to create core
[gettingstarted_shard1_replica2]
	at java.util.concurrent.FutureTask.report(Unknown Source)
	at java.util.concurrent.FutureTask.get(Unknown Source)
	at org.apache.solr.core.CoreContainer.lambda$load$6(CoreContainer.java:592)
	at
com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run(InstrumentedExecutorService.java:176)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at
org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0(ExecutorUtil.java:229)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.solr.common.SolrException: Unable to create core
[gettingstarted_shard1_replica2]
	at
org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:938)
	at org.apache.solr.core.CoreContainer.lambda$load$5(CoreContainer.java:564)
	at
com.codahale.metrics.InstrumentedExecutorService$InstrumentedCallable.call(InstrumentedExecutorService.java:197)
	... 5 more
Caused by: org.apache.solr.common.SolrException: Could not load conf for
core gettingstarted_shard1_replica2: Can't load schema managed-schema:
Plugin Initializing failure for [schema.xml] fieldType
	at
org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:97)
	at
org.apache.solr.core.CoreContainer.createFromDescriptor(CoreContainer.java:918)
	... 7 more
Caused by: org.apache.solr.common.SolrException: Can't load schema
managed-schema: Plugin Initializing failure for [schema.xml] fieldType
	at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:608)
	at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:182)
	at
org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:104)
	at
org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:173)
	at
org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:45)
	at
org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:75)
	at
org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:119)
	at
org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:92)
	... 8 more
Caused by: org.apache.solr.common.SolrException: Plugin Initializing failure
for [schema.xml] fieldType
	at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:194)
	at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:494)
	... 15 more
Caused by: java.lang.RuntimeException: schema fieldtype
text_general(org.apache.solr.schema.TextField) invalid
arguments:{runtimeLib=true}
	at org.apache.solr.schema.FieldType.setArgs(FieldType.java:207)
	at
org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:165)
	at
org.apache.solr.schema.FieldTypePluginLoader.init(FieldTypePluginLoader.java:53)
	at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:191)
	... 16 more



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Error with plugin in Solrcloud

Posted by Zahra Aminolroaya <z....@gmail.com>.
Thanks Shawn. For Solr mode I should include all dependencies in lib, so I
thought for Solr Cloud mode I should include the dependencies too.


The error is as follows:
 



Caused by: org.apache.solr.common.SolrException: Unable to reload core
[textd_shard1_replica2]
	at org.apache.solr.core.CoreContainer.reload(CoreContainer.java:1161)
	at
org.apache.solr.handler.admin.CoreAdminOperation.lambda$static$2(CoreAdminOperation.java:111)
	... 36 more
Caused by: org.apache.solr.common.SolrException: Could not load conf for
core textd_shard1_replica2: Can't load schema managed-schema: Plugin init
failure for [schema.xml] fieldType "text_general": Plugin init failure for
[schema.xml] analyzer/filter: Error loading class
'norm.myNormalizerFilterFactory'
	at
org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:97)
	at org.apache.solr.core.CoreContainer.reload(CoreContainer.java:1153)
	... 37 more
Caused by: org.apache.solr.common.SolrException: Can't load schema
managed-schema: Plugin init failure for [schema.xml] fieldType
"text_general": Plugin init failure for [schema.xml] analyzer/filter: Error
loading class 'norm.myNormalizerFilterFactory'
	at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:608)
	at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:182)
	at
org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:104)
	at
org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:173)
	at
org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:45)
	at
org.apache.solr.schema.IndexSchemaFactory.buildIndexSchema(IndexSchemaFactory.java:75)
	at
org.apache.solr.core.ConfigSetService.createIndexSchema(ConfigSetService.java:119)
	at
org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:92)
	... 38 more
Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] fieldType "text_general": Plugin init failure for [schema.xml]
analyzer/filter: Error loading class 'norm.myNormalizerFilterFactory'
	at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:182)
	at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:494)
	... 45 more
Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] analyzer/filter: Error loading class
'norm.myNormalizerFilterFactory'
	at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:182)
	at
org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:414)
	at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:104)
	at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:53)
	at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:152)
	... 46 more
Caused by: org.apache.solr.common.SolrException: Error loading class
'norm.myNormalizerFilterFactory'
	at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:555)
	at
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:624)
	at
org.apache.solr.schema.FieldTypePluginLoader$3.create(FieldTypePluginLoader.java:397)
	at
org.apache.solr.schema.FieldTypePluginLoader$3.create(FieldTypePluginLoader.java:390)
	at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:152)
	... 50 more
Caused by: java.lang.ClassNotFoundException: norm.myNormalizerFilterFactory
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.net.FactoryURLClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Unknown Source)
	at
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:539)
	... 54 more



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Error with plugin in Solrcloud

Posted by Shawn Heisey <ap...@elyograg.org>.
On 8/18/2018 4:16 AM, Zahra Aminolroaya wrote:
> My plugin works correctly in Solr. Now I want to have my plugin in solrCloud
> mode:
>
> I have a main jar file named "norm" and I have other jar files that my
> "norm" is dependent on them:
> "lucene-analyzers-common-6.6.1","lucene-core-6.6.1","slf4j-api-1.7.7","solr-core-6.6.1".

All of these dependencies are *already* included in Solr. If you include 
them again, you can expect ClassNotFoundException on the classes they 
contain.  This is a well-known java classloader problem.

You only want to add your jar, not the dependencies.

> however, I get class not found exception.

Can you include the entire error message and stacktrace? Is the Solr 
version 6.6.1 or something else?

Thanks,
Shawn