SpencerPark / IJava

A Jupyter kernel for executing Java code.
MIT License
1.07k stars 211 forks source link

%%loadFromPOM doesn't work for tika-parsers-standard-package after the kernel restart #158

Closed sogawa-sps closed 2 weeks ago

sogawa-sps commented 3 months ago

For some reason, the following instruction doesn't work in a very peculiar way.

%%loadFromPOM
<dependency>
    <groupId>org.apache.tika</groupId>
    <artifactId>tika-parsers-standard-package</artifactId>
    <version>2.9.2</version>
</dependency>

import org.apache.tika.parser.pdf.PDFParser;

When you use it the very first time it does work, however, if you restart the kernel it stops working for good. The Jupyter Lab restart doesn't help. I tried to clean up files like ijava-maven-11439784286752912141.pom but it didn't help either.

2024-04-11 22_43_42-Untitled ipynb - JupyterLab

If you change the version to, say, 2.9.1 the cycle repeats. It works the first time until the kernel restarts.

Reproduces for tika-parsers-standard-package only.

Can be reproduced online.

andrus commented 1 month ago

Hi @sogawa-sps , this is already fixed in the JJava kernel, which is a supported version of iJava at https://github.com/dflib/jjava . So you can replace iJava with JJava in Jupyter (it is a drop-in replacement), and try again.

Some more info:

sogawa-sps commented 2 weeks ago

Hi @andrus,

Thank you so much. I confirm that the issue was resolved.