You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tika.apache.org by Pavol Vanek <pa...@gmail.com> on 2012/04/26 14:28:45 UTC

java.lang.NoSuchFieldError detecting .xls files

Hi,
I get a java.lang.NoSuchFieldError: SMALLER_BIG_BLOCK_SIZE_DETAILS using
the Apache Tika 1.1 jar from http://tika.apache.org.
The source:

        try {
            File file = new File("c:\\tmp\\testSheet.xls");
            System.out.println(new Tika().detect(file));

        } catch (Exception e) {
            e.printStackTrace();
        }

Stack trace:

Exception in thread "main" java.lang.NoSuchFieldError:
SMALLER_BIG_BLOCK_SIZE_DETAILS
    at
org.apache.poi.poifs.filesystem.NPOIFSFileSystem.<init>(NPOIFSFileSystem.java:93)
    at
org.apache.poi.poifs.filesystem.NPOIFSFileSystem.<init>(NPOIFSFileSystem.java:190)
    at
org.apache.poi.poifs.filesystem.NPOIFSFileSystem.<init>(NPOIFSFileSystem.java:184)
    at
org.apache.tika.parser.microsoft.POIFSContainerDetector.getTopLevelNames(POIFSContainerDetector.java:338)
    at
org.apache.tika.parser.microsoft.POIFSContainerDetector.detect(POIFSContainerDetector.java:152)
    at
com.generali.fipos.persistence.dao.test.Dictionary.main(Dictionary.java:78)


When running:
        try {
            Metadata metadata = new Metadata();
            File file = new File("c:\\tmp\\testSheet.xls");
            TikaInputStream tis = TikaInputStream.get(file);

            MimeTypes mimeTypes =
TikaConfig.getDefaultConfig().getMimeRepository();
            MediaType mediaType = mimeTypes.detect(tis, metadata);
            System.out.println(mediaType.toString());

        } catch (Exception e) {
            e.printStackTrace();
        }

I get:  "application/x-tika-msoffice", but I'd like to know, what type of
msoffice document is inside the container. Am I not using
Tika correctly?

Thanks for any suggestions,
Pavol

Re: java.lang.NoSuchFieldError detecting .xls files

Posted by Pavol Vanek <pa...@gmail.com>.
Thanks. Everything works now with the newer Apache POI jar. :)

Pavol

On Thu, Apr 26, 2012 at 3:28 PM, Nick Burch <ni...@alfresco.com> wrote:

> On Thu, 26 Apr 2012, Pavol Vanek wrote:
>
>> I get a java.lang.NoSuchFieldError: SMALLER_BIG_BLOCK_SIZE_DETAILS using
>> the Apache Tika 1.1 jar from http://tika.apache.org.
>>
>
> You almost certainly have an older copy of Apache POI on your classpath.
> Tika needs a new copy of POI, and ships with one, but if you try to run
> with an old copy of POI things won't work
>
> Nick
>

Re: java.lang.NoSuchFieldError detecting .xls files

Posted by Nick Burch <ni...@alfresco.com>.
On Thu, 26 Apr 2012, Pavol Vanek wrote:
> I get a java.lang.NoSuchFieldError: SMALLER_BIG_BLOCK_SIZE_DETAILS using
> the Apache Tika 1.1 jar from http://tika.apache.org.

You almost certainly have an older copy of Apache POI on your classpath. 
Tika needs a new copy of POI, and ships with one, but if you try to run 
with an old copy of POI things won't work

Nick