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

Can not build a native executable of Scala application #802

Closed
igor-ramazanov opened this issue Nov 12, 2018 · 3 comments
Closed

Can not build a native executable of Scala application #802

igor-ramazanov opened this issue Nov 12, 2018 · 3 comments
Assignees

Comments

@igor-ramazanov
Copy link

Hi!

I'm trying to build a native executable of my pet-project written in Scala: https://github.com/igor-ramazanov/pet-project-chat#building-native-executable-is-not-supported-at-the-moment

My steps:

  • Build a "fat-jar": sbt appJVM/assembly
  • Reflection configuration files:
[
  {
    "name": "akka.event.slf4j.Slf4jLogger",
    "allDeclaredConstructors" : true,
    "allPublicConstructors" : true,
    "allDeclaredMethods" : true,
    "allPublicMethods" : true
  },
  {
    "name": "akka.event.slf4j.Slf4jLoggingFilter",
    "allDeclaredConstructors" : true,
    "allPublicConstructors" : true,
    "allDeclaredMethods" : true,
    "allPublicMethods" : true
  }
]
  • Run the Graal compiler: native-image --static --enable-http -H:IncludeResources='.*' -H:ReflectionConfigurationFiles=graal-native-reflect.json -jar app/jvm/target/scala-2.12/pet-project-chat-backend-assembly-1.0.jar

After that I am getting next errors:

Error: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.

Full output:

Build on Server(pid: 20246, port: 65166)
[pet-project-chat-backend-assembly-1.0:20246]    classlist:  33,963.62 ms
[pet-project-chat-backend-assembly-1.0:20246]        (cap):   1,024.12 ms
[pet-project-chat-backend-assembly-1.0:20246]        setup:  12,821.63 ms
[pet-project-chat-backend-assembly-1.0:20246]     analysis:  45,864.36 ms
error: unsupported features in 15 methods
Detailed message:
Error: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace: 	object java.lang.Class[]
	object java.lang.invoke.MethodType
	object java.lang.invoke.MethodType$ConcurrentWeakInternSet$WeakEntry
	object java.util.concurrent.ConcurrentHashMap$Node
	object java.util.concurrent.ConcurrentHashMap$Node[]
	object java.util.concurrent.ConcurrentHashMap
	object java.lang.invoke.MethodType$ConcurrentWeakInternSet
	method java.lang.invoke.MethodType.makeImpl(Class, Class[], boolean)
Call path from entry point to java.lang.invoke.MethodType.makeImpl(Class, Class[], boolean):
	at java.lang.invoke.MethodType.makeImpl(MethodType.java:301)
	at java.lang.invoke.MethodType.dropParameterTypes(MethodType.java:572)
	at scala.runtime.LambdaDeserializer$.makeCallSite$1(LambdaDeserializer.scala:70)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:98)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.MethodHandle.bindTo(Object)
Trace:
	at parsing java.lang.invoke.MethodHandleImpl.makePairwiseConvertByEditor(MethodHandleImpl.java:221)
Call path from entry point to java.lang.invoke.MethodHandleImpl.makePairwiseConvertByEditor(MethodHandle, MethodType, boolean, boolean):
	at java.lang.invoke.MethodHandleImpl.makePairwiseConvertByEditor(MethodHandleImpl.java:207)
	at java.lang.invoke.MethodHandleImpl.makePairwiseConvert(MethodHandleImpl.java:194)
	at java.lang.invoke.MethodHandleImpl.makePairwiseConvert(MethodHandleImpl.java:380)
	at java.lang.invoke.MethodHandle.asTypeUncached(MethodHandle.java:776)
	at java.lang.invoke.MethodHandle.asType(MethodHandle.java:761)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:111)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.Invokers.makeExactOrGeneralInvoker(Invokers.java:110)
Call path from entry point to java.lang.invoke.Invokers.makeExactOrGeneralInvoker(boolean):
	at java.lang.invoke.Invokers.makeExactOrGeneralInvoker(Invokers.java:104)
	at java.lang.invoke.Invokers.genericInvoker(Invokers.java:70)
	at java.lang.invoke.Invokers.spreadInvoker(Invokers.java:158)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:111)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.LambdaForm$NamedFunction.<init>(LambdaForm.java:1031)
