Java HibernateJARS兼容性问题
我是冬眠中的新手。谁能帮我找出我在使用hibernate 3.5.1 FINAL时应该添加哪些JAR(如搜索、注释、JBoss等)。 下面是当前的pom.xml和hibernate.cfg.xml 但我发现版本中存在一些兼容性问题Java HibernateJARS兼容性问题,java,hibernate,maven,hibernate-search,hibernate-annotations,Java,Hibernate,Maven,Hibernate Search,Hibernate Annotations,我是冬眠中的新手。谁能帮我找出我在使用hibernate 3.5.1 FINAL时应该添加哪些JAR(如搜索、注释、JBoss等)。 下面是当前的pom.xml和hibernate.cfg.xml 但我发现版本中存在一些兼容性问题 Error:"IncompatibleClassChangeError: class org.hibernate.cfg.ExtendedMappings has interface org.hibernate.cfg.
Error:"IncompatibleClassChangeError: class org.hibernate.cfg.ExtendedMappings
has interface org.hibernate.cfg.Mappings as super class"
pom.xml
`
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.5.1-Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.5.1-Final</version>
</dependency>
<dependency>
<groupId>org.ancoron.postgresql</groupId>
<artifactId>org.postgresql</artifactId>
<version>9.1.901.jdbc4.1-rc9</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate.common</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.1.0.CR1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search</artifactId>
<version>4.1.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-infinispan</artifactId>
<version>4.1.1.Final</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>`
`
org.hibernate
冬眠核心
3.5.1-最终版本
org.hibernate
休眠实体管理器
3.5.1-最终版本
org.ancoron.postgresql
org.postgresql
9.1.901.jdbc4.1-rc9
公地收藏
公地收藏
3.2.1
javax.transaction
jta
1.1
org.hibernate.javax.persistence
hibernate-jpa-2.0-api
1.0.1.最终版本
org.hibernate
休眠注释
3.4.0.GA
org.hibernate.common
hibernate commons注释
4.0.1.最终版本
org.jboss.logging
jboss日志
3.1.0.CR1
org.hibernate
休眠搜索
4.1.1.最终版本
org.hibernate
hibernate搜索infinispan
4.1.1.最终版本
JBoss存储库
http://repository.jboss.org/nexus/content/groups/public/
`
hibernate.cfg.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">
org.hibernate.dialect.PostgreSQLDialect
</property>
<property name="hibernate.connection.driver_class">
org.postgresql.Driver
</property>
<property name="hibernate.connection.url">
jdbc:postgresql://localhost:5432/
</property>
<property name="hibernate.default_schema">alerts</property>
<property name="hibernate.connection.username">
postgres
</property>
<property name="hibernate.connection.password">
password
</property>
<property name="hibernate.search.default.directory_provider" >
org.hibernate.search.store.FSDirectoryProvider
</property>
<property name="hibernate.search.default.indexBase">
C:\temp\indexes
</property>
<property name="hibernate.ejb.event.post-insert" >
"org.hibernate.search.event.FullTextIndexEventListener
</property>
<property name="hibernate.ejb.event.post-update" >
org.hibernate.search.event.FullTextIndexEventListener
</property>
<property name="hibernate.ejb.event.post-delete" >
org.hibernate.search.event.FullTextIndexEventListener"
</property>
<mapping class="something.classname" />
</session-factory>
</hibernate-configuration>
org.hibernate.dialogue.PostgreSqlDialogue
org.postgresql.Driver
jdbc:postgresql://localhost:5432/
警报
博士后
密码
org.hibernate.search.store.FSDirectoryProvider
C:\temp\index
“org.hibernate.search.event.FullTextIndexEventListener
org.hibernate.search.event.FullTextIndexEventListener
org.hibernate.search.event.FullTextIndexEventListener“
查看Hibernate Search 4.1.1.Final()的POM,您可以看到它在版本4.1.3.Final中需要Hibernate ORM。这就是我要开始的(绝对没有旧版本)
另外,为什么要明确指定Hibernate ORM、注释等的版本。如果只指定所需的Hibernate搜索版本,则会自动将所有其他Hibernate依赖项作为其正确版本中的可传递依赖项
最后但并非最不重要的一点是,为什么要搜索4.1.3?还有一个4.3.0.Final可用。查看用于Hibernate Search 4.1.1.Final()的POM,您可以看到它在版本4.1.3.Final中需要Hibernate ORM。这就是我要开始的(绝对没有旧版本) 另外,为什么要明确指定Hibernate ORM、注释等的版本。如果只指定所需的Hibernate搜索版本,则会自动将所有其他Hibernate依赖项作为其正确版本中的可传递依赖项
最后但并非最不重要的一点是,为什么要搜索4.1.3?还有一个4.3.0.Final版本可用。
但我发现版本中存在一些兼容性问题。xml
,这些是什么?错误:“不兼容ClassChangeError:class org.hibernate.cfg.ExtendedMappings将接口org.hibernate.cfg.Mappings作为超级类”搜索一段时间后,我发现这也是“hibernate search not enabled”(hibernate search not enabled),您正在启动一个项目,并且使用的是hibernate的过时版本。为什么?为什么不使用最新版本,从而避免3年多前3.5.1以来修复的所有错误?@Ankita如果可能,按照JB的建议更改最新版本,或者按照表中的建议制作组合。但我发现版本中存在一些兼容性问题。xml
,这些是什么?错误:“不兼容ClassChangeError:class org.hibernate.cfg.ExtendedMappings将接口org.hibernate.cfg.Mappings作为超级类”搜索一段时间后,我发现这也是“hibernate search not enabled”(hibernate search not enabled),您正在启动一个项目,并且使用的是hibernate的过时版本。为什么?为什么不使用最新版本,从而避免3年多前3.5.1以来修复的所有错误?@Ankita如果可能,按照JB的建议更改最新版本,或者按照表中的建议制作组合。现在,我已切换回旧版本。。但谢谢你,我会尝试上面的:)现在,我已经切换回旧版本。。但是谢谢你,我会尝试上面的:)