Giter Club home page Giter Club logo

Comments (4)

paulcwarren avatar paulcwarren commented on May 28, 2024

Hi @AkshathSai,
I tried to repro this using one of the getting started guides and I am unable to. That seems to produce a native image - although I am not sure it works.

Any chance you have a project that shows the problem?

from spring-content.

AkshathSai avatar AkshathSai commented on May 28, 2024

Hi Paul, thx for considering this issue. You may use this attached stripped down sample replica project, the command used for native image compilation "mvn -Pnative native:compile"

tunes.zip

from spring-content.

paulcwarren avatar paulcwarren commented on May 28, 2024

Thanks. That's helpful. I took a look at this and the compilation error is spring-aot generated code which is obviously to do with producing the native image. Probably not adding much value by stating that alone.

As I understand it native images operate with a "closed world" principle where, in Spring terms, all beans need to be known ahead of time during compilation.

Spring in general and by implication Spring Data and Spring Content rely heavily on runtime reflection to generate proxy classes that act as the implementation for your musicRepo and musicStore (amoungst other things).

Digging into Spring Data I can see that they have added a bunch AotProcessor classes like this one for example. I am 99% sure are there to help the Spring Aot Processor generate the right BeanDefinition classes for an application.

Spring Content does not have any of these yet and therefore we can probably be reasonably confident in sayng that Spring Content does not yet support Spring Native.

At this point I don't have the first clue what those Spring Data Aot Processor classes are doing. I can guess but that about it. So I'll need to really dig into those and try and understand them as best I can. Then see if I can replicate that behavior in Spring Content. But that might take a while I am afraid.

from spring-content.

AkshathSai avatar AkshathSai commented on May 28, 2024

Thank you for the detailed explanation. It's clear that the issue I'm facing is due to the absence of AotProcessor classes in Spring Content, which are essential for Spring AOT to generate the right BeanDefinition classes for an application. Your insight that Spring Content doesn't support Spring Native yet is enlightening.

I understand the "closed world" principle of native images. Indeed, Spring, and by extension, Spring Data and Spring Content, heavily rely on runtime reflection to generate proxy classes that act as the implementation for repositories and stores. The lack of support for this in Spring Content when using Spring Native is the root of the problem.

I appreciate your willingness to dive deeper into the Spring Data AotProcessor classes despite your unfamiliarity with them. Your commitment to understand these classes and try to replicate their behavior in Spring Content is commendable.

I understand that this process might take some time. I thank you in advance for your efforts and look forward to updates on this issue. In the meantime, I will continue to play around in my project and keep track of updates on Spring Native's support for Spring Content.

Once again, thank you for your assistance and the time you've dedicated for considering this issue.

from spring-content.

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.