You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tika.apache.org by Gerardo Hernandez <g....@aparavi.com> on 2024/04/03 06:55:57 UTC

AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

Hello,

We are trying to upgrade Tika library within our project, currently we are working on version 2.7.0 which works as expected but after moving to any higher version (2.8.0, 2.9.0, 2.9.1 & 2.9.2) the library no longer works, specifically AutoDetectParser class.

I've attached a minimal reproducible setup, which just creates a parser (AutoDetectParser), prints all its available parsers, and then tries to parse the file specified as the second parameter in the cmd.

On 2.7.0, I get a list of 203 parsers, and the file is parser successfully:

[cid:5d8e5da2-0110-4c4f-a714-48594cef2737][cid:762f293c-19c2-4a55-8645-f290abffa8c6]

While on 2.8.0+ I get an empty list of parsers and no file content is retrieved.

[cid:f0499321-6503-46db-88c5-5b07358229b2]

Please let me know if you have any ideas on what could be causing this behavior and/or if there is anything I'm missing on the pom file or maybe some incompatibility with the maven/java version we are using.

Platform: Windows 11 Version 10.0.22631 Build 22631 (Amd64)
Java version: 17.0.7, Vendor: Eclipse Adoptium
Maven version: 3.6.3 cecedd343002696d0abb50b32b541b8a6ba2883f

Best regards,
Gerardo

Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

Posted by Gerardo Hernandez <g....@aparavi.com>.
Hi Tim,

I think that the issue might be related to the assembly step, this is how I'm reproducing it (files attached in the first email TikaUpgrade.rar):

mvn clean compile assembly:single
java -cp "target\tika-1.0.0-jar-with-dependencies.jar" com.company.tikatest.TikaTest path/to/lorem.txt

Is there anything weird or missing on the assembly goal that could cause the dependecy tika-parsers-standard-package not to import all the parsers properly?
I also found this report https://issues.apache.org/jira/browse/TIKA-4038 which I think is related, but I'm not 100% sure.

Best regards,
Gerardo
________________________________
From: Tim Allison <ta...@apache.org>
Sent: Thursday, April 4, 2024 06:22 AM
To: user@tika.apache.org <us...@tika.apache.org>
Subject: Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

I'm on ubuntu. That's the 2.7.0 pom, obv. I just bumped the versions,
reloaded and ran to see different numbers of parsers in 2.7.0 vs
2.8.0+2.9.0.

On Thu, Apr 4, 2024 at 8:20 AM Tim Allison <ta...@apache.org> wrote:
>
> I'm attaching the pom. I can't remember if attachments get stripped.
> If they do, I'll copy+paste.
>
> Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
> temurin-17-jdk-amd64
>
> On Thu, Apr 4, 2024 at 3:16 AM Gerardo Hernandez
> <g....@aparavi.com> wrote:
> >
> > Hi Tim,
> >
> > Did you use the exact same pom I shared, or a custom one? If the second, could you please share it so I can verify if something missing on mine.
> >
> > Also, what jdk/maven versions are you using?
> >
> > Tilman, I get the expected string when printing System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD); on both 2.7.0 and 2.8.0+
> >
> > Thanks, and regards,
> > Gerardo
> > ________________________________
> > From: Tim Allison <ta...@apache.org>
> > Sent: Wednesday, April 3, 2024 06:43 AM
> > To: user@tika.apache.org <us...@tika.apache.org>
> > Subject: Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+
> >
> > Y, I'm not able to repro this problem with 2.8.0 or higher. I'm seeing
> > 239 parsers (probably diff from Tilman because of installed external
> > parsers?).
> >
> > On Wed, Apr 3, 2024 at 5:09 AM Tilman Hausherr <TH...@t-online.de> wrote:
> > >
> > > On 03.04.2024 08:55, Gerardo Hernandez wrote:
> > > > On 2.7.0, I get a list of 203 parsers, and the file is parser
> > > > successfully:
> > >
> > > I get 227 parsers with 2.9.2. My pom.xml is somewhat different. The main
> > > part is
> > >
> > >
> > >      <dependencies>
> > >          <dependency>
> > >              <groupId>org.apache.tika</groupId>
> > >              <artifactId>tika-core</artifactId>
> > >              <version>${tika.version}</version>
> > >          </dependency>
> > >          <dependency>
> > >              <groupId>org.apache.tika</groupId>
> > > <artifactId>tika-parsers-standard-package</artifactId>
> > >              <version>${tika.version}</version>
> > >          </dependency>
> > >          <dependency>
> > >              <groupId>org.slf4j</groupId>
> > >              <artifactId>slf4j-simple</artifactId>
> > >              <version>${slf4j.version}</version>
> > >          </dependency>
> > >          <dependency>
> > >              <groupId>org.bouncycastle</groupId>
> > >              <artifactId>bcprov-jdk18on</artifactId>
> > >              <version>${bouncycastle.version}</version>
> > >          </dependency>
> > >      </dependencies>
> > >
> > > What happens if you add this on top of your code?
> > >
> > > System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD);
> > >
> > > it should output "org.apache.tika.parser.pdf.password". This is to test
> > > if the PDF parser is in your class path.
> > >
> > > Tilman
> > >

Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

