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

Jason Harrop commented on PDFBOX-5958:
--------------------------------------

Aaargh, you are right, thank you very much!

Something else was pulling in org.apache.pdfbox:fontbox:jar:2.0.30

> 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-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to