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.ClassNotFoundException: io.vertx.core.logging.SLF4JLogDelegateFactory #3

Open
nikodemusP opened this issue Aug 14, 2019 · 6 comments

Comments

@nikodemusP
Copy link

Hi Jotschi,

Currently I try to get involved with graal and tried your example. The only difference is, that I used the released version of graal (19.1.1) and vert.x 3.8.0. The build worked fine, but this issue is raised at startup:

$ ./vertx-graalvm-native-image-test-0.0.1-SNAPSHOT
Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:290)
        at java.lang.Class.ensureInitialized(DynamicHub.java:451)
        at de.jotschi.examples.Runner.main(Runner.java:18)
Caused by: java.lang.IllegalArgumentException: Error instantiating transformer class "io.vertx.core.logging.SLF4JLogDelegateFactory"
        at io.vertx.core.logging.LoggerFactory.initialise(LoggerFactory.java:54)
        at io.vertx.core.logging.LoggerFactory.<clinit>(LoggerFactory.java:32)
        at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:350)
        at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:270)
        ... 2 more
Caused by: java.lang.ClassNotFoundException: io.vertx.core.logging.SLF4JLogDelegateFactory
        at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:60)
        at java.lang.ClassLoader.loadClass(Target_java_lang_ClassLoader.java:131)
        at io.vertx.core.logging.LoggerFactory.initialise(LoggerFactory.java:51)
        ... 5 more

Since you are the only one, which is using the logger-factory, mybe you have an idea, what the source could be?

Thx,
Nikolas

@Jotschi
Copy link
Owner

Jotschi commented Aug 14, 2019

The code in this repo has not been updated for a while. I have however worked on another more practial approach in another example:

https://github.com/gentics/mesh-alexa-skill/tree/native

That example also uses logging. Maybe it can help you get your issue sorted out. (Check the native branch)

You should be able to build it via ./mvnw clean package -DskipTests -Pnative

@nikodemusP
Copy link
Author

nikodemusP commented Aug 15, 2019

Thx, I will try it.
Nik

@fbuetler
Copy link

I made a fork and fixed the build to work with Vert.x 4.0.3, GraalVM 21.1.0 and Java 11.

@Jotschi
Copy link
Owner

Jotschi commented May 10, 2021

@fbuetler Can you create a PR? I would like to keep this example up to date if possible. I want to start a new Vert.x 4 project and it would be nice if I could generate native images as well.

@fbuetler
Copy link

Sure, I can open a PR. However, I stripped out many things that seemed, from my point of view, unnecessary for a POC (like zeit.co). If you are fine with that I'm happy to open a PR.

@Jotschi
Copy link
Owner

Jotschi commented May 10, 2021

@fbuetler Sure, I don't mind that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants