spring-projects / spring-ai

An Application Framework for AI Engineering
https://docs.spring.io/spring-ai/reference/index.html
Apache License 2.0
3.26k stars 836 forks source link

Error creating bean with name 'retryTemplate' defined in class path resource [org/springframework/ai/autoconfigure/retry/SpringAiRetryAutoConfiguration.class]: #546

Closed Jeffrey-Dozva closed 5 months ago

Jeffrey-Dozva commented 7 months ago

Bug description When i try run my code this is the error thats returned ` org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'retryTemplate' defined in class path resource [org/springframework/ai/autoconfigure/retry/SpringAiRetryAutoConfiguration.class]: Failed to instantiate [org.springframework.retry.support.RetryTemplate]: Factory method 'retryTemplate' threw exception with message: org/springframework/ai/retry/NonTransientAiException at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:659) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:647) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1332) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1162) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:941) ~[spring-context-6.0.9.jar:6.0.9] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.9.jar:6.0.9] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.0.jar:3.1.0] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:733) ~[spring-boot-3.1.0.jar:3.1.0] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:435) ~[spring-boot-3.1.0.jar:3.1.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) ~[spring-boot-3.1.0.jar:3.1.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1305) ~[spring-boot-3.1.0.jar:3.1.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1294) ~[spring-boot-3.1.0.jar:3.1.0] at com.wellbayt.engine.EngineApplicationKt.main(EngineApplication.kt:81) ~[main/:na] Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.retry.support.RetryTemplate]: Factory method 'retryTemplate' threw exception with message: org/springframework/ai/retry/NonTransientAiException at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171) ~[spring-beans-6.0.9.jar:6.0.9] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655) ~[spring-beans-6.0.9.jar:6.0.9] ... 19 common frames omitted Caused by: java.lang.NoClassDefFoundError: org/springframework/ai/retry/NonTransientAiException at org.springframework.ai.autoconfigure.retry.SpringAiRetryAutoConfiguration.retryTemplate(SpringAiRetryAutoConfiguration.java:55) ~[spring-ai-spring-boot-autoconfigure-0.8.1-SNAPSHOT.jar:0.8.1-SNAPSHOT] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:139) ~[spring-beans-6.0.9.jar:6.0.9] ... 20 common frames omitted Caused by: java.lang.ClassNotFoundException: org.springframework.ai.retry.NonTransientAiException at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[na:na] ... 26 common frames omitted

Process finished with exit code 1

`

Environment Java: 17 Springboot: 3.1.0 dependencyManagement { imports { mavenBom("org.springframework.ai:spring-ai-bom:0.8.1-SNAPSHOT") } } dependencies { implementation("org.springframework.ai:spring-ai-azure-openai-spring-boot-starter") }

Steps to reproduce When I start my springboot application it crashes with the error above When i send a simple promp for openai to respond with yes if its ready to assist. it returns yes. This means my configuration is okay and i can call the model

Expected behavior Application cannot start up. It crashes

Minimal Complete Reproducible example Please provide a failing test or a minimal complete verifiable example that reproduces the issue. Bug reports that are reproducible will take priority in resolution over reports that are not reproducible.

shashikanth-gs commented 7 months ago

@Jeffrey-Dozva, looks like a bug in pom. a transitive dependency is not pulled in. Providing the below dependency resolved the issue for me.

org.springframework.ai spring-ai-retry 0.8.1-SNAPSHOT
Jeffrey-Dozva commented 7 months ago

@shashikanth-gs

after adding the above library getting this error


APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.ai.autoconfigure.retry.SpringAiRetryAutoConfiguration.retryTemplate(SpringAiRetryAutoConfiguration.java:57)

The following method did not exist:

'org.springframework.retry.support.RetryTemplateBuilder org.springframework.retry.support.RetryTemplateBuilder.exponentialBackoff(java.time.Duration, double, java.time.Duration)'

The calling method's class, org.springframework.ai.autoconfigure.retry.SpringAiRetryAutoConfiguration, was loaded from the following location:

jar:file:/Users/jeffrey/.gradle/caches/modules-2/files-2.1/org.springframework.ai/spring-ai-spring-boot-autoconfigure/0.8.1-SNAPSHOT/82c1746defff35f7705490b0ecf36d9fde569755/spring-ai-spring-boot-autoconfigure-0.8.1-SNAPSHOT.jar!/org/springframework/ai/autoconfigure/retry/SpringAiRetryAutoConfiguration.class

The called method's class, org.springframework.retry.support.RetryTemplateBuilder, is available from the following locations:

jar:file:/Users/jeffrey/.gradle/caches/modules-2/files-2.1/org.springframework.retry/spring-retry/2.0.1/7251dcd778aa5338f0866bf8cfbb80f3f2058d97/spring-retry-2.0.1.jar!/org/springframework/retry/support/RetryTemplateBuilder.class

