6 Replies Latest reply on Jul 18, 2011 11:17 AM by Thomas T

    Migrating to JBoss 7.0.0.Final: SearchException with Hibernate 3

    Thomas T Newbie

      I 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?

        • 1. Re: Migrating to JBoss 7.0.0.Final: SearchException with Hibernate 3
          Scott Marlow Master

          It sounds classloading related to me as well, but thats not clear from the exception (will have to find out what the error means).  I'll ask around.

          • 2. Re: Migrating to JBoss 7.0.0.Final: SearchException with Hibernate 3
            Scott Marlow Master

            Could you include more lines from server.log (from the start of the application deployment) ?  I am wondering if you have JPA elements in the application that triggers deployment code that attempts to use Hibernate4.  Could you also give the contents of myApp-server-2.3.7-SNAPSHOT.jar + myApp-web-2.3.7-SNAPSHOT.war.

            • 3. Re: Migrating to JBoss 7.0.0.Final: SearchException with Hibernate 3
              Thomas T Newbie

              Thanks for your quick response, Scott!

               

              The logfiles (boot.log and server.log) are attached to this post, so are txt-files that describe the contents of the myapp-server.jar and myapp-web.jar (leaving out the version suffix 2.3.7-SNAPSHOT) .

               

              Here is the content of the file myapp-server.jar/META-INF/MANIFEST.MF:

               

              {code}

              Manifest-Version: 1.0

              Archiver-Version: Plexus Archiver

              Created-By: Apache Maven

              Built-By: traude

              Build-Jdk: 1.6.0_26

              Class-Path: hibernate-entitymanager-3.6.3.Final.jar hibernate-core-3.6

              .3.Final.jar dom4j-1.6.1.jar javassist-3.12.0.GA.jar asm-3.1.jar fop-

              1.0.jar xmlgraphics-commons-1.4.jar batik-svg-dom-1.7.jar batik-anim-

              1.7.jar batik-css-1.7.jar batik-dom-1.7.jar batik-parser-1.7.jar bati

              k-util-1.7.jar batik-bridge-1.7.jar batik-script-1.7.jar batik-js-1.7

              .jar batik-xml-1.7.jar batik-awt-util-1.7.jar batik-gvt-1.7.jar batik

              -transcoder-1.7.jar batik-svggen-1.7.jar batik-extension-1.7.jar bati

              k-ext-1.7.jar commons-io-1.3.1.jar avalon-framework-api-4.3.1.jar ava

              lon-framework-impl-4.3.1.jar stringtemplate-3.2.1.jar ganymed-ssh2-bu

              ild210.jar commons-lang-2.5.jar hibernate-search-3.4.0.Final.jar hibe

              rnate-search-analyzers-3.4.0.Final.jar lucene-analyzers-3.1.0.jar sol

              r-analysis-extras-3.1.0.jar solr-core-3.1.0.jar solr-solrj-3.1.0.jar

              lucene-highlighter-3.1.0.jar lucene-memory-3.1.0.jar lucene-misc-3.1.

              0.jar lucene-spatial-3.1.0.jar lucene-spellchecker-3.1.0.jar solr-com

              mons-csv-3.1.0.jar commons-codec-1.4.jar lucene-smartcn-3.1.0.jar luc

              ene-stempel-3.1.0.jar hibernate-commons-annotations-3.2.0.Final.jar l

              ucene-core-3.1.0.jar groovy-1.8.0.jar asm-commons-3.2.jar asm-util-3.

              2.jar asm-analysis-3.2.jar asm-tree-3.2.jar gmaven-runtime-default-1.

              0-rc-3.jar gmaven-runtime-1.5-1.0-rc-3.jar gmaven-feature-support-1.0

              -rc-3.jar gmaven-feature-api-1.0-rc-3.jar gmaven-runtime-support-1.0-

              rc-3.jar gmaven-runtime-api-1.0-rc-3.jar gmaven-common-1.0-rc-3.jar p

              lexus-utils-1.5.5.jar qdox-1.6.3.jar jline-0.9.94.jar itext-2.0.4-mod

              ified.jar

              {code}

              • 4. Re: Migrating to JBoss 7.0.0.Final: SearchException with Hibernate 3
                Hardy Ferentschik Novice

                An alternative approach would be to try the Hibernate Search 4.0.0-SNAPSHOT which is already compatible w/ Hibernate Core 4 (which ships w/ AS7). Hibernate Search 4 underwent quite some refactoring, but unless you depend on some "semi private" interface you should be fine. Also some dependecies have changed, but they should be resolved automatically via Maven (for exmaple Hibernate Search uses now JBoss logging).

                 

                Sounds maybe scary, but it is the better solution for the long run. Also the an Alpha1 of Search is not far away.

                 

                If you get into trouble you can also get help on the Hibernate Search forum - https://forum.hibernate.org/viewforum.php?f=9

                 

                --Hardy

                • 5. Re: Migrating to JBoss 7.0.0.Final: SearchException with Hibernate 3
                  Thomas T Newbie

                  Thanks, Hardy!

                   

                  I tried Hibernate Search (Version 4.0.0-20110715.125417-5) and actually my application works (using the Hibernate 4 Versions that ship with JBoss 7). :-)

                   

                  Now that would be just fine for me. But unfortunately my JUnit tests that depend on Spring (3.0.5) do not run with Hibernate 4. (Well, I suppose the cause is Hibernate 4 because that's the only thing I changed.)

                  As mentioned here https://docs.jboss.org/author/display/AS7/Spring+applications+development+and+migration+guide Spring does not yet support Hibernate 4. :-(

                   

                  So, I think it's a kind of irony :-/

                   

                  Here are the dependencies of my maven pom.xml:

                   

                  {code:xml}

                  ...

                  <properties>

                                      <spring.version>3.0.5.RELEASE</spring.version>

                                      <groovy.version>1.8.0</groovy.version>

                  </properties>

                  ...

                   

                      <dependencies>

                          <dependency>

                              <groupId>javax.mail</groupId>

                              <artifactId>mail</artifactId>

                              <version>1.4.4</version>

                              <scope>provided</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.hibernate</groupId>

                              <artifactId>hibernate-entitymanager</artifactId>

                              <version>4.0.0.Beta1</version>

                              <scope>provided</scope>

                              <exclusions>

                                  <exclusion>

                                      <groupId>javax.transaction</groupId>

                                      <artifactId>jta</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.slf4j</groupId>

                                      <artifactId>slf4j-api</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>antlr</groupId>

                                      <artifactId>antlr</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>xml-apis</groupId>

                                      <artifactId>xml-apis</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>hibernate-jpa-2.0-api</artifactId>

                                      <groupId>org.hibernate.javax.persistence</groupId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>org.hibernate</groupId>

                              <artifactId>hibernate-search</artifactId>

                              <version>4.0.0-20110715.125417-5</version>

                              <exclusions>

                                  <exclusion>

                                      <groupId>commons-io</groupId>

                                      <artifactId>commons-io</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>antlr</groupId>

                                      <artifactId>antlr</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.slf4j</groupId>

                                      <artifactId>slf4j-api</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>xml-apis</groupId>

                                      <artifactId>xml-apis</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>commons-lang</artifactId>

                                      <groupId>commons-lang</groupId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>hibernate-jpa-2.0-api</artifactId>

                                      <groupId>org.hibernate.javax.persistence</groupId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>dom4j</artifactId>

                                      <groupId>dom4j</groupId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>hibernate-core</artifactId>

                                      <groupId>org.hibernate</groupId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>hibernate-commons-annotations</artifactId>

                                      <groupId>org.hibernate</groupId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                   

                   

                          <dependency>

                              <groupId>org.hibernate</groupId>

                              <artifactId>hibernate-validator</artifactId>

                              <version>4.1.0.Final</version>

                              <type>jar</type>

                              <scope>provided</scope>

                              <exclusions>

                                  <exclusion>

                                      <artifactId>slf4j-api</artifactId>

                                      <groupId>org.slf4j</groupId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>org.hibernate.javax.persistence</groupId>

                              <artifactId>hibernate-jpa-2.0-api</artifactId>

                              <version>1.0.1.Final</version>

                              <scope>provided</scope>

                          </dependency>

                   

                   

                          <dependency>

                              <groupId>org.springframework</groupId>

                              <artifactId>spring-test</artifactId>

                              <version>${spring.version}</version>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.springframework</groupId>

                              <artifactId>spring-orm</artifactId>

                              <version>${spring.version}</version>

                              <scope>test</scope>

                              <exclusions>

                                  <exclusion>

                                      <groupId>commons-logging</groupId>

                                      <artifactId>commons-logging</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>aopalliance</artifactId>

                                      <groupId>aopalliance</groupId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>spring-expression</artifactId>

                                      <groupId>org.springframework</groupId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>org.springframework</groupId>

                              <artifactId>spring-aop</artifactId>

                              <version>${spring.version}</version>

                              <scope>test</scope>

                              <exclusions>

                                  <exclusion>

                                      <groupId>aopalliance</groupId>

                                      <artifactId>aopalliance</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>commons-logging</groupId>

                                      <artifactId>commons-logging</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.springframework</groupId>

                                      <artifactId>spring-beans</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.springframework</groupId>

                                      <artifactId>spring-core</artifactId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>org.springframework</groupId>

                              <artifactId>spring-jdbc</artifactId>

                              <version>${spring.version}</version>

                              <scope>test</scope>

                              <exclusions>

                                  <exclusion>

                                      <groupId>commons-logging</groupId>

                                      <artifactId>commons-logging</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.springframework</groupId>

                                      <artifactId>spring-beans</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.springframework</groupId>

                                      <artifactId>spring-context</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.springframework</groupId>

                                      <artifactId>spring-core</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.springframework</groupId>

                                      <artifactId>spring-tx</artifactId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>org.hsqldb</groupId>

                              <artifactId>hsqldb</artifactId>

                              <version>1.8.0.10</version>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.aspectj</groupId>

                              <artifactId>aspectjweaver</artifactId>

                              <version>1.6.8</version>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>cglib</groupId>

                              <artifactId>cglib</artifactId>

                              <version>2.2</version>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.apache.xmlgraphics</groupId>

                              <artifactId>fop</artifactId>

                              <version>1.0</version>

                              <exclusions>

                                  <exclusion>

                                      <groupId>commons-logging</groupId>

                                      <artifactId>commons-logging</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>xalan</artifactId>

                                      <groupId>xalan</groupId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>xml-apis</artifactId>

                                      <groupId>xml-apis</groupId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>xml-apis-ext</artifactId>

                                      <groupId>xml-apis</groupId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>org.antlr</groupId>

                              <artifactId>stringtemplate</artifactId>

                              <version>3.2.1</version>

                              <exclusions>

                                  <exclusion>

                                      <artifactId>antlr</artifactId>

                                      <groupId>antlr</groupId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>ch.ethz.ganymed</groupId>

                              <artifactId>ganymed-ssh2</artifactId>

                              <version>build210</version>

                          </dependency>

                          <dependency>

                              <groupId>commons-lang</groupId>

                              <artifactId>commons-lang</artifactId>

                              <version>2.5</version>

                              <type>jar</type>

                          </dependency>

                   

                   

                          <dependency>

                              <groupId>commons-logging</groupId>

                              <artifactId>commons-logging</artifactId>

                              <version>1.1.1</version>

                              <scope>provided</scope>

                          </dependency>

                   

                   

                   

                   

                          <dependency>

                              <groupId>javax.validation</groupId>

                              <artifactId>validation-api</artifactId>

                              <version>1.0.0.GA</version>

                              <type>jar</type>

                              <scope>provided</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.codehaus.groovy</groupId>

                              <artifactId>groovy</artifactId>

                              <version>${groovy.version}</version>

                              <type>jar</type>

                              <exclusions>

                                  <exclusion>

                                      <artifactId>antlr</artifactId>

                                      <groupId>org.antlr</groupId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>org.codehaus.groovy.maven.runtime</groupId>

                              <artifactId>gmaven-runtime-default</artifactId>

                              <version>1.0-rc-3</version>

                              <type>jar</type>

                              <scope>compile</scope>

                              <exclusions>

                                  <exclusion>

                                      <groupId>org.codehaus.groovy</groupId>

                                      <artifactId>groovy-all-minimal</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>slf4j-api</artifactId>

                                      <groupId>org.slf4j</groupId>

                                  </exclusion>

                                  <exclusion>

                                      <artifactId>ant</artifactId>

                                      <groupId>org.apache.ant</groupId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                   

                   

                          <dependency>

                              <groupId>org.springframework</groupId>

                              <artifactId>spring-tx</artifactId>

                              <version>${spring.version}</version>

                              <type>jar</type>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.springframework</groupId>

                              <artifactId>spring-core</artifactId>

                              <version>${spring.version}</version>

                              <type>jar</type>

                              <scope>test</scope>

                          </dependency>

                          <dependency>

                              <groupId>org.springframework</groupId>

                              <artifactId>spring-context</artifactId>

                              <version>${spring.version}</version>

                              <type>jar</type>

                              <scope>test</scope>

                          </dependency>

                   

                   

                   

                  {code}

                   

                  The error I get when running the tests is:

                   

                   

                  {code}

                  ...

                  18.07.2011 09:43:54 org.springframework.test.context.transaction.TransactionalTestExecutionListener startNewTransaction

                  INFO: Began transaction (1): transaction manager [org.springframework.orm.jpa.JpaTransactionManager@7b0f4d]; rollback [true]

                  18.07.2011 09:43:54 org.hibernate.internal.CoreMessageLogger_$logger warn

                  WARN: SQL Error: -20, SQLState: IM001

                  18.07.2011 09:43:54 org.hibernate.internal.CoreMessageLogger_$logger error

                  ERROR: This function is not supported

                  18.07.2011 09:43:54 org.springframework.test.context.transaction.TransactionalTestExecutionListener endTransaction

                  INFO: Rolled back transaction after test execution for test context [[TestContext@1183871 testClass = EmployeeDaoTest, locations = array<String>['classpath:META-INF/context.xml'], testInstance = de.adesso.profiler.dao.EmployeeDaoTest@12192a9, testMethod = testNoEhemaligeGroupShouldFail@EmployeeDaoTest, testException = javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: This function is not supported]]

                  ...

                  {code}

                   

                  I guess the last chance I have is to migrate to Arquilian for my tests: http://www.jboss.org/arquillian

                  • 6. Re: Migrating to JBoss 7.0.0.Final: SearchException with Hibernate 3
                    Thomas T Newbie

                    Ok, here's my fix:

                     

                    I figured out that somehow the problem in my Tests (with Spring-Test) seemed actually to be the hsqldb that I configured within the spring configuration (xml-file). I changed this to be the embedded h2 database as described here:

                     

                    http://blog.ralscha.ch/?p=542

                     

                    Now finally the tests run just fine! :-)