Skip to content

Two types of vectordatabase are imported into the project pom.xml. When starting the project, an error is reported, indicating that vectorstore has been defined. #3385

Open
@chenm202501

Description

@chenm202501

项目中导入了两种向量数据库,项目启动不了,提示vectorstore已经定义。

<dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-starter-vector-store-cassandra</artifactId>
        </dependency>
<dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-starter-vector-store-redis</artifactId>
        </dependency>

Bug description
报错如下:

Description:

The bean 'vectorStore', defined in class path resource [org/springframework/ai/vectorstore/redis/autoconfigure/RedisVectorStoreAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [com/houmong/emp/imcp/ai/demo/VectorStoreConfiguration.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Environment
Spring AI 1.0.0

有个spring.ai.vectorstore.type配置项可以指定向量数据库的类型,指定后自动配置应该就会跳过,不知为啥application.yml里没有,这个应该怎么配置。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions