You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shawn Heisey (JIRA)" <ji...@apache.org> on 2015/07/10 04:16:04 UTC

[jira] [Commented] (SOLR-7771) Classloader problem with "solr.XXX" class names and jars in SOLR_HOME/lib

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

Shawn Heisey commented on SOLR-7771:
------------------------------------

This is the first part of the solr log during the startup with the errors:

{noformat}
INFO  - 2015-07-10 02:11:12.626; [   ] org.eclipse.jetty.util.log.Log; Logging initialized @216ms
INFO  - 2015-07-10 02:11:12.745; [   ] org.eclipse.jetty.server.Server; jetty-9.2.10.v20150310
WARN  - 2015-07-10 02:11:12.756; [   ] org.eclipse.jetty.server.handler.RequestLogHandler; !RequestLog
INFO  - 2015-07-10 02:11:12.757; [   ] org.eclipse.jetty.deploy.providers.ScanningAppProvider; Deployment monitor [file:/C:/Users/elyograg/Downloads/solr-5.2.1/server/contexts/] at interval 0
INFO  - 2015-07-10 02:11:13.219; [   ] org.eclipse.jetty.webapp.StandardDescriptorProcessor; NO JSP Support for /solr, did not find org.apache.jasper.servlet.JspServlet
WARN  - 2015-07-10 02:11:13.237; [   ] org.eclipse.jetty.security.ConstraintSecurityHandler; ServletContext@o.e.j.w.WebAppContext@457e2f02{/solr,file:/C:/Users/elyograg/Downloads/solr-5.2.1/server/solr-webapp/webapp/,STARTING}{/solr.war} has uncovered http methods for path: /
INFO  - 2015-07-10 02:11:13.258; [   ] org.apache.solr.servlet.SolrDispatchFilter; SolrDispatchFilter.init()WebAppClassLoader=1582797472@5e5792a0
INFO  - 2015-07-10 02:11:13.268; [   ] org.apache.solr.core.SolrResourceLoader; JNDI not configured for solr (NoInitialContextEx)
INFO  - 2015-07-10 02:11:13.269; [   ] org.apache.solr.core.SolrResourceLoader; using system property solr.solr.home: C:\Users\elyograg\Downloads\solr-5.2.1\server\solr
INFO  - 2015-07-10 02:11:13.269; [   ] org.apache.solr.core.SolrResourceLoader; new SolrResourceLoader for directory: 'C:\Users\elyograg\Downloads\solr-5.2.1\server\solr\'
INFO  - 2015-07-10 02:11:13.270; [   ] org.apache.solr.core.SolrResourceLoader; Adding 'file:/C:/Users/elyograg/Downloads/solr-5.2.1/server/solr/lib/icu4j-54.1.jar' to classloader
INFO  - 2015-07-10 02:11:13.271; [   ] org.apache.solr.core.SolrResourceLoader; Adding 'file:/C:/Users/elyograg/Downloads/solr-5.2.1/server/solr/lib/lucene-analyzers-icu-5.2.1.jar' to classloader
INFO  - 2015-07-10 02:11:13.381; [   ] org.apache.solr.core.SolrXmlConfig; Loading container configuration from C:\Users\elyograg\Downloads\solr-5.2.1\server\solr\solr.xml
INFO  - 2015-07-10 02:11:13.431; [   ] org.apache.solr.core.CorePropertiesLocator; Config-defined core root directory: C:\Users\elyograg\Downloads\solr-5.2.1\server\solr
INFO  - 2015-07-10 02:11:13.447; [   ] org.apache.solr.core.CoreContainer; New CoreContainer 1362728240
INFO  - 2015-07-10 02:11:13.448; [   ] org.apache.solr.core.CoreContainer; Loading cores into CoreContainer [instanceDir=C:\Users\elyograg\Downloads\solr-5.2.1\server\solr\]
INFO  - 2015-07-10 02:11:13.449; [   ] org.apache.solr.core.CoreContainer; loading shared library: C:\Users\elyograg\Downloads\solr-5.2.1\server\solr\lib
INFO  - 2015-07-10 02:11:13.449; [   ] org.apache.solr.core.SolrResourceLoader; Adding 'file:/C:/Users/elyograg/Downloads/solr-5.2.1/server/solr/lib/icu4j-54.1.jar' to classloader
INFO  - 2015-07-10 02:11:13.450; [   ] org.apache.solr.core.SolrResourceLoader; Adding 'file:/C:/Users/elyograg/Downloads/solr-5.2.1/server/solr/lib/lucene-analyzers-icu-5.2.1.jar' to classloader
{noformat}

In it you can see the two jars being loaded twice, both times from the newly created lib directory.

> Classloader problem with "solr.XXX" class names and jars in SOLR_HOME/lib
> -------------------------------------------------------------------------
>
>                 Key: SOLR-7771
>                 URL: https://issues.apache.org/jira/browse/SOLR-7771
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 5.2.1
>         Environment: C:\Users\elyograg\Downloads\solr-5.2.1>java -version
> java version "1.8.0_45"
> Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
> Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
>            Reporter: Shawn Heisey
>
> Jars placed in SOLR_HOME/lib seem to be loaded twice, which causes problems trying to use solr.XXXXXX class names in schema.xml.
> If the full class name is used, it works.
> Steps to recreate on an extracted Solr 5.2.1 download.  This was done on Windows, so I used backslashes as path separators:
> {noformat}
> bin\solr start
> bin\solr create -c foo -d sample_techproducts_configs
> bin\solr stop -all
> {noformat}
> Add the following to server\foo\conf\schema.xml, just before the </schema> end tag:
> {noformat}
>     <fieldType name="icu_test" class="solr.TextField">
>       <analyzer> 
>         <tokenizer class="solr.ICUTokenizerFactory"/>
>       </analyzer>
>     </fieldType>
> {noformat}
> Create a new directory -- server\solr\lib.
> Copy icu4j-54.1.jar and lucene-analyzers-icu-5.2.1.jar from contrib\analysis-extras to server\solr\lib.
> {noformat}
> bin\solr start
> {noformat}
> Note an exception in the logging tab:
> java.lang.NoClassDefFoundError: org/apache/lucene/analysis/icu/segmentation/ICUTokenizer
> At this point, if the class name is changed from solr.ICUTokenizerFactory to org.apache.lucene.analysis.icu.segmentation.ICUTokenizerFactory and solr is stopped and started, then everything is OK.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org