Call path from entry point to java.lang.invoke.LambdaForm$NamedFunction.<init>(MethodHandle):
	at java.lang.invoke.LambdaForm$NamedFunction.<init>(LambdaForm.java:1031)
	at java.lang.invoke.LambdaForm$Name.<init>(LambdaForm.java:1397)
	at java.lang.invoke.LambdaFormEditor.spreadArgumentsForm(LambdaFormEditor.java:552)
	at java.lang.invoke.MethodHandle.asSpreader(MethodHandle.java:874)
	at java.lang.invoke.Invokers.spreadInvoker(Invokers.java:158)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:111)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.LambdaForm$NamedFunction.<init>(LambdaForm.java:1043)
Call path from entry point to java.lang.invoke.LambdaForm$NamedFunction.<init>(MethodType):
	at java.lang.invoke.LambdaForm$NamedFunction.<init>(LambdaForm.java:1039)
	at java.lang.invoke.LambdaForm$Name.<init>(LambdaForm.java:1400)
	at java.lang.invoke.LambdaFormEditor.makeArgumentCombinationForm(LambdaFormEditor.java:690)
	at java.lang.invoke.LambdaFormEditor.filterArgumentForm(LambdaFormEditor.java:645)
	at java.lang.invoke.MethodHandles.filterArgument(MethodHandles.java:2623)
	at java.lang.invoke.Invokers.spreadInvoker(Invokers.java:167)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:111)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.LambdaForm$NamedFunction.equals(LambdaForm.java:1087)
Call path from entry point to java.lang.invoke.LambdaForm$NamedFunction.equals(Object):
	at java.lang.invoke.LambdaForm$NamedFunction.equals(LambdaForm.java:1083)
	at java.util.HashMap.getNode(HashMap.java:579)
	at java.util.HashMap.get(HashMap.java:557)
	at com.oracle.svm.jni.access.JNIReflectionDictionary.getFieldNameByID(JNIReflectionDictionary.java:150)
	at com.oracle.svm.jni.functions.JNIFunctions.ToReflectedField(JNIFunctions.java:839)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ejni_002efunctions_002eJNIFunctions_002eToReflectedField_0028com_002eoracle_002esvm_002ejni_002enativeapi_002eJNIEnvironment_002ccom_002eoracle_002esvm_002ejni_002enativeapi_002eJNIObjectHandle_002ccom_002eoracle_002esvm_002ejni_002enativeapi_002eJNIFieldId_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.LambdaForm$NamedFunction.hashCode(LambdaForm.java:1092)
Call path from entry point to java.lang.invoke.LambdaForm$NamedFunction.hashCode():
	at java.lang.invoke.LambdaForm$NamedFunction.hashCode(LambdaForm.java:1092)
	at java.util.HashMap.hash(HashMap.java:339)
	at java.util.HashMap.get(HashMap.java:557)
	at com.oracle.svm.jni.access.JNIReflectionDictionary.getFieldNameByID(JNIReflectionDictionary.java:150)
	at com.oracle.svm.jni.functions.JNIFunctions.ToReflectedField(JNIFunctions.java:839)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ejni_002efunctions_002eJNIFunctions_002eToReflectedField_0028com_002eoracle_002esvm_002ejni_002enativeapi_002eJNIEnvironment_002ccom_002eoracle_002esvm_002ejni_002enativeapi_002eJNIObjectHandle_002ccom_002eoracle_002esvm_002ejni_002enativeapi_002eJNIFieldId_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.LambdaForm$NamedFunction.methodType(LambdaForm.java:1280)
Call path from entry point to java.lang.invoke.LambdaForm$NamedFunction.methodType():
	at java.lang.invoke.LambdaForm$NamedFunction.methodType(LambdaForm.java:1276)
	at java.lang.invoke.LambdaForm$NamedFunction.returnType(LambdaForm.java:1302)
	at java.lang.invoke.LambdaForm$Name.<init>(LambdaForm.java:1407)
	at java.lang.invoke.LambdaFormEditor.spreadArgumentsForm(LambdaFormEditor.java:544)
	at java.lang.invoke.MethodHandle.asSpreader(MethodHandle.java:874)
	at java.lang.invoke.Invokers.spreadInvoker(Invokers.java:158)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:111)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.LambdaForm$NamedFunction.toString(LambdaForm.java:1314)
