Use:
Codecs.reloadCodecs(yourClassloader) in your application initialization code. 
yourClassloader can be e.g. this.getClass().getClassLoader().
The same method exists for PostingsFormats, unfortunately there is no method to 
automatically reload all SPIs in Lucene.

The most correct fix would be to tell your application server to use the 
context class loader. The same issue exists with all SPIs Java might use (like 
XML parsers externally from the JDK are not found), so J2EE recommends to set 
the context class loader on application startup before you create any threads. 
Servlet containers like Tomcat or Jetty do this automatically.

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de


> -----Original Message-----
> From: Darren Hoffman [mailto:dar...@prosoundcanada.com]
> Sent: Tuesday, March 12, 2013 6:57 AM
> To: java-user@lucene.apache.org
> Subject: LUCENE-4713
> 
> I am having the same experience as issue LUCENE-4713.
> 
> Without modifying the source code myself, how do I overcome this? I am in
> the middle of migrating from 3.6 to 4.2 and I am unable to index or search.
> 
> From the source code, I see there is a setter for a codec but there's not a
> constructor that accepts a codec. The exception is being thrown when I try to
> instantiate IndexWriterConfig.
> 
> Thank you,
> Darren Hoffman
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to