【发布时间】:2011-05-24 17:54:45
【问题描述】:
我收到此错误:
org.hibernate.MappingException: Unknown entity: xxx.model.Application
但是,一切看起来都已正确配置。谁能看看我有没有遗漏的东西?
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="file:/dctm/db.props"/>
</bean>
<bean id="xxxDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
<property name="url" value="${db.url}"/>
<property name="username" value="${db.username}"/>
<property name="password" value="${db.password}"/>
</bean>
<bean id="xxxSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="xxxDataSource"/>
<property name="annotatedClasses">
<list>
<value>xxx.model.Application</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${db.dialect}</prop>
<prop key="hibernate.show_sql">${db.debug_sql}</prop>
<prop key="hibernate.c3p0.minPoolSize">1</prop>
<prop key="hibernate.c3p0.maxPoolSize">5</prop>
<prop key="hibernate.c3p0.timeout">${db.timeout}</prop>
<prop key="hibernate.c3p0.max_statement">50</prop>
<prop key="hibernate.c3p0.testConnectionOnCheckout">false</prop>
<prop key="hibernate.current_session_context_class">thread</prop>
</props>
</property>
</bean>
<bean id="patiDao" class="xxx.dao.hibernate.PatiHibernateDao">
<property name="sessionFactory" ref="xxxSessionFactory"/>
</bean>
【问题讨论】:
-
从您的
xxx.model.Applicatio发布代码 -
我认为 jboss 将休眠 jar 包作为服务器的一部分,你能检查一下应用程序与服务器上的休眠版本是否存在冲突吗?
标签: java hibernate spring jakarta-ee