by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Boris Smidt
    @borissmidt
    nvm i'm posting this to slack.
    ThomasW0221
    @ThomasW0221

    Hello all,

    I am having an issue with compiling a micronaut application to a native image with graalvm. This issue relates specifically to using H2 within this application. I have created a small test api. It utilizes h2 and I believe is configured properly (although obviously something is wrong due to the issue I am having). When I run the application normally, everything runs as expected. Hikari starts, I see the hibernate log messages I expect, and the table I use gets created using the h2 dialect. I can then successfully build this application into a native binary image. The issue comes about when running this application with docker, I do not see the start up log messages I expect and I get a "Internal Server Error: No backing RepositoryOperations configured for repository. Check your configuration and try again" error message. I find this confusing because again, it works when I am running it as a non native image. Has anyone faced similar issues or are they aware of the cause?

    Remko Popma
    @remkop
    This channel is abandoned. There’s a link to the Slack channel in earlier messages.
    Binoy Shah
    @ShahBinoy
    hi, I need to build arm64 native image for my application, how can I build an arm64 image from a mac, any leads would be helpful
    Remko Popma
    @remkop
    This channel is abandoned. There’s a link to the Slack channel in earlier messages.
    Alex Karymau
    @karymau

    Hi there! Has anybody successfully built native image and run Java AWS SDK V2 samples?
    Now playing with com.example.dynamodb.ListTables in attemp to build native image: built jar, run it with -agentlib:native-image-agent anf gen META-INF/native-image/*-config.json files, rebuild jar and when run:

    native-image --no-fallback -H:+TraceClassInitialization -jar target/sdk-dynamodb-examples-1.0.jar

    got

    Error: Classes that should be initialized at run time got initialized during image building:
     org.apache.http.conn.ConnectionRequest the class was requested to be initialized at build time (from the command line). org.apache.http.conn.ConnectionRequest has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try avoiding to initialize the class that caused initialization of org.apache.http.conn.ConnectionRequest

    If add --initialize-at-build-time=org.apache.http then got dozens of another errors:

    org.apache.log4j.or.RendererMap was unintentionally initialized at build time. org.apache.log4j.or.RendererMap has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try marking this class for build-time initialization with --initialize-at-build-time=org.apache.log4j.or.RendererMap
    org.apache.commons.logging.LogFactory$4 was unintentionally initialized at build time. org.apache.commons.logging.LogFactory$4 has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try marking this class for build-time initialization with --initialize-at-build-time=org.apache.commons.logging.LogFactory$4
    org.apache.commons.logging.impl.Log4JLogger was unintentionally initialized at build time. org.apache.commons.logging.impl.Log4JLogger has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. Try marking this class for build-time initialization with --initialize-at-build-time=org.apache.commons.logging.impl.Log4JLogger
    ...

    Can anybody advice anything?

    Remko Popma
    @remkop
    Hi. This channel is abandoned. Please move to the Slack channel.
    See earlier comments for a link.
    Alex Karymau
    @karymau
    Thanks!
    amahfouz1
    @amahfouz1
    Caused by: com.oracle.svm.core.util.UserError$UserException: Static field or an object referenced from a static field changed during native image generation? object:java.lang.ref.SoftReference@3a20bbf7 of class: java.lang.ref.SoftReference
    I am struggling with this error, any idea?
    Remko Popma
    @remkop
    Hi. This channel is abandoned. Please move to the Slack channel.
    See earlier comments for a link.
    drocsid
    @drocsid

    Hi , I've got a curious error appearing almost randomly in my native-image runs:

    Caused by: com.oracle.svm.core.util.VMError$HostedError: Could not find non-initialized charset JIS_X_0208.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)
            at org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1788)
            at org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1566)
            at org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1546)
            at org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5125)
            at org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3267)
            ... 23 more
    Caused by: java.nio.charset.UnsupportedCharsetException: JIS_X_0208
            at java.nio.charset.Charset.forName(Charset.java:531)
            at com.oracle.svm.core.jdk.LocalizationFeature$CharsetNodePlugin.handleInvoke(LocalizationFeature.java:83)

    The VMError.shouldNotReachHereand the fact that the same fatjar compiles with native-image on some runs tells me it's probably not related to my code

    @lbialy ^^ did you ever solve this issue?

    Remko Popma
    @remkop
    Hi, this channel has been abandoned and replaced by Slack. See links earlier in this channel.
    drocsid
    @drocsid
    @remkop maybe close the channel? @Ibialy can you please DM me if you solved the issue?
    Remko Popma
    @remkop
    Hi, this channel has been abandoned and replaced by Slack. See links earlier in this channel.
    James Roper
    @jroper
    The GraalVM native image compiler runs as a server - is it possible to run and use such a server remotely, eg, start a 96 CPU ec2 instance running the native image compiler server, and then have a developer machine connect to and use it to compile something?
    Remko Popma
    @remkop
    This channel is abandoned and replaced by Slack. See links earlier in this channel.
    Darwin Esteban Algarin Sarmiento
    @dalgarins
    Hi, I have been using graalvm but I have a problem, when my app start only consume 30mb but when I testing my app the start increase until 1GB, I would like to set a portion of memory only 128mb for example, I have used -Xmx128m, but the issue still continue, what could i do to solve that? thanks
    Remko Popma
    @remkop
    This channel is abandoned and replaced by Slack. See links earlier in this channel.
    Georg Aigner
    @basalt79
    hi, how can i use the "report-unsupported-elements-at-runtime" in quarkus native build ?
    jorgesalazarc21
    @jorgesalazarc21

    Hi, I have the follow error, when I execute binay image with graalvm

    "message": "Internal Server Error: Could not initialize class io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder"

    Alessandro Vermeulen
    @spockz
    I have a question regarding native-image building. What happens to files like build.properties contained in jars on -imagecp? I ask this because I have jackson crashing because it cannot read a groupId from a build.properties which is in the jar of jackson-module-scala.
    Should I include these files with -H:IncludeResources=**/build.properties or is there a different canonical way to do this?
    And is there a way to inspect the native image to see which resources are actually included?
    Remko Popma
    @remkop
    Please scroll up...
    Alessandro Vermeulen
    @spockz
    Thanks @remkop, Maybe find someone who can change the channel description and add that message? Saves some repeating. :)
    Boris Shilov
    @muscovitebob
    Hey folks I am getting this on macOS, I have installed native image via gu, anyone has some idea how to fix this?
    > $JAVA_HOME/bin/java -agentlib:native-image-agent=config-output-dir=META-INF/native-image bin/connect-cli ps
    Error occurred during initialization of VM
    Could not find agent library native-image-agent on the library path, with error: dlopen(libnative-image-agent.dylib, 1): image not found
    Oh right, abandoned channel. Shame
    Krzysztof Koziol
    @koziolk

    Hi, is there any way to speed up a Docker based native-image build? I’ve created a simple REST service using Micronaut and it takes ~2 hours to build a native app with the following build options:

    FROM oracle/graalvm-ce:20.0.0-java11
    ...
    RUN native-image -J-Xmx10G -J-Xms2G --no-fallback --allow-incomplete-classpath --verbose -H:+ReportExceptionStackTraces --no-server -cp target/my-service-app.jar

    Not sure what else I can tune in there. Any help would be appreciated, Thanks!

    Alessandro Vermeulen
    @spockz
    @koziolk that sounds excessive to me. Most times I have seen are around 10 minutes for bigger apps. That said. There is a slack channel now.
    Krzysztof Koziol
    @koziolk

    @koziolk that sounds excessive to me. Most times I have seen are around 10 minutes for bigger apps. That said. There is a slack channel now.

    Thank you @spockz

    Anatol Ulrich
    @spookyvision
    heya! I'm stuck with resource/reflection configuration it seems. My native image crashes with
    Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.commons.logging.LogFactory
        at org.apache.commons.logging.LogFactory.class$(LogFactory.java:1021)
        at org.apache.commons.logging.LogFactory.<clinit>(LogFactory.java:1674)
        at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:350)
        at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:270)
        at java.lang.Class.ensureInitialized(DynamicHub.java:499)
        at org.apache.pdfbox.pdmodel.PDDocument.<clinit>(PDDocument.java:98)
        at com.oracle.svm.core.hub.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:350)
        at com.oracle.svm.core.hub.ClassInitializationInfo.initialize(ClassInitializationInfo.java:270)
        at java.lang.Class.ensureInitialized(DynamicHub.java:499)
        at com.livingpackets.Main.doExtractImage(Main.java:332)
        at com.livingpackets.Main.main(Main.java:368)
    • I used the following process, it seems the config files are not discovered though:
      ($classpath contains my required jars and the main class is in extractor.jar; cmdline arguments to my Main class omitted for brevity; LOG_DEBUG ensures logging is in fact configured and used, so it can be picked up by the analysis)
      $ mkdir -p META-INF/native-image
      $ LOG_DEBUG=y java -agentlib:native-image-agent=config-output-dir=META-INF/native-image -cp $classpath:extractor.jar  com.livingpackets.Main (args...)
      $ native-image --no-fallback --class-path $classpath:META-INF/native-image -jar extractor.jar 
      $ ./extractor (args...)
    when I omit --no-fallback I get this during build:
    Warning: Reflection method java.lang.Class.forName invoked at org.apache.commons.logging.LogFactory.createFactoryStore(LogFactory.java:331)
    Warning: Reflection method java.lang.Class.forName invoked at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1146)
    Warning: Reflection method java.lang.Class.forName invoked at org.apache.commons.logging.LogFactory.class$(LogFactory.java:1021)
    Warning: Reflection method java.lang.Class.newInstance invoked at org.apache.commons.logging.LogFactory.createFactoryStore(LogFactory.java:332)
    Warning: Reflection method java.lang.Class.newInstance invoked at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1147)
    Warning: Reflection method java.lang.Class.newInstance invoked at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1047)
    Warning: Reflection method java.lang.Class.getMethod invoked at org.slf4j.helpers.SubstituteLogger.isDelegateEventAware(SubstituteLogger.java:363)
    Warning: Reflection method java.lang.Class.getDeclaredMethods invoked at com.fasterxml.jackson.jr.ob.impl.POJODefinition._introspect(POJODefinition.java)
    Warning: Reflection method java.lang.Class.getDeclaredConstructor invoked at org.apache.pdfbox.pdmodel.encryption.SecurityHandlerFactory.newSecurityHandler(SecurityHandlerFactory.java:132)
    Warning: Reflection method java.lang.Class.getDeclaredConstructors invoked at com.fasterxml.jackson.jr.ob.impl.POJODefinition._construct(POJODefinition.java)
    Warning: Reflection method java.lang.Class.getDeclaredFields invoked at com.fasterxml.jackson.jr.ob.impl.POJODefinition._introspect(POJODefinition.java)
    Warning: Reflection method java.lang.ClassLoader.loadClass invoked at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1020)
    Warning: Aborting stand-alone image build due to reflection use without configuration.
    Warning: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
    Anatol Ulrich
    @spookyvision
    ah, making progress ... have to explicitly specify the json config files and tweak them a little
    I suppose this is "game over"?
    java.lang.UnsatisfiedLinkError: sun.java2d.cmm.lcms.LCMS.getProfileID(Ljava/awt/color/ICC_Profile;)Lsun/java2d/cmm/lcms/LCMSProfile; [symbol: Java_sun_java2d_cmm_lcms_LCMS_getProfileID or Java_sun_java2d_cmm_lcms_LCMS_getProfileID__Ljava_awt_color_ICC_1Profile_2]
    Alessandro Vermeulen
    @spockz
    @spookyvision there is a slack channel now and this channel is defunct
    marian-m12l
    @marian-m12l
    Hi all,
    I'm in the process of automating native image build for multiple OSes using GitHub Actions. To start simple, I created a repository with the simplest HelloWorld, works great for Linux and macOS builds, but I'm stuck with Windows build. I'm using Maven and the `native-image-maven-plugin` plugin to call native-image, but it keeps giving me this error: Image building on Java 11+ without native-image requires MAVEN_OPTS='--add-exports=java.base/jdk.internal.module=ALL-UNNAMED'. It looks like the GraalVM setup is OK, though, as the PATH contains "C:\hostedtoolcache\windows\GraalVM\20.1.0-java11\x64\bin" JAVA_HOME is "C:\hostedtoolcache\windows\GraalVM\20.1.0-java11\x64" and `java -version` gives me this output:
    openjdk version "11.0.7" 2020-04-14
    OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
    OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)
    I tried both version 19.3.2 and 20.1.0
    Native image installation looks OK, with command: %JAVA_HOME%/bin/gu.cmd install native-image
    I'm running maven from the VS dev command prompt, using:
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
    mvn -B package --file pom.xml
    Am I missing something here? Should I drop the maven plugin and call native-image manually in my GitHub Action?
    Thanks!
    Sebastian J.
    @derjust

    Hi!
    I'm using Micronaut 2.0.0-M3 & Graal-CE 20.1.0 but getting the below CNF trying to DNS lookup via InitialContext running my native-image.
    It works running in JIT/JDK.

    Caused by: java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory
      at com.oracle.svm.core.hub.ClassForNameSupport.forName(ClassForNameSupport.java:60)
      at java.lang.Class.forName(DynamicHub.java:1207)
      at com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:123)
      at com.sun.naming.internal.VersionHelper.loadClass(VersionHelper.java:96)
      at javax.naming.spi.NamingManager.getFactory(NamingManager.java:746)

    I have this on my application class:

    @TypeHint(
        typeNames = {"com.sun.jndi.dns.DnsContextFactory"},
        accessType = TypeHint.AccessType.ALL_PUBLIC)

    and reflection-config.json contains

    {
      "name" : "com.sun.jndi.dns.DnsContextFactory",
      "allDeclaredFields" : true,
      "allPublicMethods" : true,
      "allDeclaredConstructors" : true
    }

    Any thoughts what is missing?

    Remko Popma
    @remkop
    You may want to ask in the Slack channel
    Scroll up for the link
    Thanhpv
    @phamvanthanh
    @spookyvision I have the same problem. Is it resolved?
    Daniel Zou
    @dzou
    In the GraalVM substitution mechanism, could someone clarify the difference between @Alias vs. @Substitute? When would you use one over the other? (I am referring to annotations described here: https://github.com/oracle/graal/blob/master/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/annotate/TargetClass.java )
    Remko Popma
    @remkop
    Hi this channel is abandoned. Everyone moved to Slack. See Link above.
    Amaury
    @amavz_twitter
    Classes that should be initialized at run time got initialized during image building:
     org.apache.logging.slf4j.Log4jLoggerFactory the class was requested to be initialized at run time (from the command line). io.micronaut.http.HttpResponseFactory caused initialization of this class with the following trace:
            at org.apache.logging.slf4j.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java)
            at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:53)
            at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:41)
            at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
            at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
            at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
            at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
            at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
            at io.micronaut.http.DefaultHttpFactories.<clinit>(DefaultHttpFactories.java:37)
            at io.micronaut.http.HttpResponseFactory.<clinit>(HttpResponseFactory.java:29)
    any idea of ​​this error? trying to build native-image with slf4j dependency
    Args = --no-fallback \
           -H:+TraceClassInitialization \
           -H:+PrintClassInitialization \
           -H:+ReportExceptionStackTraces \
           -H:DynamicProxyConfigurationResources=${.}/proxy-config.json \
           -H:ReflectionConfigurationResources=${.}/reflect-config.json \
           -H:IncludeResources=log4j2.xml|application.yml \
           -H:Name=email-verify \
           -H:Class=io.micronaut.function.aws.runtime.MicronautLambdaRuntime \
           --report-unsupported-elements-at-runtime 
           --initialize-at-run-time=org.apache.logging.slf4j
    native-image properties
    Olivier Deckers
    @olivierdeckers
    I built a native image in a docker container on OSX, which runs fine. However, when I start it on my linux cloud instance, it immediately exits with the error "Failed to create a new Isolate (code 9)". Is this a known problem?
    I can't find any docs or issues that mention this code 9 or what it means
    Olivier Deckers
    @olivierdeckers
    It turns out that even though the application doesn't use a lot of memory, it was failing because it couldn't map a sufficiently large block of memory