• org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL


    【报错】

    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [file:/F:/MyWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marbled-cat/WEB-INF/classes/spring-servlet.xml]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'merchantController' for bean class [org.mcc.merchant.controller.MerchantController] conflicts with existing, non-compatible bean definition of same name and class [org.mcc.campus.manager.controller.MerchantController]
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:414)

    【可能产生原因】

    不同的package里有两个名字相同的类,只是类所在的目录不同。

    【解决方法】

    spring管理bean大概类似把bean实例化放到map中,它会以配置的id和name(如果配置的话)为key存放起来,

    2个一样的肯定要成冲突,应该给他们换个名字就成啦

    类似于

    controller("systemHomeController")
    controller("moduleHomeController")
    

      

  • 相关阅读:
    c#剪切板操作
    eclipse mvn build error tips
    Redis Tips
    IntilliJ Idea 使用中的问题与解决方案
    mongo
    python
    SQL Relative
    sybase update
    run current vim file
    git
  • 原文地址:https://www.cnblogs.com/frankielf0921/p/9276139.html
Copyright © 2020-2023  润新知