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 with fast-jar deployment with Sentry extension #12252

Closed
ia3andy opened this issue Sep 22, 2020 · 5 comments · Fixed by #12255
Closed

java.lang.NoClassDefFoundError with fast-jar deployment with Sentry extension #12252

ia3andy opened this issue Sep 22, 2020 · 5 comments · Fixed by #12255
Labels
kind/bug Something isn't working
Milestone

Comments

@ia3andy
Copy link
Contributor

ia3andy commented Sep 22, 2020

Describe the bug
Exception while starting a quarkus app in fast-jar deployment mode:

java -jar ./target/quarkus-app/quarkus-run.jar                                                                                                                                                                              master ●
sept. 22, 2020 10:59:34 AM io.quarkus.application
ERROR: Failed to start application (with profile prod)
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at io.sentry.config.Lookup.<clinit>(Lookup.java:37)
        at io.quarkus.logging.sentry.SentryHandlerValueFactory.create(SentryHandlerValueFactory.java:23)
        at io.quarkus.deployment.steps.SentryProcessor$addSentryLogHandler-1613402751.deploy_0(SentryProcessor$addSentryLogHandler-1613402751.zig:80)
        at io.quarkus.deployment.steps.SentryProcessor$addSentryLogHandler-1613402751.deploy(SentryProcessor$addSentryLogHandler-1613402751.zig:40)
        at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:400)
        at io.quarkus.runtime.Application.start(Application.java:90)
        at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:91)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)
        at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:43)
        at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:24)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 17 more

Note: No issue without the Sentry extension, I added it because it's part of the stack..

CC @geoand @stuartwdouglas

To Reproduce

Link to a small reproducer:
https://github.com/ia3andy/reproduce-fast-jar

Steps to reproduce the behavior:

  1. mvn clean package -Dquarkus.package.type=fast-jar
  2. java -jar ./target/quarkus-app/quarkus-run.jar

Environment (please complete the following information):

  • Output of uname -a or ver:
Darwin MacBook-Pro-de-ia3andy 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 18 20:50:10 PDT 2020; root:xnu-4903.278.43~1/RELEASE_X86_64 x86_64
  • Output of java -version:
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
  • Quarkus version or git rev:
    1.8.1.Final
  • Build tool (ie. output of mvnw --version or gradlew --version):
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/ia3andy/.m2/wrapper/dists/apache-maven-3.6.3-bin/1iopthnavndlasol9gbrbg6bf2/apache-maven-3.6.3
Java version: 14.0.1, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home
Default locale: fr_FR, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
@ia3andy ia3andy added the kind/bug Something isn't working label Sep 22, 2020
@ia3andy
Copy link
Contributor Author

ia3andy commented Sep 22, 2020

Note: Until this is fixed, I can't use the fast-jar deployment on code.quarkus.io since it uses the sentry extension.

geoand added a commit to geoand/quarkus that referenced this issue Sep 22, 2020
geoand added a commit that referenced this issue Sep 23, 2020
Fix Sentry usage with fast-jar
@gsmet gsmet modified the milestones: 1.9.0 - master, 1.8.2.Final Oct 1, 2020
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 1, 2020
@ia3andy ia3andy changed the title java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory with fast-jar deployment with Sentry extension java.lang.NoClassDefFoundError with fast-jar deployment with Sentry extension Oct 14, 2020
@ia3andy
Copy link
Contributor Author

ia3andy commented Oct 14, 2020

This issue is poping again with a different class:

java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonGenerator
	at io.sentry.DefaultSentryClientFactory.createJsonMarshaller(DefaultSentryClientFactory.java:526)
	at io.sentry.DefaultSentryClientFactory.createMarshaller(DefaultSentryClientFactory.java:494)
	at io.sentry.DefaultSentryClientFactory.createHttpConnection(DefaultSentryClientFactory.java:456)

@ia3andy
Copy link
Contributor Author

ia3andy commented Oct 14, 2020

@geoand should we also add jackson to the list?

@geoand
Copy link
Contributor

geoand commented Oct 14, 2020

No, that could be very problematic

@ia3andy
Copy link
Contributor Author

ia3andy commented Oct 14, 2020

I will have a look at Sentry to find out why they use a JSON marshaller and if I can disable that feature..

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

Successfully merging a pull request may close this issue.

3 participants