-
Jan 29th, 2011, 01:37 AM
#1
Annotation-specified bean name conflicts ...
Hi!
I have developed a web app that uses Spring annotations for some time. (Windows7 + Jetty)
But when deploying it to a webserver I encountered a strange problem. (Tomcat6 / Ubuntu 9.04)
Spring complains about conflicts but there really is just a
utskicket.model.dao.AccountNumberDAO and
utskicket.model.dao.impl.AccountNumberDAOImpl class.
But for some reason Spring thinks there is a utskicket.model.dao.AccountNumberDAOImpl ...
Are there any known bugs with the annoation scanning?
And how come it works in Windows/Jetty but not in Tomcat6/Ubuntu ...
Caused by: org.springframework.beans.factory.BeanDefinitionSt oreException: Unexpected exception parsing XML document from class path resource [utskicketAppConfig.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'accountNumberDAOImpl' for bean class [utskicket.model.dao.AccountNumberDAOImpl] conflicts with existing, non-compatible bean definition of same name and class [utskicket.model.dao.finance.AccountNumberDAOImpl]
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:412)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.importBeanDefinitionResour ce(DefaultBeanDefinitionDocumentReader.java:187)
... 65 more
Caused by: java.lang.IllegalStateException: Annotation-specified bean name 'accountNumberDAOImpl' for bean class [utskicket.model.dao.AccountNumberDAOImpl] conflicts with existing, non-compatible bean definition of same name and class [utskicket.model.dao.finance.AccountNumberDAOImpl]
at org.springframework.context.annotation.ClassPathBe anDefinitionScanner.checkCandidate(ClassPathBeanDe finitionScanner.java:274)
at org.springframework.context.annotation.ClassPathBe anDefinitionScanner.doScan(ClassPathBeanDefinition Scanner.java:215)
at org.springframework.context.annotation.ComponentSc anBeanDefinitionParser.parse(ComponentScanBeanDefi nitionParser.java:84)
at org.springframework.beans.factory.xml.NamespaceHan dlerSupport.parse(NamespaceHandlerSupport.java:73)
at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1335)
at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1325)
at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:136)
at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:93)
at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:493)
-
Jan 29th, 2011, 02:00 AM
#2
Ooops I found the problem .. there where two different class files on my linux server. Strange since I just deployed the war from my pc. But now I now how to solve it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules