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

Robert Muir commented on SOLR-5249:
-----------------------------------

In addition to what Uwe says:

The resourceloader also has many other cases, and this patch would only fix one.

for example, if the class is not found it tries some special stuff like 
supporting shorthand solr.xxx and so on. I am sure there are many many cases...

                
> ClassNotFoundException due to white-spaces in solrconfig.xml
> ------------------------------------------------------------
>
>                 Key: SOLR-5249
>                 URL: https://issues.apache.org/jira/browse/SOLR-5249
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Simon Endele
>            Priority: Minor
>         Attachments: SolrResourceLoader.java.patch
>
>   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(SolrResourceLoader.java:449)
>       at 
> org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:471)
>       at 
> org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:467)
>       at org.apache.solr.spelling.suggest.Suggester.init(Suggester.java:102)
>       at 
> org.apache.solr.handler.component.SpellCheckComponent.inform(SpellCheckComponent.java:623)
>       at 
> org.apache.solr.core.SolrResourceLoader.inform(SolrResourceLoader.java:601)
>       at org.apache.solr.core.SolrCore.<init>(SolrCore.java:830)
>       ... 13 more
> Caused by: java.lang.ClassNotFoundException: 
> org.apache.solr.spelling.suggest.fst.WFSTLookupFactory
>                       
>       at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
>       at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
>       at java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:789)
>       at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
>       at java.lang.Class.forName0(Native Method)
>       at java.lang.Class.forName(Class.java:264)
>       at 
> org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:433)
>       ... 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: http://www.atlassian.com/software/jira

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

Reply via email to