Call path from entry point to java.lang.invoke.LambdaForm$NamedFunction.toString():
	at java.lang.invoke.LambdaForm$NamedFunction.toString(LambdaForm.java:1314)
	at java.lang.String.valueOf(String.java:2994)
	at java.lang.StringBuilder.append(StringBuilder.java:131)
	at com.oracle.svm.core.amd64.AMD64CPUFeatureAccess.verifyHostSupportsArchitecture(AMD64CPUFeatureAccess.java:165)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:138)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.LambdaForm.<init>(LambdaForm.java:264)
Call path from entry point to java.lang.invoke.LambdaForm.<init>(String, int, LambdaForm$Name[], int, boolean, MethodHandle):
	at java.lang.invoke.LambdaForm.<init>(LambdaForm.java:252)
	at java.lang.invoke.LambdaForm.customize(LambdaForm.java:380)
	at java.lang.invoke.MethodHandle.customize(MethodHandle.java:1441)
	at java.lang.invoke.Invokers.maybeCustomize(Invokers.java:407)
	at java.lang.invoke.Invokers.checkCustomized(Invokers.java:398)
	at java.lang.invoke.LambdaForm$MH/1540235201.invokeExact_MT(LambdaForm$MH)
	at akka.dispatch.affinity.AffinityPool$IdleStrategy.idle(AffinityPool.scala:90)
	at akka.dispatch.affinity.AffinityPool$AffinityPoolWorker.executeNext$1(AffinityPool.scala:268)
	at akka.dispatch.affinity.AffinityPool$AffinityPoolWorker.runLoop$1(AffinityPool.scala:286)
	at akka.dispatch.affinity.AffinityPool$AffinityPoolWorker.run(AffinityPool.scala:294)
	at java.lang.Thread.run(Thread.java:748)
	at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:479)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:199)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eposix_002ethread_002ePosixJavaThreads_002epthreadStartRoutine_0028com_002eoracle_002esvm_002ecore_002ethread_002eJavaThreads_0024ThreadStartData_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.LambdaForm.prepare(LambdaForm.java:635)
Call path from entry point to java.lang.invoke.LambdaForm.prepare():
	at java.lang.invoke.LambdaForm.prepare(LambdaForm.java:634)
	at java.lang.invoke.MethodHandle.updateForm(MethodHandle.java:1432)
	at java.lang.invoke.MethodHandle.customize(MethodHandle.java:1442)
	at java.lang.invoke.Invokers.maybeCustomize(Invokers.java:407)
	at java.lang.invoke.Invokers.checkCustomized(Invokers.java:398)
	at java.lang.invoke.LambdaForm$MH/1540235201.invokeExact_MT(LambdaForm$MH)
	at akka.dispatch.affinity.AffinityPool$IdleStrategy.idle(AffinityPool.scala:90)
	at akka.dispatch.affinity.AffinityPool$AffinityPoolWorker.executeNext$1(AffinityPool.scala:268)
	at akka.dispatch.affinity.AffinityPool$AffinityPoolWorker.runLoop$1(AffinityPool.scala:286)
	at akka.dispatch.affinity.AffinityPool$AffinityPoolWorker.run(AffinityPool.scala:294)
	at java.lang.Thread.run(Thread.java:748)
	at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:479)
	at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:199)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eposix_002ethread_002ePosixJavaThreads_002epthreadStartRoutine_0028com_002eoracle_002esvm_002ecore_002ethread_002eJavaThreads_0024ThreadStartData_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.MethodHandles$Lookup.findGetter(MethodHandles.java:1026)
Call path from entry point to java.lang.invoke.MethodHandles$Lookup.findGetter(Class, String, Class):
	at java.lang.invoke.MethodHandles$Lookup.findGetter(MethodHandles.java:1026)
	at java.lang.invoke.BoundMethodHandle$Factory.makeGetter(BoundMethodHandle.java:745)
	at java.lang.invoke.BoundMethodHandle$Factory.makeGetters(BoundMethodHandle.java:754)
	at java.lang.invoke.BoundMethodHandle$SpeciesData.<init>(BoundMethodHandle.java:350)
	at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:389)
	at java.lang.invoke.BoundMethodHandle$SpeciesData$1.apply(BoundMethodHandle.java:383)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at java.lang.invoke.BoundMethodHandle$SpeciesData.get(BoundMethodHandle.java:383)
	at java.lang.invoke.BoundMethodHandle$SpeciesData.extendWith(BoundMethodHandle.java:378)
	at java.lang.invoke.BoundMethodHandle$Species_L.copyWithExtendL(BoundMethodHandle.java:233)
	at java.lang.invoke.MethodHandles.filterArgument(MethodHandles.java:2625)
	at java.lang.invoke.Invokers.spreadInvoker(Invokers.java:167)
	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:111)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:780)
