Hi!

We have developed a custom tokenizer for Solr 4.3. Our Solr Server is started 
as a war file inside of a java application using jetty. When the custom 
tokenizer is in the class path oft the enclosing java application Solr fails on 
startup. The error is ClassCastException ArabicLetterTokenizer which is a class 
we don't use in our system. We can put the custom tokenizer in the Solr 
classpath from any other location but it needs to reside in the classpath of  
the enclosing application due to the overall architecture of our system.

The solution to our problem was to manipulate Jettys class loading behaviour:

Server server = new org.eclipse.jetty.server.Server();
WebAppContext webapp = new WebAppContext();
webapp.setParentLoaderPriority(true);           // <-- this line
server.setHandler(webapp);
...

Using setParentLoaderPriority( true ) solved all our classpath problems. We 
didnt even have to use any oft the various methods to load the custom tokenizer 
in the Solr class path. My questions:

1) This method works too good and is too simple to implement, where is the 
drawback?
2) If there is no drawback why is it not mentioned in the Solr Doc in 
https://wiki.apache.org/solr/SolrPlugins ? 

Thank you very much Jan


Reply via email to