2016-05-03 至 2015-05-31錯誤總結

錯誤:at least 1 bean which qualifies as autowire candidate for this dependency.
bean注入忘了在對應注入類上加註解



org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring.xml]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'errorController' for bean class [com.diligrp.website.util.web.exception.ErrorController] conflicts with existing, non-compatible bean definition of same name and class [com.diligrp.util.base.web.exception.ErrorController]

因爲在掃描包的時候,com.diligrp 所以下面都進來了。

修改一下controller裏面的包的請求路徑
@RequestMapping({"/error500"})
解決方法,排除單個類的加載
<context:component-scan base-package="com.diligrp">
<context:exclude-filter type="regex" expression="com.diligrp.util.base.web.exception.ErrorController"></context:exclude-filter>
</context:component-scan>


org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [spring.xml]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'errorController' for bean class [com.diligrp.website.util.web.exception.ErrorController] conflicts with existing, non-compatible bean definition of same name and class [com.diligrp.util.base.web.exception.ErrorController]

因爲在掃描包的時候,com.diligrp 所以下面都進來了。

修改一下controller裏面的包的請求路徑
@RequestMapping({"/error500"})

<context:component-scan base-package="com.diligrp">
<context:exclude-filter type="regex" expression="com.diligrp.util.base.web.exception.ErrorController"></context:exclude-filter>
</context:component-scan>

style="z-index: 10;

hosts的切換問題也導致自己以爲數據問題,浪費了很多調試時間

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章