错误:
Caused by: org.hibernate.MappingException: must specify an identifier type:xxx.xxx.xxx
我知道是javabean没找到
但是为什么找不到?我的applicationContext.xml在/WEB-INF/下面
我的web.xml中是这样的
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>如果把applicationContext.xml放到classes文件夹下面的话连applicationContext.xml也找不到!!紧急求助阿!
Caused by: org.hibernate.MappingException: must specify an identifier type:xxx.xxx.xxx
我知道是javabean没找到
但是为什么找不到?我的applicationContext.xml在/WEB-INF/下面
我的web.xml中是这样的
<listener>
<listener-class> org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>如果把applicationContext.xml放到classes文件夹下面的话连applicationContext.xml也找不到!!紧急求助阿!
除了struts的配置文件以外 其他spring、hibernate配置文件都放src下吧.. 我做的项目都是这样的 没有出现过读取的问题..希望对你有帮助..<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list> <servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext*.xml</param-value>
</context-param> <listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener> <filter>
<filter-name>Spring character encoding filter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter> <filter-mapping>
<filter-name>Spring character encoding filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
好好检查各个实体bean的xml (都已经是声明式的年代了, 全部用@来声明吧, 用xml多麻烦)