lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler (JIRA)" <>
Subject [jira] [Commented] (SOLR-5249) ClassNotFoundException due to white-spaces in solrconfig.xml
Date Wed, 18 Sep 2013 16:09:52 GMT


Uwe Schindler commented on SOLR-5249:

This is a bug in your XML editor: In your example, adding a line break inside an XML element
is *not* ignorable whitespace. Ignorable whitespace is only in so called mixed-content elements
(XML elements that contains TEXT and other elements, like XHTML), but a CDATA/TEXT xml element
with no other inner elements  is always treated by default as having only significant whitespace!
You my change this by adding xml:space attributes.

The fix is also not a good idea: Adding trim() on such a low level of parsing may fix this
bug, but may create new bugs. This is like if the JDK by itsself would do a trim() on e.g.
Class.forName()!!! So if we really want to support this, the parts parsing the XML has to
strip whitespace, not the resource loader! This also does not help for other things like file
names - which can indeed contain spaces! This is the reason why its important to *not* ignore
the whitespace.

I would like to fix this as not-a-problem.
> ClassNotFoundException due to white-spaces in solrconfig.xml
> ------------------------------------------------------------
>                 Key: SOLR-5249
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Simon Endele
>            Priority: Minor
>         Attachments:
>   Original Estimate: 1h
>  Remaining Estimate: 1h
> Due to auto-formatting by an text editor/IDE there may be line-breaks after class names
in the solrconfig.xml, for example:
> {code:xml}<searchComponent class="solr.SpellCheckComponent" name="suggest">
> 	<lst name="spellchecker">
> 		<str name="name">suggest</str>
> 		<str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
> 		<str name="lookupImpl">org.apache.solr.spelling.suggest.fst.WFSTLookupFactory
> 		</str>
> 		[...]
> 	</lst>
> </searchComponent>{code}
> This will raise an exception in SolrResourceLoader as the white-spaces are not stripped
from the class name:
> {code}Caused by: org.apache.solr.common.SolrException: Error loading class 'org.apache.solr.spelling.suggest.fst.WFSTLookupFactory
> 			'
> 	at org.apache.solr.core.SolrResourceLoader.findClass(
> 	at org.apache.solr.core.SolrResourceLoader.newInstance(
> 	at org.apache.solr.core.SolrResourceLoader.newInstance(
> 	at org.apache.solr.spelling.suggest.Suggester.init(
> 	at org.apache.solr.handler.component.SpellCheckComponent.inform(
> 	at org.apache.solr.core.SolrResourceLoader.inform(
> 	at org.apache.solr.core.SolrCore.<init>(
> 	... 13 more
> Caused by: java.lang.ClassNotFoundException: org.apache.solr.spelling.suggest.fst.WFSTLookupFactory
> 	at$
> 	at$
> 	at Method)
> 	at
> 	at java.lang.ClassLoader.loadClass(
> 	at
> 	at java.lang.ClassLoader.loadClass(
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(
> 	at org.apache.solr.core.SolrResourceLoader.findClass(
> 	... 19 more{code}

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message