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

GraalVM Native Image #61

Closed
mjulianotq opened this issue Mar 4, 2021 · 2 comments
Closed

GraalVM Native Image #61

mjulianotq opened this issue Mar 4, 2021 · 2 comments

Comments

@mjulianotq
Copy link

Considering the role this application fills, it's an excellent candidate for GraalVM's Native Image. I've given it a try, and it seems that the reliance on reflection of slf4j is causing a bit of a problem. I'm including the output of my attempt below. I want to understand this better myself, so I'll likely either open a pull request if one is needed or write a guide here on this ticket for inclusion wherever it may be appropriate.

Error: Unsupported features in 5 methods
Detailed message:
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.slf4j.impl.StaticMDCBinder.getSingleton(). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Trace:
        at parsing org.slf4j.MDC.bwCompatibleGetMDCAdapterFromBinder(MDC.java:99)
Call path from entry point to org.slf4j.MDC.bwCompatibleGetMDCAdapterFromBinder():
        no path found from entry point to target method

Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: org.slf4j.impl.StaticMarkerBinder.getSingleton(). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
Trace:
        at parsing org.slf4j.MarkerFactory.bwCompatibleGetMarkerFactoryFromBinder(MarkerFactory.java:61)
Call path from entry point to org.slf4j.MarkerFactory.bwCompatibleGetMarkerFactoryFromBinder():
        no path found from entry point to target method

Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: org.apache.log4j.Logger. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.
Trace:
        at parsing io.netty.util.internal.logging.Log4JLoggerFactory.newInstance(Log4JLoggerFactory.java:38)
Call path from entry point to io.netty.util.internal.logging.Log4JLoggerFactory.newInstance(String):
        no path found from entry point to target method

Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: org.osgi.framework.FrameworkUtil. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.
Trace:
        at parsing org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.loadImplementationsInBundle(ResolverUtil.java:282)
Call path from entry point to org.apache.logging.log4j.core.config.plugins.util.ResolverUtil.loadImplementationsInBundle(ResolverUtil$Test, String):
        no path found from entry point to target method

Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: org.slf4j.ext.EventData. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.
Trace:
        at parsing org.apache.logging.slf4j.EventDataConverter.convertEvent(EventDataConverter.java:33)
Call path from entry point to org.apache.logging.slf4j.EventDataConverter.convertEvent(String, Object[], Throwable):
        at org.apache.logging.slf4j.EventDataConverter.convertEvent(EventDataConverter.java:33)
        at org.apache.logging.slf4j.Log4jLogger.log(Log4jLogger.java:367)
        at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:131)
        at com.amazonaws.http.IdleConnectionReaper.run(IdleConnectionReaper.java:194)
        at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:519)
        at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
        at com.oracle.svm.core.code.IsolateEnterStub.PosixJavaThreads_pthreadStartRoutine_e1f4a8c0039f8337338252cd8734f63a79b5e3df(generated:0)
@afs
Copy link
Owner

afs commented Mar 8, 2021

The patch server is a long-running process so the benefits of AOT are not so great (indeed, The GraalVM team reported that AOT is 5-% slower than JIT.)

It would be nice to have for the command line dcmd operations where start-up is noticeable.

The IT world seems to be moving towards more variety of instruction sets (e.g. ARM servers). Including instructions and template files would help users.

@afs afs closed this as completed May 24, 2021
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

2 participants