Giter Club home page Giter Club logo

native-image-test's Introduction

Using the minimal agent in this repo

Build the agent and app jars, and then build the native image:

native-image -J-javaagent:agent/target/native-image-agent-1.0-SNAPSHOT.jar \
             -jar app/target/native-image-app-1.0-SNAPSHOT.jar

Using Glowroot

To build the native image with glowroot, first build glowroot (trask/native-image branch), and unzip it into this directory.

unzip -o -d ../glowroot/agent/dist/target/glowroot-agent-0.14.0-beta.3-SNAPSHOT-dist.zip

and then build the native image:

native-image --initialize-at-build-time=org.glowroot.agent,sun.instrument.InstrumentationImpl \
             --initialize-at-run-time=org.glowroot.agent.shaded.io.netty \
             --allow-incomplete-classpath \
             -J-javaagent:glowroot/glowroot.jar \
             -jar app/target/native-image-app-1.0-SNAPSHOT.jar

it should build, but running the image currently fails with

java.lang.ExceptionInInitializerError
        at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:315)
        at java.lang.Class.ensureInitialized(DynamicHub.java:548)
        at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:260)
        at org.glowroot.agent.init.NettyInit.run(NettyInit.java:63)
        at org.glowroot.agent.embedded.init.EmbeddedGlowrootAgentInit$1.run(EmbeddedGlowrootAgentInit.java:75)
        at org.glowroot.agent.impl.BytecodeServiceImpl.enteringMainMethod(BytecodeServiceImpl.java:255)
        at org.glowroot.agent.impl.BytecodeServiceImpl.enteringMainMethod(BytecodeServiceImpl.java:77)
        at org.glowroot.agent.bytecode.api.Bytecode.enteringMainMethod(Bytecode.java:37)
        at com.github.trask.app.Main.main(Main.java)
Caused by: java.lang.IllegalArgumentException: Can't find '[toLeakAwareBuffer]' in org.glowroot.agent.shaded.io.netty.buffer.AbstractByteBufAllocator
        at org.glowroot.agent.shaded.io.netty.util.ResourceLeakDetector.addExclusions(ResourceLeakDetector.java:577)
        at org.glowroot.agent.shaded.io.netty.buffer.AbstractByteBufAllocator.<clinit>(AbstractByteBufAllocator.java:36)
        at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:375)
        at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:295)
        ... 8 more

native-image-test's People

Contributors

trask avatar

Watchers

 avatar  avatar

Forkers

kittylyst

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.