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

SNAPSHOT do not build for Bedrock #1679

Open
bronwyn-damm opened this issue Nov 5, 2024 · 5 comments
Open

SNAPSHOT do not build for Bedrock #1679

bronwyn-damm opened this issue Nov 5, 2024 · 5 comments
Assignees
Labels

Comments

@bronwyn-damm
Copy link

bronwyn-damm commented Nov 5, 2024

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.

@bronwyn-damm bronwyn-damm changed the title SNAPSHOT and M3 do not build for Bedrock SNAPSHOT do not build for Bedrock Nov 5, 2024
@zlemisie
Copy link

zlemisie commented Nov 5, 2024

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

@markpollack
Copy link
Member

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?

@bronwyn-damm
Copy link
Author

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?

@ilayaperumalg
Copy link
Member

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.

@ilayaperumalg
Copy link
Member

@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

@ilayaperumalg ilayaperumalg self-assigned this Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants