我配置了两个applicationContext.xml(applicationContext_Elec.xml和applicationContext_OA.xml)连接两个数据库,我在web.xml里这么配置
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext_*.xml</param-value>
</context-param>
这以我可以确定单独运行哪一个.xml文件都是可以访问数据库的,但是,就是两个放在一起,启动tomcat不会报错。进行action操作的时候报下面的错
org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity: com.a30elec.entity.Task; nested exception is org.hibernate.MappingException: Unknown entity: com.a30elec.entity.Task
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:676)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
at com.a30elec.daoimpl.TaskDaoImpl.findAgoTaskNo(TaskDaoImpl.java:195)
at com.a30elec.serviceimpl.TaskServiceImpl.findAgoTaskNo(TaskServiceImpl.java:61)
求大神指教
ssh 数据库 nested
和web.xml配置无关,web.xml配置是对的classpath:applicationContext_*.xml这样写两个文件都会读的吧
我们公司不能上q 。 邮箱吧 is_zhoufeng@163.com