Bladex-boot版 依赖中mongodb, 无法启动

Blade 未结 2 2781
猫
剑童 2019-11-02 17:10






一、该问题的重现步骤是什么?

1.  pom中添加依赖 



<dependency>

    <groupId>org.springframework.boot</groupId>

    <artifactId>spring-boot-starter-data-mongodb</artifactId>

</dependency>


2. config包中添加mongo配置

@Configuration
@EnableMongoRepositories(basePackages = "org.springblade.modules.**.repository")
public class MongoConfig {

}

3.新建一个实体, 和repository

@Data
public class TestUser implements Serializable {

   @Id
   private Long userId;

   private String userName;

   private Integer age;
}
@Repository
public interface UserRepository extends MongoRepository<TestUser, Long> {

}

二、你期待的结果是什么?实际看到的又是什么?

期待能使用, 结果启动报错,


org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'org.springblade.modules.system.repository.UserRepository': 
 Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: 
 Failed to instantiate [org.springblade.modules.system.repository.UserRepository]: 
 Specified class is an interface


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

产品: BladeX-boot

版本: 2.2.0.RELEASE

系统: win10


四、请提供详细的错误堆栈信息,这很重要。

org.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'org.springblade.modules.system.repository.UserRepository': 
 Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: 
 Failed to instantiate [org.springblade.modules.system.repository.UserRepository]: 
 Specified class is an interface


五、若有更多详细信息,请在下面提供。


我重新自己新建一个项目, 按上面步骤操作是可以启动并且能使用mongodb数据库的, 所以不知道有BladeX-boot 配置方面有什么差异







2条回答
  • 2019-11-04 13:08

    到私服的bladex-tool项目发一个issue,后续会修复排查

    0 讨论(0)
  • 2023-09-05 10:16

    请问这个问题解决了吗?我也遇到了。

    0 讨论(0)
提交回复