Call path from entry point to java.lang.invoke.MethodHandles$Lookup.findStatic(Class, String, MethodType):
	at java.lang.invoke.MethodHandles$Lookup.findStatic(MethodHandles.java:780)
	at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(InnerClassLambdaMetafactory.java:226)
	at java.lang.invoke.LambdaMetafactory.altMetafactory(LambdaMetafactory.java:474)
	at scala.runtime.LambdaDeserializer$.makeCallSite$1(LambdaDeserializer.scala:93)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:98)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported type java.lang.invoke.MemberName is reachable: All methods from java.lang.invoke should have been replaced during image building.
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Trace:
	at parsing java.lang.invoke.MethodHandles$Lookup.revealDirect(MethodHandles.java:1341)
Call path from entry point to java.lang.invoke.MethodHandles$Lookup.revealDirect(MethodHandle):
	at java.lang.invoke.MethodHandles$Lookup.revealDirect(MethodHandles.java:1341)
	at java.lang.invoke.AbstractValidatingLambdaMetafactory.<init>(AbstractValidatingLambdaMetafactory.java:131)
	at java.lang.invoke.InnerClassLambdaMetafactory.<init>(InnerClassLambdaMetafactory.java:155)
	at java.lang.invoke.LambdaMetafactory.altMetafactory(LambdaMetafactory.java:466)
	at scala.runtime.LambdaDeserializer$.makeCallSite$1(LambdaDeserializer.scala:93)
	at scala.runtime.LambdaDeserializer$.deserializeLambda(LambdaDeserializer.scala:98)
	at scala.runtime.LambdaDeserialize.deserializeLambda(LambdaDeserialize.java:26)
	at akka.event.slf4j.Slf4jLogger.$deserializeLambda$(Slf4jLogger.scala)
	at com.oracle.svm.reflect.proxies.Proxy_akka_event_slf4j_Slf4jLogger_$deserializeLambda$_java_lang_Object_java_lang_invoke_SerializedLambda_49.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at akka.util.Reflect$.$anonfun$getCallerClass$1(Reflect.scala:34)
	at akka.util.Reflect$.$anonfun$getCallerClass$1$adapted(Reflect.scala:34)
	at akka.util.Reflect$$$Lambda$5386/620063721.apply(Unknown Source)
	at monix.eval.internal.TaskRunLoop$.startFull(TaskRunLoop.scala:121)
	at monix.eval.internal.TaskRunLoop$RestartCallback.onSuccess(TaskRunLoop.scala:537)
	at monix.eval.internal.TaskSleep$SleepRunnable.run(TaskSleep.scala:45)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:142)
	at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:87)
	at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:156)
	at com.oracle.svm.core.code.CEntryPointCallStubs.com_002eoracle_002esvm_002ecore_002eJavaMainWrapper_002erun_0028int_002corg_002egraalvm_002enativeimage_002ec_002etype_002eCCharPointerPointer_0029(generated:0)
Error: type is not available in this platform: org.graalvm.nativeimage.impl.ImageSingletonsSupport
@shuttie
Copy link

shuttie commented Dec 25, 2018

Spotted the same issue. My 50c on this:

  • scala 2.12 extensively uses MethodHandles for lambda invocations. And MH support in graal is quite limited, being only enough for java streams.
  • if you switch to scala 2.11, which is using old-good jdk7-style class-per-lambda, it compiles the native image correctly.

@2m
Copy link

2m commented Jun 13, 2019

Since Graal 19 there is --initialize-at-build-time that fixes this. Found it being used in the wild here: https://github.com/vmencik/akka-graal-native

@cstancu
Copy link
Member

cstancu commented Sep 22, 2020

MethodHandle support is under development and is being tracked by #2761.

@cstancu cstancu closed this as completed Sep 22, 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

6 participants