Skip to content

Main entry point not found when using library flying-saucer-pdf !?!? #3148

Closed
@cmoine

Description

@cmoine

Describe the issue
I am using GraalVM for a long time with several dependencies (such as AWS...). But as soon as I am using the dependency 'org.xhtmlrenderer:flying-saucer-pdf:9.1.20' the native compilation fails in a very weird way:

Error: Main entry point class 'com.itemis.fotahub.aws.lambda.restapi.Main' not found.
Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1

I have isolated the problem: I have commented all code which use this library. Even though, simply by adding this dependency in the gradle build script, it raises this very strange error.

Steps to reproduce the issue

  1. create a gradle project
  2. Add 'org.xhtmlrenderer:flying-saucer-pdf:9.1.20' as dependency
  3. Run native compilation

Describe GraalVM and your environment:

  • GraalVM version 21.0.0 and 20.1.0
  • JDK major version: 8
  • OS: Ubuntu
  • Architecture: AMD64

More details
All the option (--native-image-info, --verbose, and H:+ReportExceptionStackTraces) don't give anymore info.

Activity

cmoine

cmoine commented on Jan 25, 2021

@cmoine
Author

I am not able to reproduce the problem on a simple project. Maybe the error pops up by mixing several libraries. Problem is that the error doesn't give any hint on the problem... :-(

oubidar-Abderrahim

oubidar-Abderrahim commented on Jan 27, 2021

@oubidar-Abderrahim
Member

Could you please provide a working reproducer for this issue?

cmoine

cmoine commented on Jan 28, 2021

@cmoine
Author

Sorry, but I cannot reproduce it on a simple project, and I cannot give you the entire project. I guess you can close the ticket. Who knows maybe someone will have the same problem!

hminukuri-chwy

hminukuri-chwy commented on Mar 24, 2021

@hminukuri-chwy

I am running into this error when I add this library ('org.xhtmlrenderer', 'flying-saucer-pdf', '9.1.20')
java.lang.ClassNotFoundException: com.lowagie.text.pdf.PdfName

implementation group: 'com.lowagie', name: 'itext', version: '2.1.7', ext: 'pom'
Tried to add above lib to resolve it , still running into same error

any thoughts ?

wushuartgaro

wushuartgaro commented on Oct 19, 2022

@wushuartgaro

I am running into this error when I add this library ('org.xhtmlrenderer', 'flying-saucer-pdf', '9.1.20') java.lang.ClassNotFoundException: com.lowagie.text.pdf.PdfName

implementation group: 'com.lowagie', name: 'itext', version: '2.1.7', ext: 'pom' Tried to add above lib to resolve it , still running into same error

any thoughts ?

Not sure whether you're using Quarkus 2.8 and above. If yes, the best way to deal with this is to import all the required libs to ensure the class path is complete at build time.
quarkusio/quarkus#25526 (comment)

You can refer to the pom.xml of the flying-saucer-pdf library itself.
https://github.com/flyingsaucerproject/flyingsaucer/blob/v9.1.20/flying-saucer-pdf/pom.xml

For my case, I would need to add in these three libs to build the native image successfully
implementation group 'com.lowagie', name: 'itext', version: '2.1.7'
implementation group 'org.bouncycastle', name: 'bcprov-jdk14', version: '1.64'
implementation group 'org.bouncycastle', name: 'bcmail-jdk14', version: '1.64'

emakunin

emakunin commented on Aug 10, 2024

@emakunin

Thank you @wushuartgaro. Your comment so far is the only working version and solution i've found for quarkus. All new versions cannot pass Quarkus's validations. I believe they've started using language features that are not supported by GraalVM. Even trying to move all the checks to runtime does not help. With this version and dependencies list it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @cmoine@oubidar-Abderrahim@wushuartgaro@hminukuri-chwy@emakunin

      Issue actions

        Main entry point not found when using library flying-saucer-pdf !?!? · Issue #3148 · oracle/graal