Bug description Our project stopped building sometime in the last few days. We are using the snapshot version, as recommended in the docs. ~~We tried pinning it to the recently released M3 and had the same issues. We have different issues with the M2 release due to changes in the code contracts that are fixable but frustrating.~~ The M3 issue was something else

Environment org.springframework.ai:spring-ai-bom:1.0.0-SNAPSHOT

implementation 'org.springframework.ai:spring-ai-bedrock-ai-spring-boot-starter'

We are using 'org.springframework.boot' version '3.3.5'

Steps to reproduce Try to build the spring AI SNAPSHOT with the org.springframework.ai:spring-ai-bedrock-ai-spring-boot-starter java.lang.IllegalStateException: Error processing condition on org.springframework.ai.autoconfigure.bedrock.converse.BedrockConverseProxyChatAutoConfiguration.bedrockProxyChatModel at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60) at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:183) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144) at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:429) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:290) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:118) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:789) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:607) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137) at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1463) at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:553) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:137) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:108) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:225) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:152) ... 17 more Caused by: java.lang.IllegalStateException: @ConditionalOnMissingBean did not specify a bean using type, name or annotation and the attempt to deduce the bean's type failed at org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.validate(OnBeanCondition.java:515) at org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.<init>(OnBeanCondition.java:463) at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:156) at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ... 39 more Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for org.springframework.ai.autoconfigure.bedrock.converse.BedrockConverseProxyChatAutoConfiguration.bedrockProxyChatModel at app//org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.deducedBeanTypeForBeanMethod(OnBeanCondition.java:545) at app//org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.deducedBeanType(OnBeanCondition.java:534) at app//org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.<init>(OnBeanCondition.java:456) ... 41 more Caused by: java.lang.ClassNotFoundException: org.springframework.ai.bedrock.converse.BedrockProxyChatModel at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:467) at org.springframework.boot.autoconfigure.condition.FilteringSpringBootCondition.resolve(FilteringSpringBootCondition.java:108) at org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.getReturnType(OnBeanCondition.java:553) at org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.deducedBeanTypeForBeanMethod(OnBeanCondition.java:541) ... 43 more

Expected behavior That it would build. If there was a breaking change that how to fix it would be communicated somewhere easy to find and easy to fix.

Comment From: zlemisie

works when I switch to org.springframework.ai:spring-ai-bom:1.0.0-M3

Comment From: markpollack

The root cause says java.lang.ClassNotFoundException: org.springframework.ai.bedrock.converse.BedrockProxyChatModel yet that class is indeed in the snapshot code. Perhaps there is some dependnecy/project clean up that you need to do on your project?

Comment From: bronwyn-damm

Perhaps, we haven't changed any of our dependencies over the time that spring.ai broke. The M3 version works. What dependencies did spring.ai change since then that we should know about and fix on our end?

Comment From: ilayaperumalg

Hi @bronwyn-damm, The Spring AI BOM is up-to-date with both the dependencies needed for Bedrock Converse API:

Model:

            <dependency>
                <groupId>org.springframework.ai</groupId>
                <artifactId>spring-ai-bedrock</artifactId>
                <version>${project.version}</version>
            </dependency>

Spring Boot Starter for Bedrock Converse AutoConfiguration:

            <dependency>
                <groupId>org.springframework.ai</groupId>
                <artifactId>spring-ai-bedrock-converse-spring-boot-starter</artifactId>
                <version>${project.version}</version>
            </dependency>

You should be able to build against the snapshot with spring-ai-bedrock-converse-spring-boot-starter.

Comment From: ilayaperumalg

@bronwyn-damm I notice the dependency name for boot starter you use here: org.springframework.ai:spring-ai-bedrock-ai-spring-boot-starter is incorrect as it should be org.springframework.ai:spring-ai-bedrock-converse-spring-boot-starter

Comment From: bronwyn-damm

@ilayaperumalg We are not attempting to use amazon converse, we are using the correct dependency as documented here: https://docs.spring.io/spring-ai/reference/api/chat/bedrock/bedrock-anthropic3.html#_auto_configuration Are you saying that this dependency is now broken?

Comment From: ilayaperumalg

Hi @bronwyn-damm, Thanks for the clarification. In your case, the recently added Bedrock Converse AutoConfiguration is also enabled along with BedrockAnthropic3ChatAutoConfiguration. Meanwhile, to fix this, you need to exclude the BedrockConverseProxyChatAutoConfiguration in your code. I will have a PR shortly to address this as well.

Comment From: tzolov

@bronwyn-damm, sorry for the inconvenience. We did a mistake in our bedrock-converse auto-config enabling logic, addressed as a part off: https://github.com/spring-projects/spring-ai/pull/1699 In the meantime as a workaround set the spring.ai.bedrock.converse.chat.enabled=false.

Comment From: bronwyn-damm

@tzolov Thank you, this is helpful. It is also wonderful to see that the bedrock streaming error handling is getting looked at, we had an error that caused an infinite loop in our code just a couple of weeks ago with that while loop!