GithubHelp home page GithubHelp logo

spring aot compile doesnot process jedis-HostandPort class which cause below exception when packaging can somebody tell me how to fix about spring-aot-smoke-tests HOT 4 CLOSED

sintoku921 avatar sintoku921 commented on May 20, 2024
spring aot compile doesnot process jedis-HostandPort class which cause below exception when packaging can somebody tell me how to fix

from spring-aot-smoke-tests.

Comments (4)

wilkinsona avatar wilkinsona commented on May 20, 2024

You appear to be trying to bind configuration properties directly to redis.clients.jedis.HostAndPort. That won't work in a native image as the class has not been compiled with -parameters. Rather than binding directly to HostAndPort you should bind properties to a class that you control and can compile with -parameters. An instance of HostAndPort can then be created from the instance of your own class.

If you have any further questions, please follow up on Stack Overflow or Gitter. We prefer to use GitHub issues only for bugs and enhancements.

from spring-aot-smoke-tests.

sintoku921 avatar sintoku921 commented on May 20, 2024

You appear to be trying to bind configuration properties directly to redis.clients.jedis.HostAndPort. That won't work in a native image as the class has not been compiled with -parameters. Rather than binding directly to HostAndPort you should bind properties to a class that you control and can compile with -parameters. An instance of HostAndPort can then be created from the instance of your own class.

If you have any further questions, please follow up on Stack Overflow or Gitter. We prefer to use GitHub issues only for bugs and enhancements.

do you mean i create a sub class as extends HostandPort class ,and try to compile ? thks and i will try and get a response

from spring-aot-smoke-tests.

sintoku921 avatar sintoku921 commented on May 20, 2024

i have used a dataClass init configuration for jedis config insteadof use HostAndPort class directly,like below ,but the exeception still ouucred while native compiling .

@ConfigurationProperties(prefix = "jedis")
@Data
public class RedisConfigProperties {
   
    // host list
    private List<RedisHost> hosts = new ArrayList<>();

    @Data
    public static class RedisHost{
        private String host;
        private int port;
    }
    
    public Set<HostAndPort> getRedisHosts(){
        return new HashSet<>(U.map(hosts, o -> new HostAndPort(o.getHost(), o.getPort())));
    }
}

from spring-aot-smoke-tests.

scottfrederick avatar scottfrederick commented on May 20, 2024

As Andy stated above:

If you have any further questions, please follow up on Stack Overflow or Gitter. We prefer to use GitHub issues only for bugs and enhancements.

Please post your question as suggested, with as much detail and sample code as possible so that the community can try to help you.

from spring-aot-smoke-tests.

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.