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

java.lang.NoClassDefFoundError: com/sun/jna/LastErrorException when -H:+ReportUnsupportedElementsAtRuntime option set when building a native image #796

Closed
johnaohara opened this issue Feb 7, 2019 · 2 comments
Labels
kind/bug Something isn't working triage/invalid This doesn't seem right

Comments

@johnaohara
Copy link
Member

When depending on shamrock-jdbc-postgresql-deployment, building a native image with -H:+ReportUnsupportedElementsAtRuntime as a native-image argument, the build fails with;

fatal error: java.lang.NoClassDefFoundError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:598)
at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1005)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:420)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:278)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:396)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:104)
Caused by: java.lang.NoClassDefFoundError: com/sun/jna/LastErrorException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleDeletedClass(AnnotationSubstitutionProcessor.java:436)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleClass(AnnotationSubstitutionProcessor.java:269)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.init(AnnotationSubstitutionProcessor.java:229)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:535)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:403)
at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

The error occurs when the native image generator classloader attempts to load class org.postgresql.sspi.NTDSAPIWrapper.

@johnaohara johnaohara added the kind/bug Something isn't working label Feb 7, 2019
@johnaohara
Copy link
Member Author

This is triggered when property <reportErrorsAtRuntime>true</reportErrorsAtRuntime> is defined for shamrock-maven-plugin in a project

@johnaohara johnaohara changed the title CNFE com/sun/jna/LastErrorException when -H:+ReportUnsupportedElementsAtRuntime option set when building a native image java.lang.NoClassDefFoundError: com/sun/jna/LastErrorException when -H:+ReportUnsupportedElementsAtRuntime option set when building a native image Feb 12, 2019
@johnaohara
Copy link
Member Author

No longer an issue

@cescoffier cescoffier added the triage/invalid This doesn't seem right label Oct 15, 2019
maxandersen pushed a commit to maxandersen/quarkus that referenced this issue Nov 5, 2022
Bumps [junit-jupiter](https://github.com/junit-team/junit5) from 5.7.0 to 5.7.1.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](junit-team/junit5@r5.7.0...r5.7.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants