ppkarwasz opened a new pull request, #3260: URL: https://github.com/apache/tika/pull/3260
[TIKA-4934](https://issues.apache.org/jira/browse/TIKA-4934) `tika-bundle-standard` is meant to embed only the dependencies that aren't OSGi bundles themselves, but it also embedded many that ship proper OSGi manifests. This PR stops embedding them. It also fixes PDF parsing in OSGi, which failed because `pdfbox-io` was never embedded: ``` java.lang.NoClassDefFoundError: org/apache/pdfbox/io/RandomAccessReadBuffer Caused by: java.lang.ClassNotFoundException: org.apache.pdfbox.io.RandomAccessReadBuffer not found by org.apache.tika.bundle-standard ``` ### No longer embedded (must be deployed as separate bundles) commons-io, commons-codec, commons-collections4, commons-compress, commons-csv, commons-exec, commons-lang3, commons-math3, xz, pdfbox, fontbox, pdfbox-io, commons-logging (1.4+; `jcl-over-slf4j` only exports 1.2), bcprov/bcpkix/bcutil/bcjmail, jsoup, asm, xmpcore, dd-plist. ### Still embedded, although they are bundles - `apache-mime4j-core`/`-dom`: they import `org.apache.commons.io;version="[1.4,2)"`, which commons-io 2.x doesn't satisfy. - `rome`: it requires `org.jdom2`, which isn't a bundle. - `jackcess`/`jackcess-encrypt`: jackcess uses `org.apache.poi.poifs.filesystem` for OLE attachments, and POI only exists inside the bundle. ### Tests `BundleIT` now: - installs every jar that `test-bundles.xml` copies to `target/test-bundles`; - asserts that all bundles are active; - checks that classes from each external dependency load through the bundle that uses it. Every import of `tika-bundle-standard` is optional, so without this check a missing bundle wouldn't fail the test; - parses a PDF inside the container. This test fails on current `main` with the error above. The PDF test calls `PDFParser` directly. Parsing through the registered `Parser` service overflows the stack: `TikaActivator` passes the `DefaultParser` service registered by `BundleActivator` back into `ServiceLoader` as a dynamic provider, and `DefaultParser.getParsers()` then includes itself. That's a separate issue. ### Compatibility OSGi deployments of `tika-bundle-standard` need the bundles listed above. `CHANGES.txt` only has the in-progress 4.1.0 section, so I didn't add an entry. I'm happy to add one wherever you prefer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
