title: "No Session found for current thread" with Spring3+Hibernate4 using JTA TransactionManager
body: <p>I am trying to do a migration from </p>
  
  <p>spring 1.2.9 with hibernate 3.2.0.ga </p>
  
  <p>to </p>
  
  <p>spring 3.1.1.RELEASE with hibernate 4.0.1.Final</p>
  
  <p>Most of the <strong>bean wiring are done with xml</strong> instead of annotation.  I have done the necessary changes as well as unit testing for dao, service and controller objects before deployment to ensure the compatibility of the existing spring configuration.</p>
  
  <p>When I deploy to JBoss AS 7.1.1.Final, I get "No Session found for current thread".  I have been looking for answer through this forum and spring and hibernate documentation, and I still not able to find a solution that is applicable to my problem.</p>
  
  <p>Here is the hibernate exception logs</p>
  
  <pre><code>&gt; 06:18:25,703 ERROR [com.test.customer.dao.InvoicingInfoDAOImpl] (http--12
  7.0.0.1-8080-1) selectBillingInfoIdById:Runtime error.: org.hibernate.HibernateE
  xception: **No Session found for current thread**
          at org.springframework.orm.hibernate4.SpringSessionContext.currentSessio
  n(SpringSessionContext.java:97) [spring-orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFa
  ctoryImpl.java:883) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
          at com.test.customer.dao.InvoicingInfoDAOImpl.selectBillingInfoBy
  Id(InvoicingInfoDAOImpl.java:58) [classes:]
          at com.test.customer.services.CustomerServiceImpl.getBillingInfo(
  CustomerServiceImpl.java:535) [classes:]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1
  .6.0_25]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
  java:39) [rt.jar:1.6.0_25]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
  sorImpl.java:25) [rt.jar:1.6.0_25]
          at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_25]
          at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflecti
  on(AopUtils.java:318) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJo
  inpoint(ReflectiveMethodInvocation.java:183) [spring-aop-3.1.1.RELEASE.jar:3.1.1
  .RELEASE]
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
  ReflectiveMethodInvocation.java:150) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE
  ]
          at org.springframework.transaction.interceptor.TransactionInterceptor.in
  voke(TransactionInterceptor.java:110) [spring-tx-3.1.1.RELEASE.jar:3.1.1.RELEASE
  ]
          at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
  ReflectiveMethodInvocation.java:172) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE
  ]
          at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynami
  cAopProxy.java:202) [spring-aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at $Proxy22.getBillingInfo(Unknown Source)      at com.test.custo
  mer.CustomerController.getBillingInfo(CustomerController.java:205) [classes:]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1
  .6.0_25]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
  java:39) [rt.jar:1.6.0_25]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
  sorImpl.java:25) [rt.jar:1.6.0_25]
          at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_25]
          at org.springframework.web.method.support.InvocableHandlerMethod.invoke(
  InvocableHandlerMethod.java:213) [spring-web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.springframework.web.method.support.InvocableHandlerMethod.invokeF
  orRequest(InvocableHandlerMethod.java:126) [spring-web-3.1.1.RELEASE.jar:3.1.1.R
  ELEASE]
          at org.springframework.web.servlet.mvc.method.annotation.ServletInvocabl
  eHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) [spring-we
  bmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingH
  andlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) [spring
  -webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingH
  andlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) [spring-webm
  vc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapt
  er.handle(AbstractHandlerMethodAdapter.java:80) [spring-webmvc-3.1.1.RELEASE.jar
  :3.1.1.RELEASE]
          at org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatch
  erServlet.java:923) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.springframework.web.servlet.DispatcherServlet.doService(Dispatche
  rServlet.java:852) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.springframework.web.servlet.FrameworkServlet.processRequest(Frame
  workServlet.java:882) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServ
  let.java:789) [spring-webmvc-3.1.1.RELEASE.jar:3.1.1.RELEASE]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-s
  ervlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-s
  ervlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
  icationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
  ilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
  alve.java:275) [jbossweb-7.0.13.Final.jar:]
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
  alve.java:161) [jbossweb-7.0.13.Final.jar:]
          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(Secu
  rityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
  </code></pre>
  
  <p>Here is the spring configuration for session factory and transaction manager (it is using jta here)</p>
  
  <pre><code>&gt; &lt;!-- Configuration of Hibernate SessionFactory --&gt;
      &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource"&gt;
              &lt;ref bean="csvliteDataSource" /&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;ref bean="csvliteHibernateProperties" /&gt;
          &lt;/property&gt;
          &lt;property name="mappingResources"&gt;
              &lt;list&gt;
                  &lt;!-- Customer Domain Mapping --&gt;
                  &lt;value&gt;com/test/customer/domain/InvoicingInfo.hbm.xml&lt;/value&gt;
                  &lt;value&gt;com/test/customer/domain/PickupAddress.hbm.xml&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configurationof Hibernate Configuration Properties --&gt;
      &lt;bean id="csvliteHibernateProperties" class="java.util.Properties"&gt;
          &lt;constructor-arg&gt;
              &lt;props&gt;
                  &lt;!-- Hibernate Configuration Properties --&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.SQLServer2008Dialect&lt;/prop&gt;             
                  &lt;prop key="hibernate.current_session_context_class"&gt;org.springframework.orm.hibernate4.SpringSessionContext&lt;/prop&gt;
                  &lt;!-- Hibernate Configuration Properties - enabled only if debugging --&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.generate_statistics"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.use_sql_comments"&gt;true&lt;/prop&gt;
                  &lt;!-- Hibernate Cache Properties --&gt;
                  &lt;prop key="hibernate.cache.provider_class"&gt;org.hibernate.cache.OSCacheProvider&lt;/prop&gt;
                  &lt;prop key="hibernate.cache.use_query_cache"&gt;true&lt;/prop&gt;         
              &lt;/props&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configuration of Data Source --&gt;
      &lt;bean id="csvliteDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
          &lt;property name="jndiName"&gt;
              &lt;value&gt;java:jboss/datasources/CSLiteDS&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configuration of Transaction Manager --&gt;
      &lt;bean id="csvliteTxManager"
          class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
          &lt;property name="transactionManagerName"&gt;
              &lt;value&gt;java:jboss/TransactionManager&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>Here is spring configuration for relevant dao and service objects (it uses TransactionProxyFactoryBean for each service object)</p>
  
  <pre><code>&lt;bean id="invoicingInfoDAO"
      class="com.test.customer.dao.InvoicingInfoDAOImpl"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="pickupAddressDAO"
      class="com.test.customer.dao.PickupAddressDAOImpl"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="customerService"
      class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"&gt;
      &lt;property name="transactionManager" ref="csvliteTxManager"/&gt;
      &lt;property name="target" ref="customerServiceImpl"/&gt;
      &lt;property name="transactionAttributes"&gt; 
          &lt;props&gt;     
              &lt;prop key="getBillingInfo"&gt;PROPAGATION_REQUIRES_NEW, -Throwable&lt;/prop&gt;                                              
              &lt;prop key="addBillingInfo"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="updateBillingInfo"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="addPickupAddress"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="updatePickupAddress"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="getPickupAddress"&gt;PROPAGATION_REQUIRES_NEW, -Throwable&lt;/prop&gt;
              &lt;prop key="unlockPickupAddress"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="lockPickupAddress"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="lockBillingInfo"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="unlockBillingInfo"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="closePickupAddress"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="processPurgePickupAddress"&gt;PROPAGATION_REQUIRED, -Throwable&lt;/prop&gt;
              &lt;prop key="getMultiplePickupAddress"&gt;PROPAGATION_REQUIRES_NEW, -Throwable&lt;/prop&gt;           
          &lt;/props&gt;
      &lt;/property&gt;     
  &lt;/bean&gt; 
  &lt;bean id="customerServiceImpl" class="com.test.customer.services.CustomerServiceImpl"&gt;
      &lt;property name="invoicingInfoDAO" ref="invoicingInfoDAO"/&gt;  
      &lt;property name="pickupAddressDAO" ref="pickupAddressDAO"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>What have really I missed out in my configuration?</p>
  
  <p>=========================</p>
  
  <p>[Update - 20121101]</p>
  
  <p>I took the suggestion from @adrian-shum, and cross reference with some information I found over the net.</p>
  
  <p>I did the following tests, but all of the test are not working except when i switch to HibernateTransaction instead of JTA transaction.</p>
  
  <h1>Test 1 - SUCCESS</h1>
  
  <p>(with HibernateTransactionManager)</p>
  
  <pre><code>&lt;!-- Configurationof Hibernate Configuration Properties --&gt;
      &lt;bean id="csvliteHibernateProperties" class="java.util.Properties"&gt;
          &lt;constructor-arg&gt;
              &lt;props&gt;
                  &lt;!-- Hibernate Configuration Properties --&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.SQLServer2008Dialect&lt;/prop&gt;             
                  &lt;prop key="hibernate.current_session_context_class"&gt;org.springframework.orm.hibernate4.SpringSessionContext&lt;/prop&gt;
  
          &lt;!-- Hibernate Configuration Properties - enabled only if debugging --&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.generate_statistics"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.use_sql_comments"&gt;true&lt;/prop&gt;
                  &lt;!-- Hibernate Cache Properties --&gt;
                  &lt;prop key="hibernate.cache.provider_class"&gt;org.hibernate.cache.OSCacheProvider&lt;/prop&gt;
                  &lt;prop key="hibernate.cache.use_query_cache"&gt;true&lt;/prop&gt;         
              &lt;/props&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configuration of Data Source --&gt;
      &lt;bean id="csvliteDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
          &lt;property name="jndiName"&gt;
              &lt;value&gt;java:jboss/datasources/CSLiteDS&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configuration of Transaction Manager --&gt;
      &lt;bean id="csvliteTxManager"
          class="org.springframework.orm.hibernate4.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <h1>TEST 2 - FAILED</h1>
  
  <p>(with JtaTransactionManager - hibernate.transaction.manager_lookup_class + hibernate.transaction.factory_class)</p>
  
  <pre><code>&lt;!-- Configurationof Hibernate Configuration Properties --&gt;
      &lt;bean id="csvliteHibernateProperties" class="java.util.Properties"&gt;
          &lt;constructor-arg&gt;
              &lt;props&gt;
                  &lt;!-- Hibernate Configuration Properties --&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.SQLServer2008Dialect&lt;/prop&gt;             
                  &lt;prop key="hibernate.current_session_context_class"&gt;org.springframework.orm.hibernate4.SpringSessionContext&lt;/prop&gt;
                  &lt;prop key="hibernate.transaction.factory_class"&gt;org.hibernate.transaction.JtaTransactionFactory&lt;/prop&gt;
                  &lt;prop key="hibernate.transaction.manager_lookup_class"&gt;org.hibernate.transaction.JBossTransactionManagerLookup&lt;/prop&gt;
  
                  &lt;!-- Hibernate Configuration Properties - enabled only if debugging --&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.generate_statistics"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.use_sql_comments"&gt;true&lt;/prop&gt;
                  &lt;!-- Hibernate Cache Properties --&gt;
                  &lt;prop key="hibernate.cache.provider_class"&gt;org.hibernate.cache.OSCacheProvider&lt;/prop&gt;
                  &lt;prop key="hibernate.cache.use_query_cache"&gt;true&lt;/prop&gt;         
              &lt;/props&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configuration of Data Source --&gt;
      &lt;bean id="csvliteDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
          &lt;property name="jndiName"&gt;
              &lt;value&gt;java:jboss/datasources/CSLiteDS&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configuration of Transaction Manager --&gt;   
      &lt;bean id="csvliteTxManager"
          class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
          &lt;property name="transactionManagerName"&gt;
              &lt;value&gt;java:jboss/TransactionManager&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <h1>TEST 3 - FAILED</h1>
  
  <p>(with JtaTransactionManager - hibernate.transaction.jta.platform property)</p>
  
  <pre><code>&lt;!-- Configurationof Hibernate Configuration Properties --&gt;
      &lt;bean id="csvliteHibernateProperties" class="java.util.Properties"&gt;
          &lt;constructor-arg&gt;
              &lt;props&gt;
                  &lt;!-- Hibernate Configuration Properties --&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.SQLServer2008Dialect&lt;/prop&gt;             
                  &lt;prop key="hibernate.current_session_context_class"&gt;org.springframework.orm.hibernate4.SpringSessionContext&lt;/prop&gt;
                  &lt;!-- prop key="hibernate.transaction.jta.platform"&gt;org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform&lt;/prop--&gt;
                  &lt;prop key="hibernate.transaction.jta.platform"&gt;org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform&lt;/prop&gt;
  
                  &lt;!-- Hibernate Configuration Properties - enabled only if debugging --&gt;
                  &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.format_sql"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.generate_statistics"&gt;true&lt;/prop&gt;
                  &lt;prop key="hibernate.use_sql_comments"&gt;true&lt;/prop&gt;
                  &lt;!-- Hibernate Cache Properties --&gt;
                  &lt;prop key="hibernate.cache.provider_class"&gt;org.hibernate.cache.OSCacheProvider&lt;/prop&gt;
                  &lt;prop key="hibernate.cache.use_query_cache"&gt;true&lt;/prop&gt;         
              &lt;/props&gt;
          &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configuration of Data Source --&gt;
      &lt;bean id="csvliteDataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
          &lt;property name="jndiName"&gt;
              &lt;value&gt;java:jboss/datasources/CSLiteDS&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- Configuration of Transaction Manager --&gt;
      &lt;bean id="csvliteTxManager"
          class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
          &lt;property name="transactionManagerName"&gt;
              &lt;value&gt;java:jboss/TransactionManager&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>Using Hibernate Transaction is not an option for me.  Is there anything I need to do on JBoss AS 7 side in order to make the JTA transaction works? </p>
  
  <p>=========================</p>
  
  <p>[Update - 20121101]</p>
  
  <p>Basically, I did not find any other exception from the log other than the exception that I have posted earlier.</p>
  
  <p>However, interestingly i did not see any log entry that shows the binding of transaction manager to the JNDI that I have specified, and it always says it will be using "HHH000399: Using default transaction strategy (direct JDBC transactions)"  </p>
  
  <pre><code>15:46:00,548 INFO  [org.springframework.transaction.jta.JtaTransactionManager] (
  MSC service thread 1-5) Using JTA UserTransaction: org.jboss.tm.usertx.client.Se
  rverVMClientUserTransaction@307c44
  15:46:00,548 INFO  [org.springframework.transaction.jta.JtaTransactionManager] (
  MSC service thread 1-5) Using JTA TransactionManager: com.arjuna.ats.jbossatx.jt
  a.TransactionManagerDelegate@a2f435
  15:46:00,548 INFO  [org.springframework.transaction.jta.JtaTransactionManager] (
  MSC service thread 1-5) Using JTA TransactionSynchronizationRegistry: com.arjuna
  .ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple
  @4ef523
  15:46:01,736 INFO  [org.hibernate.annotations.common.Version] (MSC service threa
  d 1-5) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
  15:46:01,767 INFO  [org.hibernate.Version] (MSC service thread 1-5) HHH000412: H
  ibernate Core {4.0.1.Final}
  15:46:01,783 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-5) HHH0
  00206: hibernate.properties not found
  15:46:01,783 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-5) HHH0
  00021: Bytecode provider name : javassist
  15:46:06,142 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-5) HHH0
  00400: Using dialect: org.hibernate.dialect.SQLServer2008Dialect
  15:46:06,189 INFO  [org.hibernate.engine.transaction.internal.TransactionFactory
  Initiator] (MSC service thread 1-5) HHH000399: Using default transaction strateg
  y (direct JDBC transactions)
  15:46:06,205 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (M
  SC service thread 1-5) HHH000397: Using ASTQueryTranslatorFactory
  15:46:06,361 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-
  5) Hibernate Validator 4.2.0.Final
  </code></pre>
  
  <p>Not sure if this is the cause... if yes, what do i need to do then? </p>
  
  <p>=========================</p>
  
  <p>[Update - 20130425]</p>
  
  <p>I suspect this may have something to do with XA data source not being configured.  I will test and confirm.</p>
  
  <p>I still appreciate if someone could enlighten me what could be the possible cause.</p>
  
  <p>[Update - 20130426]</p>
  
  <p>I have configured XA data source as follows, yet i'm still having the same error.  Another thing that I have tried is to upgrade to use hibernate 4.2 and i still end up with the same error.</p>
  
  <p>Has anyone tried configuring global JTA transaction support with JBoss7.1.1.final+Spring3.1.1.RELEASE+Hibernate4.0.1.Final+MS SQL server 2008?</p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:datasources:1.0"&gt;
    &lt;datasources&gt;
      &lt;xa-datasource jta="true" jndi-name="java:jboss/datasources/CSLiteDS" pool-name="CSLiteDS" enabled="true" use-java-context="true"&gt;
        &lt;xa-datasource-property name="ServerName"&gt;{someServerName}&lt;/xa-datasource-property&gt;
        &lt;xa-datasource-property name="PortNumber"&gt;{somePortNo}&lt;/xa-datasource-property&gt;
        &lt;xa-datasource-property name="DatabaseName"&gt;{someDatabaseName}&lt;/xa-datasource-property&gt;
        &lt;xa-datasource-property name="SelectMethod"&gt;cursor&lt;/xa-datasource-property&gt;
        &lt;driver&gt;sqljdbc&lt;/driver&gt;
        &lt;security&gt;
          &lt;user-name&gt;{someUserName}&lt;/user-name&gt;
          &lt;password&gt;{somePassword}&lt;/password&gt;
        &lt;/security&gt;
      &lt;/xa-datasource&gt;
      &lt;xa-datasource jta="true" jndi-name="java:jboss/datasources/CRDDataSource" pool-name="CRDDataSource" enabled="true" use-java-context="true"&gt;
        &lt;xa-datasource-property name="ServerName"&gt;{someServerName}&lt;/xa-datasource-property&gt;
        &lt;xa-datasource-property name="PortNumber"&gt;{somePortNo}&lt;/xa-datasource-property&gt;
        &lt;xa-datasource-property name="DatabaseName"&gt;{someDatabaseName}&lt;/xa-datasource-property&gt;
        &lt;xa-datasource-property name="SelectMethod"&gt;cursor&lt;/xa-datasource-property&gt;
        &lt;driver&gt;sqljdbc&lt;/driver&gt;
        &lt;security&gt;
          &lt;user-name&gt;{someUserName}&lt;/user-name&gt;
          &lt;password&gt;{somePassword}&lt;/password&gt;
        &lt;/security&gt;
      &lt;/xa-datasource&gt;
      &lt;drivers&gt;
        &lt;driver name="sqljdbc" module="com.microsoft.sqlserver.jdbc"&gt;
          &lt;driver-class&gt;com.microsoft.sqlserver.jdbc.SQLServerDriver&lt;/driver-class&gt;
          &lt;xa-datasource-class&gt;com.microsoft.sqlserver.jdbc.SQLServerXADataSource&lt;/xa-datasource-class&gt;
        &lt;/driver&gt;
      &lt;/drivers&gt;
    &lt;/datasources&gt;
  &lt;/subsystem&gt;
  </code></pre>