You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by kevin slote <ks...@gmail.com> on 2013/10/17 14:23:05 UTC

problem with embedded OLE attachments

Hi, I was trying to parse a word file with an embedded OLE attachment and I
got this error...


Caused by: java.lang.IllegalAccessError: tried to access method
org.apache.poi.POIDocument.<init>(Lorg/apache/poi/poifs/filesystem/DirectoryNode;)V
from class org.apache.tika.parser.microsoft.WordExtractor


I dug into the source code and noticed that most of the methods in
microsoft.WordExtractor are set to private or protected.

I was wondering if the folks on this list thought that could be the source
of the error.  It would make sense to me since the IllegalAccessError get's
thrown when two instances of the same class have been loaded by the class
loader in the jvm and the classes have been irreconcilably changed.  The
usual work around for this error is to set the methods in the class that is
causing the error to public.  But what does everyone else think?

Re: problem with embedded OLE attachments

Posted by kevin slote <ks...@gmail.com>.
Ok, I forgot to get rid of poi scratchpad and it worked without the errors.
 Is there a work though if I need to use poi elsewhere in my code?


On Thu, Oct 17, 2013 at 9:53 AM, kevin slote <ks...@gmail.com> wrote:

> I do.  But, when I deleted the jars from my classpath, I got the same
> error.
> Additionally, is there a work around if I needed to have poi in my program?
>
>
> On Thu, Oct 17, 2013 at 8:25 AM, Nick Burch <ap...@gagravarr.org> wrote:
>
>> On Thu, 17 Oct 2013, kevin slote wrote:
>>
>>> Hi, I was trying to parse a word file with an embedded OLE attachment
>>> and I got this error...
>>>
>>> Caused by: java.lang.IllegalAccessError: tried to access method
>>> org.apache.poi.POIDocument.<**init>(Lorg/apache/poi/poifs/**
>>> filesystem/DirectoryNode;)V
>>> from class org.apache.tika.parser.**microsoft.WordExtractor
>>>
>>
>> Most likely you have mis-matched jars on your classpath. You need to
>> ensure you have the same copy of POI that came with the version of Tika
>> that you're using, and don't have any other ones. I suspect you either are
>> using a different set of POI jars, or have two sets
>>
>> Nick
>>
>
>

Re: problem with embedded OLE attachments

Posted by kevin slote <ks...@gmail.com>.
Thanks,  that works!


On Thu, Oct 17, 2013 at 9:58 AM, Nick Burch <ap...@gagravarr.org> wrote:

> On Thu, 17 Oct 2013, kevin slote wrote:
>
>> I do.  But, when I deleted the jars from my classpath, I got the same
>> error.
>>
>
> You haven't got them all then. See the POI FAQ
> <http://poi.apache.org/faq.**html#faq-N10006<http://poi.apache.org/faq.html#faq-N10006>>
> for how to check what jar you're really using
>
>
>  Additionally, is there a work around if I needed to have poi in my
>> program?
>>
>
> Either use a custom classloader, or better yet just use the latest version
> of Tika which uses the latest version of POI, and have everything run
> against the most recent POI release
>
> Nick
>

Re: problem with embedded OLE attachments

Posted by Nick Burch <ap...@gagravarr.org>.
On Thu, 17 Oct 2013, kevin slote wrote:
> I do.  But, when I deleted the jars from my classpath, I got the same error.

You haven't got them all then. See the POI FAQ
<http://poi.apache.org/faq.html#faq-N10006> for how to check what jar 
you're really using

> Additionally, is there a work around if I needed to have poi in my program?

Either use a custom classloader, or better yet just use the latest version 
of Tika which uses the latest version of POI, and have everything run 
against the most recent POI release

Nick

Re: problem with embedded OLE attachments

Posted by kevin slote <ks...@gmail.com>.
I do.  But, when I deleted the jars from my classpath, I got the same error.
Additionally, is there a work around if I needed to have poi in my program?


On Thu, Oct 17, 2013 at 8:25 AM, Nick Burch <ap...@gagravarr.org> wrote:

> On Thu, 17 Oct 2013, kevin slote wrote:
>
>> Hi, I was trying to parse a word file with an embedded OLE attachment and
>> I got this error...
>>
>> Caused by: java.lang.IllegalAccessError: tried to access method
>> org.apache.poi.POIDocument.<**init>(Lorg/apache/poi/poifs/**
>> filesystem/DirectoryNode;)V
>> from class org.apache.tika.parser.**microsoft.WordExtractor
>>
>
> Most likely you have mis-matched jars on your classpath. You need to
> ensure you have the same copy of POI that came with the version of Tika
> that you're using, and don't have any other ones. I suspect you either are
> using a different set of POI jars, or have two sets
>
> Nick
>

Re: problem with embedded OLE attachments

Posted by Nick Burch <ap...@gagravarr.org>.
On Thu, 17 Oct 2013, kevin slote wrote:
> Hi, I was trying to parse a word file with an embedded OLE attachment 
> and I got this error...
>
> Caused by: java.lang.IllegalAccessError: tried to access method
> org.apache.poi.POIDocument.<init>(Lorg/apache/poi/poifs/filesystem/DirectoryNode;)V
> from class org.apache.tika.parser.microsoft.WordExtractor

Most likely you have mis-matched jars on your classpath. You need to 
ensure you have the same copy of POI that came with the version of Tika 
that you're using, and don't have any other ones. I suspect you either are 
using a different set of POI jars, or have two sets

Nick