当前位置: 代码迷 >> J2EE >> 1.两个项目出现冲突(急),该如何解决
  详细解决方案

1.两个项目出现冲突(急),该如何解决

热度:168   发布时间:2016-04-22 02:52:07.0
1.两个项目出现冲突(急!!!)
两个项目都是用hibernate、spring、DWR注解架构,用eclipse开发,用maven发布,做完功能之后拿到tomcat发布。
两个项目中相同的位置有同名的文件,以前没事,但是在项目2中添加了的功能之后,再布项目的时候就报错了。(在maven上面不报错,旨在tomcat上面报错)
错误信息如下:
Java code
2011-10-17 9:30:39 org.apache.catalina.core.ApplicationContext log信息: Closing Spring root WebApplicationContext2011-10-17 9:30:54 org.apache.catalina.core.ApplicationContext log信息: Initializing Spring root WebApplicationContext2011-10-17 9:31:07 org.apache.catalina.core.ApplicationContext log信息: Initializing Spring root WebApplicationContext2011-10-17 9:31:10 org.apache.catalina.core.StandardContext listenerStart严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [file:/C:/Tomcat%206.0/webapps/users/WEB-INF/classes/applicationContext.xml]; nested exception is java.lang.IllegalStateException: Annotation-specified bean name 'attributesUsersDaoHibernateImpl' for bean class [com.webapp.model.dao.hibernate.AttributesUsersDaoHibernateImpl] conflicts with existing, non-compatible bean definition of same name and class [com.webapp.fax.model.dao.hibernate.AttributesUsersDaoHibernateImpl]    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)    at org.apache.catalina.core.StandardService.start(StandardService.java:516)    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)    at org.apache.catalina.startup.Catalina.start(Catalina.java:566)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)    at java.lang.reflect.Method.invoke(Method.java:585)    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)Caused by: java.lang.IllegalStateException: Annotation-specified bean name 'attributesUsersDaoHibernateImpl' for bean class [com.webapp.model.dao.hibernate.AttributesUsersDaoHibernateImpl] conflicts with existing, non-compatible bean definition of same name and class [com.webapp.fax.model.dao.hibernate.AttributesUsersDaoHibernateImpl]    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.checkCandidate(ClassPathBeanDefinitionScanner.java:267)    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:208)    at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)    at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)    ... 37 more2011-10-17 9:31:10 org.apache.catalina.core.ApplicationContext log信息: Closing Spring root WebApplicationContext
  相关解决方案