Giter VIP home page Giter VIP logo

Comments (2)

eduard-vasinskyi avatar eduard-vasinskyi commented on July 23, 2024 1

Hi, @anboo44

You have to properly set up the native-image tool by specifying all reflection access points. You also need to configure your Modal class to be accessible as a resource. Since ActiveJ generates new classes you also need to specify a configuration for predefined classes.

This configuration goes out of the scope of the ActiveJ project and is more of a GraalVM/native-image issue.
I was able to run your example by creating a fat jar and then running a native-image agent with experimental-class-define-support option on it and then using generated configuration files to generate a binary executable.

This works for known classes but unfortunately would not work if your application generates new classes dynamically, since native-image only supports generating predefined classes.

from activej.

anboo44 avatar anboo44 commented on July 23, 2024

@eduard-vasinskyi Thank you so much. The my sample code worked

I note my steps if anyone needs:

  • Build jar file
  • Run command: java -agentlib:native-image-agent=config-output-dir=config,experimental-class-define-support -jar file_name.jar => it will create new folder with name: config
  • In resources, create new folder with name: META-INF and then copy above config folder to META-INF. After that, rename config to native-image
  • Build jar file again
  • Run command: native-image -jar file_name.jar
    => DONE

This works for known classes but unfortunately would not work if your application generates new classes dynamically, since native-image only supports generating predefined classes.
I understand about this. So sad T_T

from activej.

Related Issues (20)

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.