Hi,

I have not used the ForkParser in an OSGi env before.  With OSGi the
classloader constructor approach will be a bit complex.  OSGi isolates
classloaders so depending on which classloader is passed from
ForkParser.class.getClassLoader() it may not have access to all the
parser classes it needs.  I would suggest trying a different approach by
using the

public ForkParser(Path 
<http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html?is-external=true>
 tikaBin,
                  ParserFactoryFactory 
<https://tika.apache.org/1.19/api/org/apache/tika/fork/ParserFactoryFactory.html>
 factoryFactory)

This constructor takes the OSGi classloader restrictions out and will
just use the ForkClient as a communication device.  The classes in the
forked tika server will load classes from the tika-app.jar in the
tikaBin directory [1].   Hopefully that gets you a bit further.

- Bob

[1]https://tika.apache.org/1.22/api/org/apache/tika/fork/ForkParser.html#ForkParser-java.nio.file.Path-org.apache.tika.fork.ParserFactoryFactory-



On 11/13/2019 3:22 PM, Tim Allison wrote:
> Paging Bob Paulin to the OSGi courtesy phone...
>
> On Wed, Nov 13, 2019 at 12:06 PM Katsuya Tomioka
> <katsuya.tomi...@gmail.com <mailto:katsuya.tomi...@gmail.com>> wrote:
>
>     I'd like to use ForkParser in OSGi with tika 1.22. The server
>     seems to start up, but I'd get ClassNotFound from
>     ClassLoaderProxy.java:119 soon as it tries to load anything  from
>     either tika-core or tika-parsers.
>
>     I'm creating a ForkParser by:
>         new ForkParser(ForkParser.class.getClassLoader(), parser);
>
>     where parser is an AutoDetectParser created with TikaConf.
>
>     Thanks,
>
>     -Katsuya
>

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to