Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    @headius that’s where I get stuck on using Native Image on JRuby as well - I didn’t get any further
    Charles Oliver Nutter
    @chrisseaton I removed final from the methods and the error went away. Closer to finishing now
    Seems like a bug
    Łukasz Biały
    this Could not find non-initialized charset JIS_X_*.java thing is really annoying, I have to kill graal's build server to make it go away
    I try to avoid using the server
    Łukasz Biały
    I use --no-server all the time but it makes stuff a lot slower
    Charles Oliver Nutter
    I have to use --no-server because it flakes out after just a few builds
    errors become random, things start to hang
    Stathis Sideris
    Hello, the documentation says that "Polyglot embeddings can also be compiled ahead-of-time" but it's not clear to me how this can be achieved. Any pointers?
    Remko Popma
    What does --server do? I looked but couldn’t find any docs... Can anyone share a link?
    Łukasz Biały


    Caused by: com.oracle.svm.core.util.VMError$HostedError: Could not find non-initialized charset JIS_X_0212.java
            at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:74)
            at com.oracle.svm.core.jdk.LocalizationFeature$CharsetNodePlugin.handleInvoke(LocalizationFeature.java:86)
            at org.graalvm.compiler.java.BytecodeParser.tryNodePluginForInvocation(BytecodeParser.java:2105)

    thing is happening often even with --no-server

    @remkop do you mean --no-server? it builds native image without starting background compilation server as a daemon
    Cristi Iaroi
    hello everyone, I'm not sure if this is the right place to ask this but has anyone build a native-image with code running jaxb? I'm currently getting Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory when running the resulting binary. Is there some fix/workaround for this? (point me in the right direction pls)
    @cristiWiRd_twitter yes the right place to ask, but you're probably best off opening a GitHub issue for that.
    Cristi Iaroi
    @chrisseaton thanks for the reply. There is an issue already open : oracle/graal#379 but no solution
    Try pinging cstancu in the issue
    Cristi Iaroi
    thanks. Another quick question : has anyone had the pleasure of creating a native-image for windows that uses httpsconnection? or calls an https endpoint? (--enable-https). Currently fighting with NoSuchAlgorithmException: SSL SSLContext not available issue when running the resulting binary - for which I had to "hack" the graalvml/jre/lib/security/java.security file (because of sunec issues)
    Charles Oliver Nutter
    what magic do I need to do to install native-image on EE?
    I just wanted to see how it compares to my CE image
    oh nevermind, same jar seems to work
    there are docs saying to use gu install native-image fwiw
    Oleg Šelajev
    yeah, this is a recent change I don't think all locations are changed with the instructions. Please download the native image for GraalVM Enterprise jar from OTN: https://www.oracle.com/downloads/graalvm-downloads.html and install it with gu install --file filename.jar
    Iván López

    Hey folks! I have a question about how to speed up compilation of GraalVM from source. For testing Micronaut integration we compile Graal from source and then run our tests. Currently this is what we execute:

    mx --disable-polyglot --disable-libpolyglot --dynamicimports /substratevm build

    And that generates libnative-image-agent, native-image-configure, gu and native-image.
    We only need native-image for our tests so I was wondering if there is a way to configure the build to generate only native-image and skip the rest so our builds are faster.

    Iván López
    Using mx --disable-polyglot --disable-libpolyglot --dynamicimports /substratevm --skip-libraries=true build builds native-image-configure, gu and native-image. Not sure if it's possible to also avoid building native-image-configure and gu
    abhishek manocha
    How exactly to solve Error: No bin/java and no environment variable JAVA_HOME with graalvvm-ce:19.2.0 --no-fallback doesnt work with the micronaut app and docker fails with exit code 1
    Should I set /bin/java manually?
    abhishek manocha
    --no-fallback doesnt work with the micronaut app and docker fails with exit code 1
    Alina Yurenko
    Hi everyone. Due to popular demand we’re moving GraalVM channels to a GraalVM community Slack workspace.
    It has been set up and has the same channels as here (and more). To join the workspace, use this link: https://join.slack.com/t/graalvm/shared_invite/enQtNzk0NTc5MzUyNzg5LTAwY2YyODQ4MzJjMGJjZGQzMWY2ZDA3NWI3YzEzNDRlNGQ1MTZkYzkzM2JkYjIxMTY2NGQzNjUxOGQzZGExZmU
    We hope this transition wouldn’t be too much trouble and will help to make our communication easier.
    Michel Schudel
    Hi. I'm trying to build a native image on Windows using a H2 embedded driver and JPA. I followed the instructions on https://github.com/micronaut-projects/micronaut-data/tree/master/src/main/docs/guide/graal, so I should use @TypeHint(typeNames = { "org.h2.Driver", "org.h2.mvstore.db.MVTableEngine"})
    @TypeHint( {
    but I can only specify one typehint annotation at a time
    my native-image .properties file looks like this:
    Args = -H:IncludeResources=logback.xml|application.yml|bootstrap.yml \
    -H:Name=person-service-micronaut \
    -H:Class=person.service.micronaut.Application \
    --report-unsupported-elements-at-runtime \
    Oleg Šelajev

    @MichelSchudel can you please join slack team mentioned above. Also, can you combine these hints?

    @TypeHint(typeNames = { "org.h2.Driver", "org.h2.mvstore.db.MVTableEngine"}, value={H2Dialect.class,

    but please move to slack channel, thanks!
    Michel Schudel
    yes, I've moved a few seconds ago, thanks

    Hello to everybody.... first at all, i want to greet this initiative ...

    I am trying to create a graal native image application with micronauts in a windows environment
    (Windows 10 professional x64; GraalVM CE 19-1-1; Micronauts 1.21; Java 8 compliant; Microsoft Windows SDK 7.1 )

    It's a simple microservice which connects to a remote url and get a result ....
    (you can see the code here https://github.com/jeag2002/TestMicronautGraalVM; and as a standalone micronaut application; works perfectly)

    I get the following warning in one of steps of native compilation...
    "Caused by: java.lang.Error: failed to initialize the default SSL context"
    That propagates as an error when i try to execute it later ....

    I know it's a known error; and i have been trying tons of configuration/suggestion that i found in internet without success ; and sincerelly i don't know how to solve o patch it

    The same question has been sent to the micronaut forum, and they have resent me to this forum...

    Can you help me?... Thanks in advance

    David M. Lloyd
    you should move the question to the slack channel (see above)
    Is there an annotation to prevent build-time initialization of classes? this would be much handier/safer than external configuration.
    or some programming idiom
    Paulo Lopes
    no, but it feels like you're missing the libsunec to link your final image. BTW everyone moved to Slack, you should consider ask there too.
    Ryan Berckmans
    Good morning. I am trying to use build a Scala 2.13.1 project with native-image. I use Akka, graal-akka-actor, and sbt-native-packager's GraalVMNativeImagePlugin. Here's my config
    graalVMNativeImageOptions ++= Seq(
    I receive this error when running the binary produced by native-image:
    Caused by: java.lang.NoSuchMethodError: java.lang.Object[][].clone()
            at scala.collection.immutable.VectorPointer.gotoPosWritable0(Vector.scala:1158)
            at scala.collection.immutable.VectorPointer.gotoPosWritable0$(Vector.scala:1134)
    Quick googling suggests I may need a new option in graalVMNativeImageOptions, but I'm not sure which one
    Ryan Berckmans
    The problem seems to be with gotoPosWritable, also seeing
    java.lang.NoSuchMethodError: java.lang.Object[].clone()
        at scala.collection.immutable.VectorPointer.gotoPosWritable0$(Vector.scala:1134
        at scala.collection.immutable.Vector.gotoPosWritable(Vector.scala:119)
    @FrancoBenner looking at your error stack trace, i suppose you're generating the native-image in windows doesn't you? ... If the response is yes; comment the following lines in the java.security file of the graalVM JVM (security.provider.3=sun.security.ec.SunEC; security.provider.10=sun.security.mscapi.SunMSCAPI) and recompile your solution ... (libsunec.lib; libsunmscapi.lib doesn't exist in windows; and the dll's doesn't work)
    Ryan Berckmans
    Here is a GitHub issue corresponding to my problem scala/bug#11634
    @FrancoBenner can you show me the parameters that you use with native-image command?... also can tell me what version of the GraalVM JDK for windows are you using?

    Hell, I am trying to build a native image for my experimental springboot application which uses annotation based GraphQL integration. When I try to build the native image I get something like :

    Error: No instances of graphql.introspection.Introspection$DirectiveLocation are allowed in the image heap as this class should be initialized at image runtime. Object has been initialized by the io.leangen.graphql.annotations.types.GraphQLDirective class initializer with a trace: 
     .  To fix the issue mark graphql.introspection.Introspection$DirectiveLocation for build-time initialization with --initialize-at-build-time=graphql.introspection.Introspection$DirectiveLocation or use the the information from the trace to find the culprit and --initialize-at-run-time=<culprit> to prevent its instantiation.
    Detailed message:
    Trace:     object graphql.introspection.Introspection$DirectiveLocation[]
        method io.leangen.graphql.metadata.strategy.query.AnnotatedDirectiveBuilder.buildClientDirective(AnnotatedType, DirectiveBuilderParams)
    Call path from entry point to io.leangen.graphql.metadata.strategy.query.AnnotatedDirectiveBuilder.buildClientDirective(AnnotatedType, DirectiveBuilderParams): 
        at io.leangen.graphql.metadata.strategy.query.AnnotatedDirectiveBuilder.buildClientDirective(AnnotatedDirectiveBuilder.java:82)
        at io.leangen.graphql.generator.OperationMapper.lambda$generateDirectives$4(OperationMapper.java:141)
        at io.leangen.graphql.generator.OperationMapper$$Lambda$1078/249839094.apply(Unknown Source)
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
        at org.springframework.transaction.support.TransactionOperations.lambda$executeWithoutResult$0(TransactionOperations.java:68)
        at com.oracle.svm.reflect.TransactionOperations_lambda$executeWithoutResult$0_ae12fe069646a236658983eb24bddfc18868bbcc_1261.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at javax.xml.transform.TransformerException.printStackTrace(TransformerException.java:348)
        at javax.xml.transform.TransformerException.printStackTrace(TransformerException.java:282)
        at com.oracle.svm.jni.functions.JNIFunctions.ExceptionDescribe(JNIFunctions.java:761)
        at com.oracle.svm.core.code.IsolateEnterStub.JNIFunctions_ExceptionDescribe_b5412f7570bccae90b000bc37855f00408b2ad73(generated:0)

    if i add:


    then I get something like:

    graphql.schema.GraphQLSchema$Builder was unintentionally initialized at build time. graphql.introspection.Introspection caused initialization of this class with the following trace: 
    graphql.schema.GraphQLType was unintentionally initialized at build time. graphql.introspection.Introspection caused initialization of this class with the following trace: 
        at com.oracle.svm.core.util.UserError.abort(UserError.java:65)
        at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.checkDelayedInitialization(ConfigurableClassInitialization.java:494)
        at com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.duringAnalysis(ClassInitializationFeature.java:188)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$8(NativeImageGenerator.java:711)
        at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:63)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:711)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:526)
        at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:444)
        at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
    Error: Image build request failed with exit status 1

    what am I doing wrong?

    i am using the experimental spring graalvm native-image support project and the following to create my reflection and other configs needed by native-image
    java  -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image -jar target/my-spring-app-0.0.1-SNAPSHOT.jar
    I was able to create a native image of a non-trivial and rather big application. No change of the application was necessary (!) and so far no big problems: https://github.com/karussell/graphhopper-native-image This is really great - thanks for enabling us to do this! The startup speed is much faster (<0.05s vs. 0.5s before) although this is not the main goal of this experiment.
    The goal is more to create a native library that other applications can use. Is the creation of e.g. .so libraries possible with Graal too?
    And the next step would be to cross compile to iOS and Android :) ... but I learned that this is not yet possible (?)