【问题标题】:Transferring the bean class to another package将 bean 类转移到另一个包
【发布时间】:2018-04-04 00:19:02
【问题描述】:

我在security 包中的web 模块中有AuthorizationServiceImpl 类,即bean https://github.com/JonkiPro/REST-Web-Services/blob/master/web/src/main/java/com/web/web/security/service/impl/AuthorizationServiceImpl.java。在我最新版本的项目中,我将AuthorizationServiceAuthorizationServiceImpl 类移动到core 模块。您可以在屏幕https://zapodaj.net/866eab42f00f0.png.html 上看到它。但是,IntelliJ 在编译过程中会抛出一个错误

2018-04-04 02:10:15.578  WARN 1688 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.web.WebApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'authorizationService' for bean class [com.core.service.impl.AuthorizationServiceImpl] conflicts with existing, non-compatible bean definition of same name and class [com.web.web.security.service.impl.AuthorizationServiceImpl] As if IntelliJ did not know that I moved the class to another package and throws me into conflict with the previous place, but the class is not there anymore.

如何让 IntelliJ 知道类已被移动?

【问题讨论】:

    标签: java spring


    【解决方案1】:

    这是你在第 1 行的问题:

    package com.web.web.security.service.impl;

    【讨论】:

    • 您尝试过重建项目吗?看起来 web 目录中的 src 文件不是最新的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-25
    • 1970-01-01
    相关资源
    最近更新 更多