[ 
https://issues.apache.org/jira/browse/SOLR-6643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hoss Man updated SOLR-6643:
---------------------------
    Summary: Core load silently aborted if missing schema has depenencies - 
LinkageErrors swollowed  (was: Core load silently aborted if missing 
depenencies)

I was able to reproduce Jan's steps, and then while trying again using core 
CREATE instead of relying on startup, was able to get an error returned to the 
client indicating the root cause of the problem...

{noformat}
java.lang.NoClassDefFoundError: com/ibm/icu/text/BreakIterator
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2663)
        at java.lang.Class.getConstructor0(Class.java:3067)
        at java.lang.Class.getConstructor(Class.java:1817)
        at 
org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:604)
        at 
org.apache.solr.schema.FieldTypePluginLoader$2.create(FieldTypePluginLoader.java:333)
        at 
org.apache.solr.schema.FieldTypePluginLoader$2.create(FieldTypePluginLoader.java:326)
        at 
org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:151)
{noformat}

...which kind of makes sense: nothing in the plugin architetcure does much in 
the way of "catching" LinkageError's like NoClassDefFoundError because in 
general trying ot catch Error's is usually a bad idea.

i think however that it would make sense for SolrResourceLoader to at least 
catch+log+rethrow any error from newInstance

that still leaves a second question however: the NoClassDefFoundError should 
(currently) be bubbling all the way up to the CoreContainer which should then 
be recording it as an init failure for the core -- but that isn't happening.  
why?

based on my testing, if a java.lang.Error is thrown during init of something 
like RequestHandler, then that gets properly tracked as a coreInitFailure -- 
but if something from the schema (ie: FieldType) throws a j.l.Error, that gets 
swallowed up.


> Core load silently aborted if missing schema has depenencies - LinkageErrors 
> swollowed
> --------------------------------------------------------------------------------------
>
>                 Key: SOLR-6643
>                 URL: https://issues.apache.org/jira/browse/SOLR-6643
>             Project: Solr
>          Issue Type: Bug
>          Components: Schema and Analysis
>    Affects Versions: 4.10.1
>            Reporter: Jan Høydahl
>            Priority: Minor
>              Labels: logging
>
> *How to reproduce*
> # Start with standard collection1 config
> # Add a field type to schema using the ICU contrib, no need for a field
> {code:XML}
> <fieldType name="text_icu" class="solr.TextField">
>   <analyzer><tokenizer class="solr.ICUTokenizerFactory"/></analyzer>
> </fieldType>
> {code}
> # {{cd example}}
> # {{mkdir solr/lib}}
> # {{cp ../contrib/analysis-extras/lucene-libs/lucene-analyzers-icu-4.10.1.jar 
> solr/lib/}}
> # {{bin/solr -f}}
> # Core is not loaded, and no messages in log after this line
> {code}
> ... INFO  org.apache.solr.schema.IndexSchema  – [collection1] Schema 
> name=example
> {code}
> Note that we did *not* add the dependency libs from {{analysis-extras/lib}}, 
> so we'd expect a {{ClassNotFoundException}}, but some way the initialization 
> of schema aborts silently. The ICUTokenizerFactory is instansiated by 
> reflection and I suspect that some exception is swallowed in 
> {{AbstractPluginLoader#create()}}



--
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