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

Building native-image for app with log4j 2.12.1 fails with "Unsupported features in 11 methods" #1991

Closed
kopper opened this issue Dec 16, 2019 · 2 comments
Assignees

Comments

@kopper
Copy link

kopper commented Dec 16, 2019

When I try to build native-image of trivial app using log4j 2.12.1 using native-image config generated with native-image-agent I get:

Error: Unsupported features in 11 methods
Detailed message:
Error: Field org.apache.logging.log4j.core.impl.ContextDataFactory.EMPTY_STRING_MAP has declared type org.apache.logging.log4j.util.StringMap which is incompatible with types in state: MTypeMObject<5347:
...
Call path from entry point to org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(String, Marker, String, Level, Message, Throwable, ThrowableProxy, StringMap, ThreadContext$ContextStack, long, String, int, StackTraceElement, long, int, long, Log4jLogEvent$1): 
	at org.apache.logging.log4j.core.impl.Log4jLogEvent.<init>(Log4jLogEvent.java:53)

GraalVM 19.3.0 CE on Mac OSX 10.14.6
Sample project https://github.com/kopper/graalvm

@cstancu cstancu self-assigned this Dec 16, 2019
@mipastgt
Copy link

Log4J uses MethodHandles, which are not supported by native-image, since version 2.8.
See: #2008 (comment)

@cstancu
Copy link
Member

cstancu commented Apr 29, 2020

Cannot replicate the original issue reported here, the error message for unsupported MethodHandle use has been improved since. As for proper support of the latest Log4j, as mentioned in the issue linked above, we will need proper MethodHandle support first. You can follow the MethodHandle discussion here #955

@cstancu cstancu closed this as completed Apr 29, 2020
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

3 participants