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 Parvin Gasimzade <pa...@gmail.com> on 2013/11/01 11:18:06 UTC

Custom Plugin exception : Plugin init failure for [schema.xml]

Hi all,

I have a problem with custom plugin development in solr 4.x versions. I
have developed custom filter and trying to install it but I got following
exception.

Schema xml :
    <fieldType name="text_tr" class="solr.TextField"
positionIncrementGap="100">
      <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.TurkishLowerCaseFilterFactory"/>
        <filter class="solr.StopFilterFactory" ignoreCase="false"
words="lang/stopwords_tr.txt" enablePositionIncrements="true"/>
        <filter class="my_package.TurkishFilterFactory"/>
      </analyzer>
    </fieldType>

Btw, I could not get any exception on 3.x versions. Any help will be
appreciated.

*Exception : *
org.apache.solr.common.SolrException: Plugin init failure for [schema.xml]
fieldType "text_tr": Plugin init failure for [schema.xml] analyzer/filter:
Error instantiating class: 'my_package.TurkishFilterFactory'
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:374)
at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:122)
at
org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:1018)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1051)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:634)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] analyzer/filter: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
at
org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:392)
at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:95)
at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:43)
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
... 14 more
Caused by: org.apache.solr.common.SolrException: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:473)
at
org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:89)
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
... 18 more
Caused by: java.lang.InstantiationException: my_package.TurkishFilterFactory
at java.lang.Class.newInstance(Class.java:359)
at
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:470)
... 20 more

Nov 01, 2013 11:59:27 AM org.apache.solr.common.SolrException log
SEVERE: null:org.apache.solr.common.SolrException: Unable to create core:
collection1
at
org.apache.solr.core.CoreContainer.recordAndThrow(CoreContainer.java:1672)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1057)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:634)
at org.apache.solr.core.CoreContainer$3.call(CoreContainer.java:629)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] fieldType "text_tr": Plugin init failure for [schema.xml]
analyzer/filter: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:374)
at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:122)
at
org.apache.solr.core.CoreContainer.createFromLocal(CoreContainer.java:1018)
at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1051)
... 10 more
Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] analyzer/filter: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:177)
at
org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:392)
at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:95)
at
org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:43)
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
... 14 more
Caused by: org.apache.solr.common.SolrException: Error instantiating class:
'my_package.TurkishFilterFactory'
at
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:473)
at
org.apache.solr.util.plugin.AbstractPluginLoader.create(AbstractPluginLoader.java:89)
at
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
... 18 more
Caused by: java.lang.InstantiationException: my_package.TurkishFilterFactory
at java.lang.Class.newInstance(Class.java:359)
at
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:470)
... 20 more

Thanks in advance.

Re: Custom Plugin exception : Plugin init failure for [schema.xml]

Posted by Parvin Gasimzade <pa...@gmail.com>.
Hi Shawn,

Thank you for your answer. I have solved the problem.

The problem is, in our code constructor of TurkishFilterFactory is setted
as protected and that works without problem on the 3.x versions of the Solr
but gives the exception that I mentioned here on 4.x versions. By analyzing
the stack trace I saw that it gives an InstantationException and by making
constructor public solves the problem.


On Fri, Nov 1, 2013 at 6:34 PM, Shawn Heisey <so...@elyograg.org> wrote:

> On 11/1/2013 4:18 AM, Parvin Gasimzade wrote:
> > I have a problem with custom plugin development in solr 4.x versions. I
> > have developed custom filter and trying to install it but I got following
> > exception.
>
> Later you indicated that you can use it with Solr 3.x without any problem.
>
> Did you recompile your custom plugin against the Solr jars from the new
> version?  There was a *huge* amount of java class refactoring that went
> into the 4.0 version as compared to any 3.x version, and that continues
> with each new 4.x release.
>
> I would bet that if you tried that recompile, it would fail due to
> errors and/or warnings, which you'll need to fix.  There might also be
> operational problems that the compiler doesn't find, due to changes in
> how the underlying APIs get used.
>
> Thanks,
> Shawn
>
>

Re: Custom Plugin exception : Plugin init failure for [schema.xml]

Posted by Shawn Heisey <so...@elyograg.org>.
On 11/1/2013 4:18 AM, Parvin Gasimzade wrote:
> I have a problem with custom plugin development in solr 4.x versions. I
> have developed custom filter and trying to install it but I got following
> exception.

Later you indicated that you can use it with Solr 3.x without any problem.

Did you recompile your custom plugin against the Solr jars from the new
version?  There was a *huge* amount of java class refactoring that went
into the 4.0 version as compared to any 3.x version, and that continues
with each new 4.x release.

I would bet that if you tried that recompile, it would fail due to
errors and/or warnings, which you'll need to fix.  There might also be
operational problems that the compiler doesn't find, due to changes in
how the underlying APIs get used.

Thanks,
Shawn