Posted by Tim Allison <ta...@apache.org>.
I'm on ubuntu. That's the 2.7.0 pom, obv. I just bumped the versions,
reloaded and ran to see different numbers of parsers in 2.7.0 vs
2.8.0+2.9.0.

On Thu, Apr 4, 2024 at 8:20 AM Tim Allison <ta...@apache.org> wrote:
>
> I'm attaching the pom. I can't remember if attachments get stripped.
> If they do, I'll copy+paste.
>
> Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
> temurin-17-jdk-amd64
>
> On Thu, Apr 4, 2024 at 3:16 AM Gerardo Hernandez
> <g....@aparavi.com> wrote:
> >
> > Hi Tim,
> >
> > Did you use the exact same pom I shared, or a custom one? If the second, could you please share it so I can verify if something missing on mine.
> >
> > Also, what jdk/maven versions are you using?
> >
> > Tilman, I get the expected string when printing System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD); on both 2.7.0 and 2.8.0+
> >
> > Thanks, and regards,
> > Gerardo
> > ________________________________
> > From: Tim Allison <ta...@apache.org>
> > Sent: Wednesday, April 3, 2024 06:43 AM
> > To: user@tika.apache.org <us...@tika.apache.org>
> > Subject: Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+
> >
> > Y, I'm not able to repro this problem with 2.8.0 or higher. I'm seeing
> > 239 parsers (probably diff from Tilman because of installed external
> > parsers?).
> >
> > On Wed, Apr 3, 2024 at 5:09 AM Tilman Hausherr <TH...@t-online.de> wrote:
> > >
> > > On 03.04.2024 08:55, Gerardo Hernandez wrote:
> > > > On 2.7.0, I get a list of 203 parsers, and the file is parser
> > > > successfully:
> > >
> > > I get 227 parsers with 2.9.2. My pom.xml is somewhat different. The main
> > > part is
> > >
> > >
> > >      <dependencies>
> > >          <dependency>
> > >              <groupId>org.apache.tika</groupId>
> > >              <artifactId>tika-core</artifactId>
> > >              <version>${tika.version}</version>
> > >          </dependency>
> > >          <dependency>
> > >              <groupId>org.apache.tika</groupId>
> > > <artifactId>tika-parsers-standard-package</artifactId>
> > >              <version>${tika.version}</version>
> > >          </dependency>
> > >          <dependency>
> > >              <groupId>org.slf4j</groupId>
> > >              <artifactId>slf4j-simple</artifactId>
> > >              <version>${slf4j.version}</version>
> > >          </dependency>
> > >          <dependency>
> > >              <groupId>org.bouncycastle</groupId>
> > >              <artifactId>bcprov-jdk18on</artifactId>
> > >              <version>${bouncycastle.version}</version>
> > >          </dependency>
> > >      </dependencies>
> > >
> > > What happens if you add this on top of your code?
> > >
> > > System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD);
> > >
> > > it should output "org.apache.tika.parser.pdf.password". This is to test
> > > if the PDF parser is in your class path.
> > >
> > > Tilman
> > >

Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

