Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
cmoine opened this issue Jan 25, 2021 · 6 comments
Closed

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

cmoine opened this issue Jan 25, 2021 · 6 comments
Assignees

Comments

@cmoine
Copy link

cmoine commented Jan 25, 2021

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.

@cmoine
Copy link
Author

cmoine commented Jan 25, 2021

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
Copy link
Member

Could you please provide a working reproducer for this issue?

@oubidar-Abderrahim oubidar-Abderrahim self-assigned this Jan 27, 2021
@cmoine
Copy link
Author

cmoine commented Jan 28, 2021

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!

@cmoine cmoine closed this as completed Jan 28, 2021
@hminukuri-chwy
Copy link

hminukuri-chwy commented Mar 24, 2021

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
Copy link

wushuartgaro commented Oct 19, 2022

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
Copy link

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
Projects
None yet
Development

No branches or pull requests

5 participants