ssh中 hibernate测试实体映射到数据库出错Unable to find org.hibernate.search.....

贺显伟 2014-09-08 11:54:31
我的情况是这样的,我用java2dll的形式映射出数据库,但是总是报 Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath.
Hibernate Search is not enabled的错误,我上网查了,说每个实体类要 实现Serializable接口,我实现后我控制变量来测试14个实体类都可以映射成功,唯独有一个不行!怎么都不行,检查了几遍编码都没问题,是在不知道到底哪儿出问题了,急求解答!!!
这个是类图


这个是映射文件
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="com.hxw.oa.domain">

<class name="HandedForm" table="OA_handedForm">
<id name="id">
<generator class="native"/>
</id>

<many-to-one name="issuedForm" class="IssuedForm" column="issuedForm_id"/>
<many-to-one name="subUser" class="User" column="User_id"></many-to-one>
<property name="subTime"></property>

<set name="auditings">
<key column="HandedForm_id"></key>
<one-to-many class="Auditing"/>
</set>
<set name="attachments">
<key column="Attachment_id"/>
<one-to-many class="Attachment"/>
</set>
</class>

</hibernate-mapping>

这是那个类源码
package com.hxw.oa.domain;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Set;

public class HandedForm implements Serializable{
private Long id;
private IssuedForm issuedForm;//该上交文件对应的任务发布文件
private User subUser;//文件上交人
private Timestamp subTime;//上交时间
private Set<Auditing> auditings;
private Set<Attachment> attachments;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public IssuedForm getIssuedForm() {
return issuedForm;
}
public void setIssuedForm(IssuedForm issuedForm) {
this.issuedForm = issuedForm;
}
public User getSubUser() {
return subUser;
}
public void setSubUser(User subUser) {
this.subUser = subUser;
}
public Timestamp getSubTime() {
return subTime;
}
public void setSubTime(Timestamp subTime) {
this.subTime = subTime;
}
public Set<Auditing> getAuditings() {
return auditings;
}
public void setAuditings(Set<Auditing> auditings) {
this.auditings = auditings;
}
public Set<Attachment> getAttachments() {
return attachments;
}
public void setAttachments(Set<Attachment> attachments) {
this.attachments = attachments;
}
}


报错的内容:
e
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.Major.users -> OA_user
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.User.evaluateScores -> OA_evaluateScore
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.User.activityForms -> OA_activityForm
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.User.issuedForms -> OA_issuedForm
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.User.handedForms -> OA_handedForm
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.Department.childrenDepartments -> OA_department
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.ActivityForm.auditings -> OA_auditing
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.ActivityForm.attachments -> OA_attachment
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.IssuedForm.auditings -> OA_auditing
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.IssuedForm.handedForms -> OA_handedForm
2014-9-8 23:38:59 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: com.hxw.oa.domain.IssuedForm.attachments -> OA_attachment
2014-9-8 23:38:59 org.hibernate.cfg.Configuration applyHibernateValidatorLegacyConstraints
OnDDL
信息: Hibernate Validator not found: ignoring
2014-9-8 23:38:59 org.hibernate.validator.util.Version <clinit>
信息: Hibernate Validator bean-validator-3.0-JBoss-4.0.2
2014-9-8 23:38:59 org.hibernate.validator.engine.resolver.DefaultTraversableResolver detec
tJPA
信息: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableReso
lver.
23:38:59,237 INFO LocalSessionFactoryBean:730 - Building new Hibernate SessionFactory
2014-9-8 23:38:59 org.hibernate.validator.engine.resolver.DefaultTraversableResolver detec
tJPA
信息: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableReso
lver.
2014-9-8 23:38:59 org.hibernate.validator.engine.resolver.DefaultTraversableResolver detec
tJPA
信息: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableReso
lver.
2014-9-8 23:38:59 org.hibernate.cfg.search.HibernateSearchEventListenerRegister enableHibe
rnateSearch
信息: Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath.
Hibernate Search is not enabled.

23:38:59,260 INFO DefaultListableBeanFactory:421 - Destroying singletons in org.springfra
mework.beans.factory.support.DefaultListableBeanFactory@455fc40c: defining beans [testActi
on,testService,org.springframework.context.annotation.internalPersistenceAnnotationProcess
or,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springfram
ework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.
annotation.internalRequiredAnnotationProcessor,org.springframework.beans.factory.config.Pr
opertyPlaceholderConfigurer#0,dataSource,sessionFactory,transactionManager,org.springframe
work.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.Annota
tionTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionIn
terceptor#0,org.springframework.transaction.config.internalTransactionAdvisor]; root of fa
ctory hierarchy

...全文
537 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
attilax 2014-09-12
  • 打赏
  • 举报
回复
估计配置文件哪里格式有问题.....你应该使用Myeclipse的hibernate工具来生成配置文件....不要手动写配置文件..

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