Answer the question
In order to leave comments, you need to log in
Why did the Spring project start throwing an error?
I wrote a site on spring mvc, everything worked fine and now, after a few months, I decided to return to it and refine it, but I start the project and I get an error:
org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'securityController' for bean class [com.lunchforyou.site.SecurityController] conflicts with existing, non-compatible bean definition of same name and class [com.lunchforyou.site.security.SecurityController]
org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner .java:320)
org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:259)
org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse
(ComponentScanBeanDefinitionParser.java:87)
org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:74)
parseCustomElement(BeanDefinitionParserDelegate.java:1427)
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(
BeanDefinitionParserDelegate.java:1417
)
springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:144)
org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(
DefaultBeanDefinitionDocumentReader.java:100
)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(
XmlBeanDefinitionReader.java:336
)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(
AbstractBeanDefinitionReader.java:217
)
XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory
(AbstractRefreshableApplicationContext.org
springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:452)
org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663
) java:629)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548)
org.springframework.web.servlet.FrameworkServlet. initServletBean(FrameworkServlet.java:489)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor. java:1079)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
java.util.concurrent. ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread. java:745)
I have a com.lunchforyou.site.SecurityController class, but there is not and never was a com.lunchforyou.site.security.SecurityController class.
Moreover, if I remove the @controller annotation from it, it gives exactly the same error, but for a different class com.lunchforyou.site.UserController and com.lunchforyou.site.user.UserController, respectively, I have the first one, and the second never It was. Etc.
What could be the reason?
Answer the question
In order to leave comments, you need to log in
org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'securityController' for bean class [com.lunchforyou.site.SecurityController] conflicts with existing, non-compatible bean definition of same name and class [com.lunchforyou.site .security.SecurityController] ok
google: stackoverflow.com/questions/13801359/annotation-sp...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question