The called method's class hierarchy was loaded from the following locations:

org.springframework.retry.support.RetryTemplateBuilder: file:/Users/jeffrey/.gradle/caches/modules-2/files-2.1/org.springframework.retry/spring-retry/2.0.1/7251dcd778aa5338f0866bf8cfbb80f3f2058d97/spring-retry-2.0.1.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.ai.autoconfigure.retry.SpringAiRetryAutoConfiguration and org.springframework.retry.support.RetryTemplateBuilder

Process finished with exit code 1

rajadilipkolli commented 7 months ago

spring-ai-ollama-spring-boot-starter also has similar issue, whereas spring-ai-openai-spring-boot-starter has first class support for this. Perhaps should visit all starters once for retry

tzolov commented 7 months ago

Hi @Jeffrey-Dozva , I'm afraid that Boot 3.1.x does not support the RestClient library used internally by Spring AI. Please, update to Spring Boot 3.2.x better (3.2.4) and let me know if this issue is still present.

faruzanCN commented 7 months ago

Hi @Jeffrey-Dozva , I'm afraid that Boot 3.1.x does not support the RestClient library used internally by Spring AI. Please, update to Spring Boot 3.2.x better (3.2.4) and let me know if this issue is still present.

When I use spring-ai-ollama-spring-boot-starter, an exception occurs: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'retryTemplate' defined in class path resource [org/springframework/ai/autoconfigure/retry/SpringAiRetryAutoConfiguration.class]: Failed to instantiate [org.springframework.retry.support.RetryTemplate]: Factory method 'retryTemplate' threw exception with message: org/springframework/ai/retry/NonTransientAiException. My Springboot version is 3.2.4, spring-ai-bom version is 0.8.1-SNAPSHOT.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'retryTemplate' defined in class path resource [org/springframework/ai/autoconfigure/retry/SpringAiRetryAutoConfiguration.class]: Failed to instantiate [org.springframework.retry.support.RetryTemplate]: Factory method 'retryTemplate' threw exception with message: org/springframework/ai/retry/NonTransientAiException at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:648) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1335) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1165) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962) ~[spring-context-6.1.5.jar:6.1.5] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624) ~[spring-context-6.1.5.jar:6.1.5] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.4.jar:3.2.4] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.4.jar:3.2.4] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.4.jar:3.2.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.4.jar:3.2.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.4.jar:3.2.4] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.4.jar:3.2.4] at com.luvletter.faruzanserver.FaruzanServerApplication.main(FaruzanServerApplication.java:16) ~[classes/:na] Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.retry.support.RetryTemplate]: Factory method 'retryTemplate' threw exception with message: org/springframework/ai/retry/NonTransientAiException at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:177) ~[spring-beans-6.1.5.jar:6.1.5] at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:644) ~[spring-beans-6.1.5.jar:6.1.5] ... 19 common frames omitted Caused by: java.lang.NoClassDefFoundError: org/springframework/ai/retry/NonTransientAiException at org.springframework.ai.autoconfigure.retry.SpringAiRetryAutoConfiguration.retryTemplate(SpringAiRetryAutoConfiguration.java:55) ~[spring-ai-spring-boot-autoconfigure-0.8.1-20240312.174040-75.jar:0.8.1-SNAPSHOT] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na] at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140) ~[spring-beans-6.1.5.jar:6.1.5] ... 20 common frames omitted Caused by: java.lang.ClassNotFoundException: org.springframework.ai.retry.NonTransientAiException at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) ~[na:na] at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) ~[na:na] at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[na:na] ... 26 common frames omitted

tzolov commented 7 months ago

Thanks for the clarification @Jeffrey-Dozva , but please switch to 1.0.0-SNAPSHOT. I know it is strange but the continuation after the 0.8.1 milestone will be 1.0.0-M1 milestone and the 1.0.0-SNAPSHOT is the snapshot in between. The 0.8.1-SNAPSHOT is invalid or at best the same as 0.8.1

faruzanCN commented 7 months ago

Thanks for the clarification @Jeffrey-Dozva , but please switch to 1.0.0-SNAPSHOT. I know it is strange but the continuation after the 0.8.1 milestone will be 1.0.0-M1 milestone and the 1.0.0-SNAPSHOT is the snapshot in between. The 0.8.1-SNAPSHOT is invalid or at best the same as 0.8.1

I use 1.0.0-SNAPSHOT and "Error creating bean with name 'retryTemplate' defined in class path resource [org/springframework/ai/autoconfigure/retry/SpringAiRetryAutoConfiguration.class]: Failed to instantiate [org.springframework.retry.support.RetryTemplate]: Factory method 'retryTemplate' threw exception with message: org/springframework/ai/retry/NonTransientAiException", I think it might be a conflict with bean retryTemplate. image

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.2.4</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.luvletter</groupId>
<artifactId>faruzanServer</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>faruzanServer</name>
<description>faruzanServer</description>
<properties>
    <java.version>17</java.version>
</properties>
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.ai</groupId>
        <artifactId>spring-ai-ollama-spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-redis</artifactId>
    </dependency>

    <!--pgsql-->
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
        <version>42.7.3</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
        <version>8.0.33</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jdbc</artifactId>
    </dependency>
    <!--RabbitMQ依赖-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-amqp</artifactId>
    </dependency>

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid-spring-boot-3-starter</artifactId>
        <version>1.2.21</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.mybatis-flex/mybatis-flex-spring-boot-starter -->
    <dependency>
        <groupId>com.mybatis-flex</groupId>
        <artifactId>mybatis-flex-spring-boot3-starter</artifactId>
        <version>1.8.2</version>
    </dependency>
    <dependency>
        <groupId>com.mybatis-flex</groupId>
        <artifactId>mybatis-flex-processor</artifactId>
        <version>1.8.2</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>io.seata</groupId>
        <artifactId>seata-spring-boot-starter</artifactId>
        <version>2.0.0</version>
    </dependency>
    <dependency>
        <groupId>redis.clients</groupId>
        <artifactId>jedis</artifactId>
        <version>3.10.0</version>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <optional>true</optional>
    </dependency>

    <!--引入swagger-->
    <!-- https://mvnrepository.com/artifact/org.springdoc/springdoc-openapi-starter-webmvc-ui -->
    <dependency>
        <groupId>org.springdoc</groupId>
        <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
        <version>2.3.0</version>
    </dependency>

    <dependency>
        <groupId>cn.dev33</groupId>
        <artifactId>sa-token-spring-boot3-starter</artifactId>
        <version>1.35.0.RC</version>
    </dependency>
    <!-- Sa-Token 整合 Redis (使用 jackson 序列化方式) -->
    <dependency>
        <groupId>cn.dev33</groupId>
        <artifactId>sa-token-redis-jackson</artifactId>
        <version>1.35.0.RC</version>
    </dependency>

    <!-- 提供Redis连接池 -->
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-pool2</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 -->
    <dependency>
        <groupId>com.alibaba.fastjson2</groupId>
        <artifactId>fastjson2</artifactId>
        <version>2.0.45</version>
    </dependency>

    <!--TOTP库-->
    <dependency>
        <groupId>dev.samstevens.totp</groupId>
        <artifactId>totp-spring-boot-starter</artifactId>
        <version>1.7.1</version>
    </dependency>
    <!-- Java OTP 依赖 -->
    <dependency>
        <groupId>com.eatthepath</groupId>
        <artifactId>java-otp</artifactId>
        <version>0.4.0</version>
    </dependency>

    <dependency>
        <groupId>cn.hutool</groupId>
        <artifactId>hutool-all</artifactId>
        <version>5.8.25</version>
    </dependency>

    <dependency>
        <groupId>io.minio</groupId>
        <artifactId>minio</artifactId>
        <version>8.5.9</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/net.logstash.logback/logstash-logback-encoder -->
    <dependency>
        <groupId>net.logstash.logback</groupId>
        <artifactId>logstash-logback-encoder</artifactId>
        <version>7.4</version>
    </dependency>

    <dependency>
        <groupId>cn.zhxu</groupId>
        <artifactId>okhttps-jackson </artifactId>
        <version>4.0.2</version>
    </dependency>
    <dependency>
        <groupId>org.lionsoul</groupId>
        <artifactId>ip2region</artifactId>
        <version>2.7.0</version>
    </dependency>
    <!--读写excel-->
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>easyexcel</artifactId>
        <version>3.3.3</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/net.coobird/thumbnailator -->
    <dependency>
        <groupId>net.coobird</groupId>
        <artifactId>thumbnailator</artifactId>
        <version>0.4.20</version>
    </dependency>

    <!-- Spring Boot Actuator for all available endpoints -->
</dependencies>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-bom</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<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>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

walidhsn commented 6 months ago

i had the same problem idk why , first i worked on a project to test the rest api before implementing them in my initial project , i just select azure open ai and spring web ,and spring developer tools , and everything works fine , until i wanted to implement the spring ai in my actual project i had the same pb you had ,even i tried to start another project with the same steps i did before and add my actual project old dependencies the same error appears this time so i canceled that. and return to my own project trying again until i saw the solution of @shashikanth-gs , so i gave it a try and it works :


              <dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-retry</artifactId>
        </dependency>