既然选择 就去深入 时间不多 努力就好
无所谓技术 追求高质量 My QQ:370650640
BlogJava
|
首页
|
发新随笔
|
发新文章
|
联系
|
聚合
|
管理
org.hibernate.DuplicateMappingException错误
1
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'
contactDao
'
defined in ServletContext resource [
/
WEB
-
INF
/
applicationContext.xml]: Cannot resolve reference to bean
'
sessionFactory
'
while
setting bean property
'
sessionFactory
'
; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'
sessionFactory
'
defined in ServletContext resource [
/
WEB
-
INF
/
applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.mediaStorage.dto.Menu.userses
2
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:
275
)
3
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:
104
)
4
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:
1244
)
5
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:
1008
)
6
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
470
)
7
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$
1
.run(AbstractAutowireCapableBeanFactory.java:
409
)
8
at java.security.AccessController.doPrivileged(Native Method)
9
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
380
)
10
at org.springframework.beans.factory.support.AbstractBeanFactory$
1
.getObject(AbstractBeanFactory.java:
264
)
11
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
220
)
12
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
261
)
13
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
185
)
14
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
164
)
15
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:
429
)
16
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:
729
)
17
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:
381
)
18
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:
255
)
19
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:
199
)
20
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:
45
)
21
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:
3827
)
22
at org.apache.catalina.core.StandardContext.start(StandardContext.java:
4334
)
23
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
791
)
24
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:
771
)
25
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
525
)
26
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:
920
)
27
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:
883
)
28
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:
492
)
29
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:
1138
)
30
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:
311
)
31
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:
117
)
32
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1053
)
33
at org.apache.catalina.core.StandardHost.start(StandardHost.java:
719
)
34
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:
1045
)
35
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:
443
)
36
at org.apache.catalina.core.StandardService.start(StandardService.java:
516
)
37
at org.apache.catalina.core.StandardServer.start(StandardServer.java:
710
)
38
at org.apache.catalina.startup.Catalina.start(Catalina.java:
566
)
39
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
40
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
41
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
42
at java.lang.reflect.Method.invoke(Unknown Source)
43
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:
288
)
44
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:
413
)
45
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'
sessionFactory
'
defined in ServletContext resource [
/
WEB
-
INF
/
applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.mediaStorage.dto.Menu.userses
46
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1336
)
47
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:
471
)
48
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$
1
.run(AbstractAutowireCapableBeanFactory.java:
409
)
49
at java.security.AccessController.doPrivileged(Native Method)
50
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:
380
)
51
at org.springframework.beans.factory.support.AbstractBeanFactory$
1
.getObject(AbstractBeanFactory.java:
264
)
52
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:
220
)
53
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:
261
)
54
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
185
)
55
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:
164
)
56
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:
269
)
57
42
more
58
Caused by: org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.mediaStorage.dto.Menu.userses
59
at org.hibernate.cfg.Mappings.addCollection(Mappings.java:
124
)
60
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:
2066
)
61
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:
2041
)
62
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:
359
)
63
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:
273
)
64
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:
144
)
65
at org.hibernate.cfg.Configuration.add(Configuration.java:
669
)
66
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:
504
)
67
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:
631
)
68
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:
211
)
69
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
1367
)
70
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1333
)
71
52
more
72
org.hibernate.DuplicateMappingException: Duplicate collection role mapping com.kinrich.mediaStorage.dto.Menu.userses
查资料发现这个错误是Menu里面的userses重复了 从Menu.java检查到Menu.hbm.xml 结果都没有发现错误,后面检查applicationContext.xml文件的mappingResources时发现我的有句value重复了 原来我是从那句开始是用的Ctrl+Alt往下复制的 后面做完没检查就出现了这个错误。
下次选择用快捷键操作也要注意检查下是否正确。不然出了错误也就把快捷键省下的那点时间都浪费还有多。
发表于 2011-07-19 13:40
China_dam
阅读(7153)
评论(0)
编辑
收藏
所属分类:
SSH
新用户注册
刷新评论列表
只有注册用户
登录
后才能发表评论。
网站导航:
博客园
IT新闻
知识库
C++博客
博问
管理
相关文章:
对于取值Session里面的集合问题
SSH批量Checkbox修改
S2SH分页 留有给有需要的!!
SSH关于多表插入 只能插入一张关系表的问题
SSH+ORACLE 怎么样把yyyy-MM-dd hh:mm:ss变成yyyy-MM-hh
org.hibernate.DuplicateMappingException错误
readOnly错误
随笔:9 文章:1 评论:0 引用:0
<
2011年7月
>
日
一
二
三
四
五
六
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
常用链接
我的随笔
我的评论
我的参与
留言簿
给我留言
查看公开留言
查看私人留言
随笔分类
Android
(rss)
Java基础
(rss)
SSH(7)
(rss)
随笔档案
2011年9月 (1)
2011年8月 (5)
2011年7月 (1)
2011年5月 (3)
搜索
最新评论
阅读排行榜
1. org.hibernate.DuplicateMappingException错误(7153)
2. java.lang.NoClassDefFoundError: javax/el/ExpressionFactory错误(4767)
3. readOnly错误(2994)
4. SSH批量Checkbox修改(988)
5. 代码重构阅读心得[转] (858)
评论排行榜
1. 对于取值Session里面的集合问题(0)
2. SSH批量Checkbox修改(0)
3. S2SH分页 留有给有需要的!!(0)
4. 代码重构阅读心得[转] (0)
5. SSH关于多表插入 只能插入一张关系表的问题(0)