You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Marcos Bori (Jira)" <ji...@apache.org> on 2020/06/05 15:29:00 UTC

[jira] [Comment Edited] (TIKA-2929) tika-parsers not usable on module path (Java 11)

    [ https://issues.apache.org/jira/browse/TIKA-2929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17126878#comment-17126878 ] 

Marcos Bori edited comment on TIKA-2929 at 6/5/20, 3:28 PM:
------------------------------------------------------------

I'm trying to migrate an application that uses Tika libraries (core and parsers) to OpenJDK 13, using the Maven Central distribution.

My application uses the class *org.apache.tika.parser.pdf.PDFParserConfig.* When compiling, I get the error "*PDFParserConfig cannot be resolved to a type*".

In order for this class to be resolved, I have had to add "*requires org.apache.tika.parsers;*" to the "*module-info.java*" file.

Then it compiles.

However, when executing the application I get the error explained in this issue:

{{Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for C:\Users\Admin\.m2\repository\org\apache\tika\tika-parsers\1.24.1\tika-parsers-1.24.1.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.tika.parser.external.CompositeExternalParser not in module}}

*Note*: when working with version 1.24, the error complains for class *org.apache.tika.parser.onenote.OneNoteParser* instead of *org.apache.tika.parser.external.CompositeExternalParser*

So, the problem is that I need to add the package to the module path for the application to be compiled, but then it does not execute.

Inspecting *META-INF/services/org.apache.tika.parser.Parser* in *tika-parsers-1.24.1.jar* I can see the entry *org.apache.tika.parser.external.CompositeExternalParser*, but the jar package does not contain this class.

When inspecting this file for version 1.24, I can see the entry *org.apache.tika.parser.onenote.OneNoteParser* (that is not in the jar package neither), which matches with the error I get in this version.

Is this a problem with the Maven Central compiled package?

I'm stucked because setting the package only in the classpath and not in the module path does not solve the problem (I cannot compile).

Thanks,

M

 

PD-I also created an entry in StackOverflow: [https://stackoverflow.com/questions/62215464|https://stackoverflow.com/questions/62215464]

 


was (Author: maborec):
I'm trying to migrate an application that uses Tika libraries (core and parsers) to OpenJDK 13, using the Maven Central distribution.

My application uses the class *org.apache.tika.parser.pdf.PDFParserConfig.* When compiling, I get the error "*PDFParserConfig cannot be resolved to a type*".

In order for this class to be resolved, I have had to add "*requires org.apache.tika.parsers;*" to the "*module-info.java*" file.

Then it compiles.

However, when executing the application I get the error explained in this issue:

{{Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for C:\Users\Admin\.m2\repository\org\apache\tika\tika-parsers\1.24.1\tika-parsers-1.24.1.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.tika.parser.external.CompositeExternalParser not in module}}

*Note*: when working with version 1.24, the error complains for class *org.apache.tika.parser.onenote.OneNoteParser* instead of *org.apache.tika.parser.external.CompositeExternalParser*

So, the problem is that I need to add the package to the module path for the application to be compiled, but then it does not execute.

Inspecting *META-INF/services/org.apache.tika.parser.Parser* in *tika-parsers-1.24.1.jar* I can see the entry *org.apache.tika.parser.external.CompositeExternalParser*, but the jar package does not contain this class.

When inspecting this file for version 1.24, I can see the entry *org.apache.tika.parser.onenote.OneNoteParser* (that is not in the jar package neither), which matches with the error I get in this version.

Is this a problem with the Maven Central compiled package?

I'm stucked because setting the package only in the classpath and not in the module path does not solve the problem (I cannot compile).

Thanks,

M

 

PD-I also created an entry in StackOverflow: [[https://stackoverflow.com/questions/62215464|https://stackoverflow.com/questions/62215464]|https://stackoverflow.com/questions/62215464]

 

> tika-parsers not usable on module path (Java 11)
> ------------------------------------------------
>
>                 Key: TIKA-2929
>                 URL: https://issues.apache.org/jira/browse/TIKA-2929
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 1.22
>            Reporter: Tobias Diez
>            Priority: Major
>
> At the moment, it is not possible to use tika-parsers in a modularized environment. The following error is thrown at runtime:
> java.lang.module.FindException: Unable to derive module descriptor for org.apache.tika\tika-parsers\1.22\b8a823128f6165882ae41de3ded8655609d62d88\tika-parsers-1.22.jar
> Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.apache.tika.parser.external.CompositeExternalParser not in module
>  
> Could you please provide a proper module-info.java class listing the necessary providers (and dependencies of course).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)