Posted by Tim Allison <ta...@apache.org>.
I'm attaching the pom. I can't remember if attachments get stripped.
If they do, I'll copy+paste.

Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
temurin-17-jdk-amd64

On Thu, Apr 4, 2024 at 3:16 AM Gerardo Hernandez
<g....@aparavi.com> wrote:
>
> Hi Tim,
>
> Did you use the exact same pom I shared, or a custom one? If the second, could you please share it so I can verify if something missing on mine.
>
> Also, what jdk/maven versions are you using?
>
> Tilman, I get the expected string when printing System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD); on both 2.7.0 and 2.8.0+
>
> Thanks, and regards,
> Gerardo
> ________________________________
> From: Tim Allison <ta...@apache.org>
> Sent: Wednesday, April 3, 2024 06:43 AM
> To: user@tika.apache.org <us...@tika.apache.org>
> Subject: Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+
>
> Y, I'm not able to repro this problem with 2.8.0 or higher. I'm seeing
> 239 parsers (probably diff from Tilman because of installed external
> parsers?).
>
> On Wed, Apr 3, 2024 at 5:09 AM Tilman Hausherr <TH...@t-online.de> wrote:
> >
> > On 03.04.2024 08:55, Gerardo Hernandez wrote:
> > > On 2.7.0, I get a list of 203 parsers, and the file is parser
> > > successfully:
> >
> > I get 227 parsers with 2.9.2. My pom.xml is somewhat different. The main
> > part is
> >
> >
> >      <dependencies>
> >          <dependency>
> >              <groupId>org.apache.tika</groupId>
> >              <artifactId>tika-core</artifactId>
> >              <version>${tika.version}</version>
> >          </dependency>
> >          <dependency>
> >              <groupId>org.apache.tika</groupId>
> > <artifactId>tika-parsers-standard-package</artifactId>
> >              <version>${tika.version}</version>
> >          </dependency>
> >          <dependency>
> >              <groupId>org.slf4j</groupId>
> >              <artifactId>slf4j-simple</artifactId>
> >              <version>${slf4j.version}</version>
> >          </dependency>
> >          <dependency>
> >              <groupId>org.bouncycastle</groupId>
> >              <artifactId>bcprov-jdk18on</artifactId>
> >              <version>${bouncycastle.version}</version>
> >          </dependency>
> >      </dependencies>
> >
> > What happens if you add this on top of your code?
> >
> > System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD);
> >
> > it should output "org.apache.tika.parser.pdf.password". This is to test
> > if the PDF parser is in your class path.
> >
> > Tilman
> >

Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

Posted by Gerardo Hernandez <g....@aparavi.com>.
Hi Tim,

Did you use the exact same pom I shared, or a custom one? If the second, could you please share it so I can verify if something missing on mine.

Also, what jdk/maven versions are you using?

Tilman, I get the expected string when printing System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD); on both 2.7.0 and 2.8.0+

Thanks, and regards,
Gerardo
________________________________
From: Tim Allison <ta...@apache.org>
Sent: Wednesday, April 3, 2024 06:43 AM
To: user@tika.apache.org <us...@tika.apache.org>
Subject: Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

Y, I'm not able to repro this problem with 2.8.0 or higher. I'm seeing
239 parsers (probably diff from Tilman because of installed external
parsers?).

