You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (Jira)" <ji...@apache.org> on 2025/02/16 09:23:00 UTC

[jira] [Commented] (PDFBOX-5958) pdfbox.io NoSuchMethodError at runtime - JPMS?

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

Andreas Lehmkühler commented on PDFBOX-5958:
--------------------------------------------

I guess your maven configuration is somehow broken. The pdfbox-io jar seems to be missing. As minimum requirement you have to add io, fontbox and pdfbox to your project.

> pdfbox.io NoSuchMethodError at runtime - JPMS?
> ----------------------------------------------
>
>                 Key: PDFBOX-5958
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5958
>             Project: PDFBox
>          Issue Type: Bug
>          Components: IO
>    Affects Versions: 3.0.3 PDFBox
>         Environment: Eclipse 2024-06, Maven 3.9.9, java-17-openjdk (17.0.12)
>            Reporter: Jason Harrop
>            Priority: Minor
>
> I get:
>  
> {noformat}
> Exception in thread "main" java.lang.NoSuchMethodError: 'org.apache.fontbox.ttf.TrueTypeFont org.apache.fontbox.ttf.TTFParser.parse(org.apache.pdfbox.io.RandomAccessRead)'
>     at org.apache.pdfbox@3.0.3/org.apache.pdfbox.pdmodel.font.FontMapperImpl.<init>(FontMapperImpl.java:128)
>     at org.apache.pdfbox@3.0.3/org.apache.pdfbox.pdmodel.font.FontMappers$DefaultFontMapper.<clinit>(FontMappers.java:36)
>     at org.apache.pdfbox@3.0.3/org.apache.pdfbox.pdmodel.font.FontMappers.instance(FontMappers.java:48)
>     at org.apache.pdfbox@3.0.3/org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:126)
>     at openhtmltopdf.pdfbox@1.1.24/com.openhtmltopdf.pdfboxout.fontstore.AbstractFontStore$BuiltinFontStore.addCourier(AbstractFontStore.java:55){noformat}
>  
> This error occurs in Eclipse at run time, possibly because "maven dependencies" are on the classpath, not the modulepath (and there is no obvious way to reconfigure that).
> The same code did run fine outside Eclipse (with mvn exec:java), I thought since org.apache.pdfbox.io has an Automatic-Module-Name in MANIFEST.MF in the jar, and from that Maven puts it on the modulepath.
> But now it is not working that way either, or via Maven surefire tests (which are using modulepath, with pdfbox-io-3.0.3.jar on it).
> So I currently have no idea why this is broken (aside from suspecting a JPMS issue) or how to fix it. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org