hibernate4 search+Spring3+lucene4.10.4+jcseg+jdk7.出现JAR包版本问题,求帮忙看看

yantou1012 2015-08-05 09:59:44
项目是一个引文系统,需要用到大量检索所以用了hibernateSearch+lucene,同时需要用到叙词表的增删改查等维护功能,就用了jcseg。 当时用的组合是 lucene3.6+jcseg1.8几+hibernate-jpa-2.0+jdk6。后来发现jcseg不支持lucene3.6分词,就换成lucene4.10.4,lucene4.10.4需要JDK7,所以现在的版本如最后面的截图。这个报错只要将lucene换回3.6版本就不报错了,但是我现在必须用4X版本。有遇到过的朋友或者有思路的朋友给兄弟个提示,在下先谢过了!




启动Tomcat时报错信息:

Caused by: java.lang.VerifyError: class org.hibernate.search.util.impl.DelegateNamedAnalyzer overrides final method tokenStream.(Ljava/lang/String;Ljava/io/Reader;)Lorg/apache/lucene/analysis/TokenStream;
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2527)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1010)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1483)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:365)
at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:222)
at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:146)
at org.hibernate.search.event.impl.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:130)
at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:83)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:303)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1790)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:899)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:76)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:288)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
... 90 more




配置文件的部分信息:


<!-- Jpa Entity Manager 配置 -->
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter" />
<property name="packagesToScan" value="com.ftc.reference" />
<property name="jpaProperties">
<props>
<!-- 命名规则 My_NAME->MyName -->
<prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>

<prop key="hibernate.search.default.directory_provider">filesystem</prop>
<prop key="hibernate.search.default.indexBase">${hibernate.search.index}</prop>
<prop key="hibernate.search.lucene_version">LUCENE_4_10_4</prop>
</props>
</property>
</bean>

相关jar包列表:





...全文
1127 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
安心从容 2017-12-07
搞定了,具体失败原因不清楚。我用了hibernatesearch 5.0.0.Final 以及一系列的maven树下面的jar包。还用了IKAnalyzer2012FF_u1.jar包的中文分词。
回复
安心从容 2017-12-07
楼主解决了吗?帮顶,我也遇到这个问题。
回复
xiaoqi376847932 2017-02-06
相关jar包版本冲突问题。maven看版本树
回复
qq_32027369 2016-11-25
楼主解决了没,怎么解决的啊
回复
a928818632 2016-01-14
我是这样弄的:hibernate-search-orm-4.2.0.Final把这个包去掉, 我就这样弄好了
回复
yantou1012 2015-08-05
自己顶一下,两天了没解决了!
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-08-05 09:59
社区公告
暂无公告