当前位置: 代码迷 >> Java Web开发 >> 急org.hibernate.MappingException: Unknown entity
  详细解决方案

急org.hibernate.MappingException: Unknown entity

热度:10446   发布时间:2013-02-25 21:15:34.0
急求助:org.hibernate.MappingException: Unknown entity:
异常错误如:org.hibernate.MappingException: Unknown entity: com.xdtech.platform.domain.model.user.xkq


求高手帮忙解决,。。是不是还有什么地方没有配置到哦!!!
我 的applicationContext.xml配置文件如下
XML code
<?xml version="1.0" encoding="GBK"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd       http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"    default-autowire="byName" default-lazy-init="false">    <import resource="classpath:org/codehaus/xfire/spring/xfire.xml"/>    <!-- 获得applicationContext中所有bean的JSR181 annotation -->    <bean id="webAnnotations" class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"  lazy-init="false"/>    <!-- 定义handler mapping,将所有JSR181定义的bean导出为web service -->    <bean id="jsr181HandlerMapping" class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping"  lazy-init="false">      <property name="xfire" ref="xfire"/>      <property name="webAnnotations" ref="webAnnotations"/>    </bean>     <bean class="com.xdtech.platform.core.service.SearchService" />    <bean class="com.xdtech.platform.core.service.IndexDelete" />    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">        <!-- MY SQL DATABACE CONNECTION-->         <property name="driverClass" value="com.mysql.jdbc.Driver" />         <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/cis?useUnicode=true&amp;characterEncoding=UTF-8" />         <property name="user" value="root" />        <property name="password" value="123" />        <property name="maxIdleTime"><value>1800</value></property>        <property name="acquireIncrement"><value>2</value></property>        <property name="maxStatements"><value>0</value></property>        <property name="initialPoolSize"><value>2</value></property>        <property name="idleConnectionTestPeriod"><value>1800</value></property>        <property name="acquireRetryAttempts"><value>30</value></property>        <property name="testConnectionOnCheckout"><value>false</value></property>    </bean>    <!-- bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"-->    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">        <property name="dataSource"><ref bean="dataSource" /></property>          <property name="hibernateProperties">             <map>                 <entry key="hibernate.connection.isolation" value="4"/>                 <entry key="hibernate.max_fetch_depth" value="1"/>                 <entry key="hibernate.show_sql" value="false"/>                 <!-- 请注意修改相应的数据库方言  -->                <entry key="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>                <entry key="hibernate.cache.use_query_cache" value="false"/>                 <entry key="hibernate.query.substitutions" value="true 1, false 0, yes 'Y', no 'N'"/>                 <entry key="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/>                 <entry key="hibernate.query.factory_class" value="org.hibernate.hql.ast.ASTQueryTranslatorFactory"/>             </map>         </property>         <property name="annotatedClasses">            <list>                <value>com.xdtech.platform.domain.model.user.User</value>                <value>com.xdtech.platform.domain.model.user.UserInfGroup</value>                <value>com.xdtech.platform.domain.model.user.xkq</value>                                                             </list>        </property>    </bean>                <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">            <property name="sessionFactory">        <ref local="sessionFactory" />        </property>    </bean> <bean id="transactionInterceptor"  class="org.springframework.transaction.interceptor.TransactionInterceptor">  <property name="transactionManager">   <ref bean="transactionManager" />  </property>  <property name="transactionAttributes">   <props>    <prop key="delete*">PROPAGATION_REQUIRED,-Exception</prop>    <prop key="add*">PROPAGATION_REQUIRED,-Exception</prop>    <prop key="update*">PROPAGATION_REQUIRED,-Exception</prop>    <prop key="save*">PROPAGATION_REQUIRED,-Exception</prop>    <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>    <prop key="edit*">PROPAGATION_REQUIRED,-Exception</prop>    <prop key="reload*">PROPAGATION_REQUIRED,-Exception</prop>    <prop key="*">PROPAGATION_SUPPORTS</prop>   </props>  </property> </bean> <bean  class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" >  <property name="beanNames">   <list>    <value>com.xdtech.platform.web.actions*</value>   </list>  </property>  <property name="interceptorNames">   <list>    <value>transactionInterceptor</value>   </list>  </property>    <property name="proxyTargetClass" value="true"/> </bean> <!-- -->    <bean id="dao" class="com.xdtech.platform.dao.IDaoManager" />        <bean id="initbean"        class="com.xdtech.platform.util.server.SpringInitBean"        scope="singleton"         init-method="init">        <property name="port">              <value>8011</value>        </property>      </bean>    </beans>
  相关解决方案