Giter Site home page Giter Site logo

Missing native-image reflection hint for org.springframework.data.mongodb.core.aggregation.AggregationOperation about spring-data-mongodb HOT 8 OPEN

anguzo avatar anguzo commented on May 26, 2024
Missing native-image reflection hint for org.springframework.data.mongodb.core.aggregation.AggregationOperation

from spring-data-mongodb.

Comments (8)

anguzo avatar anguzo commented on May 26, 2024 2

Sure, here is a minimal example. If I remove mongodb from dependencies then project does not throw the mentioned exception when running native executable.

demo.zip

from spring-data-mongodb.

christophstrobl avatar christophstrobl commented on May 26, 2024 1

Thank you @anguzo for the reproducer - GraalVM decides to not include AggregationOperation in the image. However the core framework tries to inspect all methods when creating a proxy for the mongo template. This involves reading method signatures via BridgeMethodResolver and fails because of the removed AggregationOperation.
@sdeleuze is there a way BridgeMethodResolver could be more lenient when resolving parameter types?

from spring-data-mongodb.

snicoll avatar snicoll commented on May 26, 2024 1

Sorry, I overlooked this. I'll check with Christoph.

from spring-data-mongodb.

christophstrobl avatar christophstrobl commented on May 26, 2024

If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

from spring-data-mongodb.

sdeleuze avatar sdeleuze commented on May 26, 2024

Spring Framework is unlikely to change this code path which could introduce regressions on JVM side. I would suggest to add related hints on Spring Data side (and maybe check if other *Operation types are impacted, included outside spring-data-mongodb).

from spring-data-mongodb.

christophstrobl avatar christophstrobl commented on May 26, 2024

Given the number of projects potentially having both reactive and imperative variants manually adding those hints sounds quite cumbersome and error prone. Before we do that, do we know candidates for proxy creation during the AOT phase? If so, we could hook into the processing to add missing types based on method signatures.

from spring-data-mongodb.

sdeleuze avatar sdeleuze commented on May 26, 2024

@snicoll Could you please share with Christoph if that's possible (I am not sure it is)?

from spring-data-mongodb.

spring-projects-issues avatar spring-projects-issues commented on May 26, 2024

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

from spring-data-mongodb.

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.