Hi,

I attached a patch to LUCENE-4713 that works around the context class loader 
issue, by also always scanning the classloader that loaded the lucene library 
(in fact the classloader that loaded the abstract base class of the SPI/codec). 
The context class loader is also scanned to collect any other additional SPIs 
that may be found.

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [email protected]


> -----Original Message-----
> From: Uwe Schindler [mailto:[email protected]]
> Sent: Tuesday, March 12, 2013 9:54 AM
> To: [email protected]
> Subject: RE: LUCENE-4713
> 
> 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: [email protected]
> 
> 
> > -----Original Message-----
> > From: Darren Hoffman [mailto:[email protected]]
> > Sent: Tuesday, March 12, 2013 6:57 AM
> > To: [email protected]
> > 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: [email protected]
> For additional commands, e-mail: [email protected]


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

Reply via email to