On Wed, Apr 3, 2024 at 5:09 AM Tilman Hausherr <TH...@t-online.de> wrote:
>
> On 03.04.2024 08:55, Gerardo Hernandez wrote:
> > On 2.7.0, I get a list of 203 parsers, and the file is parser
> > successfully:
>
> I get 227 parsers with 2.9.2. My pom.xml is somewhat different. The main
> part is
>
>
>      <dependencies>
>          <dependency>
>              <groupId>org.apache.tika</groupId>
>              <artifactId>tika-core</artifactId>
>              <version>${tika.version}</version>
>          </dependency>
>          <dependency>
>              <groupId>org.apache.tika</groupId>
> <artifactId>tika-parsers-standard-package</artifactId>
>              <version>${tika.version}</version>
>          </dependency>
>          <dependency>
>              <groupId>org.slf4j</groupId>
>              <artifactId>slf4j-simple</artifactId>
>              <version>${slf4j.version}</version>
>          </dependency>
>          <dependency>
>              <groupId>org.bouncycastle</groupId>
>              <artifactId>bcprov-jdk18on</artifactId>
>              <version>${bouncycastle.version}</version>
>          </dependency>
>      </dependencies>
>
> What happens if you add this on top of your code?
>
> System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD);
>
> it should output "org.apache.tika.parser.pdf.password". This is to test
> if the PDF parser is in your class path.
>
> Tilman
>

Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

Posted by Tim Allison <ta...@apache.org>.
Y, I'm not able to repro this problem with 2.8.0 or higher. I'm seeing
239 parsers (probably diff from Tilman because of installed external
parsers?).

On Wed, Apr 3, 2024 at 5:09 AM Tilman Hausherr <TH...@t-online.de> wrote:
>
> On 03.04.2024 08:55, Gerardo Hernandez wrote:
> > On 2.7.0, I get a list of 203 parsers, and the file is parser
> > successfully:
>
> I get 227 parsers with 2.9.2. My pom.xml is somewhat different. The main
> part is
>
>
>      <dependencies>
>          <dependency>
>              <groupId>org.apache.tika</groupId>
>              <artifactId>tika-core</artifactId>
>              <version>${tika.version}</version>
>          </dependency>
>          <dependency>
>              <groupId>org.apache.tika</groupId>
> <artifactId>tika-parsers-standard-package</artifactId>
>              <version>${tika.version}</version>
>          </dependency>
>          <dependency>
>              <groupId>org.slf4j</groupId>
>              <artifactId>slf4j-simple</artifactId>
>              <version>${slf4j.version}</version>
>          </dependency>
>          <dependency>
>              <groupId>org.bouncycastle</groupId>
>              <artifactId>bcprov-jdk18on</artifactId>
>              <version>${bouncycastle.version}</version>
>          </dependency>
>      </dependencies>
>
> What happens if you add this on top of your code?
>
> System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD);
>
> it should output "org.apache.tika.parser.pdf.password". This is to test
> if the PDF parser is in your class path.
>
> Tilman
>

Re: AutoDetectParser not working after upgrading from 2.7.0 to 2.8.0+

Posted by Tilman Hausherr <TH...@t-online.de>.
On 03.04.2024 08:55, Gerardo Hernandez wrote:
> On 2.7.0, I get a list of 203 parsers, and the file is parser 
> successfully:

I get 227 parsers with 2.9.2. My pom.xml is somewhat different. The main 
part is


     <dependencies>
         <dependency>
             <groupId>org.apache.tika</groupId>
             <artifactId>tika-core</artifactId>
             <version>${tika.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.tika</groupId>
<artifactId>tika-parsers-standard-package</artifactId>
             <version>${tika.version}</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-simple</artifactId>
             <version>${slf4j.version}</version>
         </dependency>
         <dependency>
             <groupId>org.bouncycastle</groupId>
             <artifactId>bcprov-jdk18on</artifactId>
             <version>${bouncycastle.version}</version>
         </dependency>
     </dependencies>

What happens if you add this on top of your code?

System.out.println(org.apache.tika.parser.pdf.PDFParser.PASSWORD);

it should output "org.apache.tika.parser.pdf.password". This is to test 
if the PDF parser is in your class path.

Tilman