by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    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
    I added swap space and now it works
    Mariano de Achaval
    @machaval
    Hi does anyone knows if there is any way to debug what classes end up in the generated native image. I want to know why my binary end up being so big
    Mariano de Achaval
    @machaval
    Dulvin Witharane
    @dulvinw
    Any idea of this Caused by: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.svm.core.util.VMError$HostedError: Detected previously intrinsified element.
    kiransterling
    @kiransterling
    Hi, I have build native image of my java application. When I tried to run docker run -p 8080:8080 applicationName, it failed with no JAVA_HOME set
    this is my Dockerfile

    FROM oracle/graalvm-ce:20.1.0-java8 as graalvm
    RUN gu install native-image

    COPY . /home/app/o2a-java-serverless-ref-impl
    WORKDIR /home/app/o2a-java-serverless-ref-impl

    RUN native-image --no-server -cp target/o2a-java-serverless-ref-impl-*.jar

    FROM frolvlad/alpine-glibc
    RUN apk update && apk add libstdc++
    EXPOSE 8080
    COPY --from=graalvm /home/app/o2a-java-serverless-ref-impl/o2a-java-serverless-ref-impl /app/o2a-java-serverless-ref-impl
    ENTRYPOINT ["/app/o2a-java-serverless-ref-impl"]

    Halim Dev
    @halimpuckjava
    hi dev
    Halim Dev
    @halimpuckjava
    i have some issue with spring graal natve native image, i think my JAVA_HOME path is pointed to graalvm (echo $JAVA_HOME = /home/halim/.sdkman/candidates/java/20.1.0.r11-grl) so when try to create native image an issue appear when maven native image try to craete this native image for me : native-image-maven-plugin: required class missing jdk/vm/ci/services/Services)
    IvoAdrian
    @IvoAdrian

    Hi Guys, I'm trying to run an application that uses a TcpClient from reactor.netty.tcp. When I try to build the native image, I get the following error:
    io.netty.util.AbstractReferenceCounted the class was requested to be initialized at build time (from the command line). io.netty.util.AbstractReferenceCounted caused initialization of this class with the following trace:
    at io.netty.util.AbstractReferenceCounted.<clinit>(AbstractReferenceCounted.java)
    ...

    Why is that?
    Is there an example project, which uses a TcpClient?
    And if it does not work at all, is there another Reactive Streams Tcp Client, which works with native image?

    Oleksandr
    @giova333

    Hi. I'm using ImageIO for image manipulation and getting java.lang.UnsatisfiedLinkError: com.sun.imageio.plugins.jpeg.JPEGImageReader.initJPEGImageReader()
    at runtime. Is there any way to solve this issue?
    I've tried to add:

    {
        "name" : "com.sun.imageio.plugins.jpeg.JPEGImageReader",
        "allDeclaredConstructors" : true,
        "allPublicConstructors" : true,
        "allDeclaredMethods" : true,
        "allPublicMethods" : true,
        "methods" : [
          { "name" : "initJPEGImageReader", "parameterTypes" : [] }
        ]

    to jni-config.json but that didn't help

    Oleksandr
    @giova333
    Helpful chat, I would say =)
    Remko Popma
    @remkop
    This channel is abandoned. Everyone moved to Slack: https://www.graalvm.org/slack-invitation/
    This channel should be closed.
    Oleksandr
    @giova333
    @remkop Thanks, good to know