[ 
https://issues.apache.org/jira/browse/SOLR-9751?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15657761#comment-15657761
 ] 

Steve Rowe commented on SOLR-9751:
----------------------------------

More complete stack trace:

{noformat}
Caused by: org.apache.solr.common.SolrException: Plugin init failure for 
[schema.xml] fieldType "preanalyzed": Cannot load analyzer: 
org.apache.solr.schema.PreAnalyzedField$PreAnalyzedAnalyzer
        at 
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:182)
        at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:491)
        ... 36 more
Caused by: org.apache.solr.common.SolrException: Cannot load analyzer: 
org.apache.solr.schema.PreAnalyzedField$PreAnalyzedAnalyzer
        at 
org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:287)
        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)
        ... 37 more
Caused by: java.lang.InstantiationException: 
org.apache.solr.schema.PreAnalyzedField$PreAnalyzedAnalyzer
        at java.lang.Class.newInstance(Class.java:427)
        at 
org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:271)
        ... 40 more
Caused by: java.lang.NoSuchMethodException: 
org.apache.solr.schema.PreAnalyzedField$PreAnalyzedAnalyzer.<init>()
        at java.lang.Class.getConstructor0(Class.java:3082)
        at java.lang.Class.newInstance(Class.java:412)
        ... 41 more
{noformat}

The (private) PreAnalyzedAnalyzer doesn't have a default ctor - its only ctor 
requires a parser param.

Note that this ^^ is not really the problem - the problem is that serialization 
is losing information (the query-time analysis chain) and instead including a 
built-in non-substitutable analyzer: PreAnalyzedField doesn't allow 
re-configuration of its index-time analysis chain.

> PreanalyzedField can cause schema corruption
> --------------------------------------------
>
>                 Key: SOLR-9751
>                 URL: https://issues.apache.org/jira/browse/SOLR-9751
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Schema and Analysis
>    Affects Versions: 6.2, 6.3
>            Reporter: liuyang
>            Assignee: Steve Rowe
>            Priority: Minor
>
> The exception as follows:
> Caused by: org.apache.solr.common.SolrException: Could not load conf for core 
> test_shard1_replica1: Can't load schema managed-schema: Plugin init failure 
> for [schema.xml] fieldType "preanalyzed": Cannot load analyzer: 
> org.apache.solr.schema.PreAnalyzedField$PreAnalyzedAnalyzer
>         at 
> org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:85)
>         at org.apache.solr.core.CoreContainer.create(CoreContainer.java:1031)
>         ... 6 more
> Caused by: org.apache.solr.common.SolrException: Can't load schema 
> managed-schema: Plugin init failure for [schema.xml] fieldType "preanalyzed": 
> Cannot load analyzer: 
> org.apache.solr.schema.PreAnalyzedField$PreAnalyzedAnalyzer
>         at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:600)
>         at org.apache.solr.schema.IndexSchema.<init>(IndexSchema.java:183)
>         at 
> org.apache.solr.schema.ManagedIndexSchema.<init>(ManagedIndexSchema.java:104)
>         at 
> org.apache.solr.schema.ManagedIndexSchemaFactory.create(ManagedIndexSchemaFactory.java:172)
>         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:107)
>         at 
> org.apache.solr.core.ConfigSetService.getConfig(ConfigSetService.java:78)
>         ... 7 more
> Test procedure:
> 1.create collection using sample_techproducts_configs;
> 2.add field in Solr web view;
> 3.add field again in Solr web view.
> manage-schema is modifyed as follows:
> <fieldType name="preanalyzed" class="solr.PreAnalyzedField">
>       <analyzer class=" 
> org.apache.solr.schema.PreAnalyzedField$PreAnalyzedAnalyzer">
>       </analyzer>
> </fieldType>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to