Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring ai module affect bean creation order of hillaEndpointObjectMapper and endpointInvoker #3092

Closed
Farley-Chen opened this issue Dec 28, 2024 · 2 comments · Fixed by #3098
Assignees
Labels
bug Something isn't working hilla Issues related to Hilla

Comments

@Farley-Chen
Copy link

Describe the bug

In EndpointControllerConfiguration, hillaEndpointObjectMapper must create before endpointInvoker, but when I add spring-ai-zhipuai-spring-boot-starter in maven, endpointInvoker create before hillaEndpointObjectMapper with wrong objectmapper.

By debug, it seems that JacksonAutoConfiguration create a default objectmapper before hillaEndpointObjectMapper and endpointInvoker.

So endpointInvoker use default objectmapper.

Expected-behavior

hillaEndpointObjectMapper should create before endpointInvoker, otherwise ByteArrayModule will not be registed.

Reproduction

  1. create a vaadin project use starter
  2. add in maven pom.xml
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-zhipuai-spring-boot-starter</artifactId>
    <version>1.0.0-SNAPSHOT</version>
</dependency>

and

<repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/snapshot</url>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
  1. add break point in following places

JacksonAutoConfiguration 132 row
image
EndpointControllerConfiguration 118 row and 161 row
image
image

  1. you will found differet order between add maven pom.xml before and after

System Info

windows 11
hilla 24.6.0

@Farley-Chen Farley-Chen added bug Something isn't working hilla Issues related to Hilla labels Dec 28, 2024
@Farley-Chen
Copy link
Author

By the way, in hilla 24.5.6, there is no problem because endpointInvoker use JacksonObjectMapperFactory instead of hillaEndpointObjectMapper

@cromoteca
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hilla Issues related to Hilla
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants