Migrating to JBoss 7.0.0.Final: SearchException with Hibernate 3
riggs Jul 14, 2011 7:49 AMI am migrating an EAR-Application from JBoss 4.2 to 7.0.0.Final. Deploying the application looks fine, but when I use the FullTextEntityManager from Hibernate Search 3.4.0.Final the following SearchException is thrown:
{code}
12:32:20,808 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "MyApp.ear"
12:32:51,418 ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] (http--127.0.0.1-8080-2) javax.ejb.EJBTransactionRolledbackException: Trying to use Hibernate Search without an Hibernate EntityManager: class org.hibernate.internal.SessionImpl
12:32:51,433 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/MyApp]] (http--127.0.0.1-8080-2) Exception while dispatching incoming RPC call: com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract boolean de.mycompany.myapp.client.rpc.MyAppService.startSearchIndexReInitialization()' threw an unexpected exception: javax.ejb.EJBTransactionRolledbackException: Trying to use Hibernate Search without an Hibernate EntityManager: class org.hibernate.internal.SessionImpl
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:385) [gwt-servlet-2.3.0.jar:]
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:588) [gwt-servlet-2.3.0.jar:]
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208) [gwt-servlet-2.3.0.jar:]
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248) [gwt-servlet-2.3.0.jar:]
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) [gwt-servlet-2.3.0.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:49) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
Caused by: javax.ejb.EJBTransactionRolledbackException: Trying to use Hibernate Search without an Hibernate EntityManager: class org.hibernate.internal.SessionImpl
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:168)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:251)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:381)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:233)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:47)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)
at de.mycompany.myapp.service.SearchService$$$view12.initializeIndex(Unknown Source) [myapp-server-2.3.7-SNAPSHOT.jar:]
at de.mycompany.myapp.service.MyAppControllerBean.initSearchIndex(MyAppControllerBean.java:800) [myapp-server-2.3.7-SNAPSHOT.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:271)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:377)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:233)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:47)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:146)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:76)
at de.mycompany.myapp.service.MyAppController$$$view1.initSearchIndex(Unknown Source) [myApp-server-2.3.7-SNAPSHOT.jar:]
at de.mycompany.myapp.server.MyAppServlet.startSearchIndexReInitialization(MyAppServlet.java:350) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:569) [gwt-servlet-2.3.0.jar:]
... 19 more
Caused by: org.hibernate.search.SearchException: Trying to use Hibernate Search without an Hibernate EntityManager: class org.hibernate.internal.SessionImpl
at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.getFullTextSession(FullTextEntityManagerImpl.java:91) [hibernate-search-3.4.0.Final.jar:]
at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.purgeAll(FullTextEntityManagerImpl.java:117) [hibernate-search-3.4.0.Final.jar:]
at de.mycompany.myapp.service.SearchServiceBean.purgeAll(SearchServiceBean.java:716) [myApp-server-2.3.7-SNAPSHOT.jar:]
at de.mycompany.myapp.service.SearchServiceBean.buildIndex(SearchServiceBean.java:683) [myApp-server-2.3.7-SNAPSHOT.jar:]
at de.mycompany.myapp.service.SearchServiceBean.initializeIndex(SearchServiceBean.java:116) [myApp-server-2.3.7-SNAPSHOT.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_26]
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:45) [jboss-as-jpa-7.0.0.Final.jar:7.0.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:44)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.ViewDescription$ComponentDispatcherInterceptor.processInvocation(ViewDescription.java:202)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.ejb3.component.session.SessionInvocationContextInterceptor.processInvocation(SessionInvocationContextInterceptor.java:67)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:287)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:370)
at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:247)
... 69 more
{code}
The EAR-File has the following structure:
{code}
MyApp.ear
| myApp-server-2.3.7-SNAPSHOT.jar
| myApp-web-2.3.7-SNAPSHOT.war
|
+---lib
| asm-3.2.jar
| asm-analysis-3.2.jar
| asm-commons-3.2.jar
| asm-tree-3.2.jar
| asm-util-3.2.jar
| avalon-framework-api-4.3.1.jar
| avalon-framework-impl-4.3.1.jar
| batik-anim-1.7.jar
| batik-awt-util-1.7.jar
| batik-bridge-1.7.jar
| batik-css-1.7.jar
| batik-dom-1.7.jar
| batik-ext-1.7.jar
| batik-extension-1.7.jar
| batik-gvt-1.7.jar
| batik-js-1.7.jar
| batik-parser-1.7.jar
| batik-script-1.7.jar
| batik-svg-dom-1.7.jar
| batik-svggen-1.7.jar
| batik-transcoder-1.7.jar
| batik-util-1.7.jar
| batik-xml-1.7.jar
| cglib-2.2.jar
| commons-codec-1.4.jar
| commons-collections-3.1.jar
| commons-io-1.3.1.jar
| commons-lang-2.5.jar
| dom4j-1.6.1.jar
| fop-1.0.jar
| ganymed-ssh2-build210.jar
| gmaven-common-1.0-rc-3.jar
| gmaven-feature-api-1.0-rc-3.jar
| gmaven-feature-support-1.0-rc-3.jar
| gmaven-runtime-1.5-1.0-rc-3.jar
| gmaven-runtime-api-1.0-rc-3.jar
| gmaven-runtime-default-1.0-rc-3.jar
| gmaven-runtime-support-1.0-rc-3.jar
| groovy-1.8.0.jar
| hibernate-commons-annotations-3.2.0.Final.jar
| hibernate-core-3.6.3.Final.jar
| hibernate-entitymanager-3.6.3.Final.jar
| hibernate-search-3.4.0.Final.jar
| hibernate-search-analyzers-3.4.0.Final.jar
| itext-2.0.4-modified.jar
| javassist-3.12.0.GA.jar
| jline-0.9.94.jar
| lucene-analyzers-3.1.0.jar
| lucene-core-3.1.0.jar
| lucene-highlighter-3.1.0.jar
| lucene-memory-3.1.0.jar
| lucene-misc-3.1.0.jar
| lucene-smartcn-3.1.0.jar
| lucene-spatial-3.1.0.jar
| lucene-spellchecker-3.1.0.jar
| lucene-stempel-3.1.0.jar
| plexus-utils-1.5.5.jar
| qdox-1.6.3.jar
| solr-analysis-extras-3.1.0.jar
| solr-commons-csv-3.1.0.jar
| solr-core-3.1.0.jar
| solr-solrj-3.1.0.jar
| stringtemplate-3.2.1.jar
| xmlgraphics-commons-1.4.jar
|
\---META-INF
application.xml
jboss-deployment-structure.xml
MANIFEST.MF
{code}
Here is the META-INF/MANIFEST.MF generated by Maven 3:
{code}
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: traude
Build-Jdk: 1.6.0_26
Dependencies: org.apache.commons.logging, org.slf4j
Class-Path: myApp-server-2.3.7-SNAPSHOT.jar myApp-web-2.3.7-SNAP
SHOT.war lib/hibernate-entitymanager-3.6.3.Final.jar lib/hibernate-co
re-3.6.3.Final.jar lib/commons-collections-3.1.jar lib/dom4j-1.6.1.ja
r lib/cglib-2.2.jar lib/javassist-3.12.0.GA.jar lib/fop-1.0.jar lib/x
mlgraphics-commons-1.4.jar lib/batik-svg-dom-1.7.jar lib/batik-anim-1
.7.jar lib/batik-css-1.7.jar lib/batik-dom-1.7.jar lib/batik-parser-1
.7.jar lib/batik-util-1.7.jar lib/batik-bridge-1.7.jar lib/batik-scri
pt-1.7.jar lib/batik-js-1.7.jar lib/batik-xml-1.7.jar lib/batik-awt-u
til-1.7.jar lib/batik-gvt-1.7.jar lib/batik-transcoder-1.7.jar lib/ba
tik-svggen-1.7.jar lib/batik-extension-1.7.jar lib/batik-ext-1.7.jar
lib/commons-io-1.3.1.jar lib/avalon-framework-api-4.3.1.jar lib/avalo
n-framework-impl-4.3.1.jar lib/stringtemplate-3.2.1.jar lib/ganymed-s
sh2-build210.jar lib/commons-lang-2.5.jar lib/hibernate-search-3.4.0.
Final.jar lib/hibernate-search-analyzers-3.4.0.Final.jar lib/lucene-a
nalyzers-3.1.0.jar lib/solr-analysis-extras-3.1.0.jar lib/solr-core-3
.1.0.jar lib/solr-solrj-3.1.0.jar lib/lucene-highlighter-3.1.0.jar li
b/lucene-memory-3.1.0.jar lib/lucene-misc-3.1.0.jar lib/lucene-spatia
l-3.1.0.jar lib/lucene-spellchecker-3.1.0.jar lib/solr-commons-csv-3.
1.0.jar lib/commons-codec-1.4.jar lib/lucene-smartcn-3.1.0.jar lib/lu
cene-stempel-3.1.0.jar lib/hibernate-commons-annotations-3.2.0.Final.
jar lib/lucene-core-3.1.0.jar lib/groovy-1.8.0.jar lib/asm-3.2.jar li
b/asm-commons-3.2.jar lib/asm-util-3.2.jar lib/asm-analysis-3.2.jar l
ib/asm-tree-3.2.jar lib/gmaven-runtime-default-1.0-rc-3.jar lib/gmave
n-runtime-1.5-1.0-rc-3.jar lib/gmaven-feature-support-1.0-rc-3.jar li
b/gmaven-feature-api-1.0-rc-3.jar lib/gmaven-runtime-support-1.0-rc-3
.jar lib/gmaven-runtime-api-1.0-rc-3.jar lib/gmaven-common-1.0-rc-3.j
ar lib/plexus-utils-1.5.5.jar lib/qdox-1.6.3.jar lib/jline-0.9.94.jar
lib/itext-2.0.4-modified.jar
{code}
This is the jboss-deployment-structure.xml under the META-INF directory:
{code:xml}
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<exclusions>
<module name="org.hibernate"/>
</exclusions>
</deployment>
</jboss-deployment-structure>
{code}
I have no idea what's going wrong here. It seems as though this is an classloading issue?
Can anyone help me please?