org.hibernate.HibernateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Hi, I have made a hibernate-service.xml file and deployed it under myApplication.har file The xml file contents are <?xml version="1.0"?> <server> <mbean code="org.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactory"> <!-- Required services --> <depends>jboss.jca:service=RARDeployer</depends> <!-- Bind the Hibernate service to JNDI --> <attribute name="JndiName">java:/hibernate/SessionFactory</attribute> <!-- Datasource settings --> <attribute name="Datasource">java:/jdbc/mysqlserverr</attribute> <attribute name="Dialect">org.hibernate.dialect.MySQLDialect</attribute> <!-- Transaction integration --> <attribute name="TransactionStrategy"> org.hibernate.transaction.JTATransactionFactory</attribute> <attribute name="TransactionManagerLookupStrategy"> org.hibernate.transaction.JBossTransactionManagerLookup</attribute> <attribute name="FlushBeforeCompletionEnabled">true</attribute> <attribute name="AutoCloseSessionEnabled">true</attribute> <!-- Fetching options --> <attribute name="MaximumFetchDepth">5</attribute> <!-- Second-level caching --> <attribute name="SecondLevelCacheEnabled">true</attribute> <attribute name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute> <attribute name="QueryCacheEnabled">true</attribute> <!-- Logging --> <attribute name="ShowSqlEnabled">true</attribute> </mbean> </server> Through my Stateless Session EJB i call a method private Session getSession() { if (sessionFactory == null) sessionFactory = // by look up } return sessionFactory.getCurrentSession(); } I get following excpetion 09:29:14,304 INFO [STDOUT] org.hibernate.HibernateException: Unable to locate current JTA transaction at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61) at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:604) at com.daffodilwoods.framework.datasource.ResourceManager.currentSession(ResourceManager.java:234) at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getHibernateSession(DataObjectMetaD at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getDefaultColumns(DataObjectMetaDat at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getObject(DataObjectMetaDataLoader. at com.daffodilwoods.framework.core.view.server.metadataloader.AbsTableMetaDataUtil.loadMetadata(AbsTableMetaDataU at com.daffodilwoods.framework.table.server.TableMetaDataLoader.getObject(TableMetaDataLoader.java:87) at com.daffodilwoods.framework.table.server.TableService.createView(TableService.java:32) at com.daffodilwoods.framework.core.view.server.service.AbsViewService.init(AbsViewService.java:41) at com.daffodilwoods.framework.core.view.server.service.AbsViewService.getViewMetaDataHandler(AbsViewService.java: at com.daffodilwoods.framework.table.server.TableService.getData(TableService.java:56) at com.daffodilwoods.framework.core.view.server.service.AbsViewService.getData(AbsViewService.java:68) at com.daffodilwoods.framework.core.view.server.service.ViewService.getData(ViewService.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:299) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:186) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) 09:29:14,304 INFO [STDOUT] org.hibernate.HibernateException: Unable to locate current JTA transaction Can u tell me wht can i do for it. I think there is not support for providing currentSessionContext attribute in this xml file also Please reply
    via by Kuldeep Singh Virdi,
  • Hi, I have made a hibernate-service.xml file and deployed it under myApplication.har file The xml file contents are <?xml version="1.0"?> <server> <mbean code="org.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory,name=HibernateFactory"> <!-- Required services --> <depends>jboss.jca:service=RARDeployer</depends> <!-- Bind the Hibernate service to JNDI --> <attribute name="JndiName">java:/hibernate/SessionFactory</attribute> <!-- Datasource settings --> <attribute name="Datasource">java:/jdbc/mysqlserverr</attribute> <attribute name="Dialect">org.hibernate.dialect.MySQLDialect</attribute> <!-- Transaction integration --> <attribute name="TransactionStrategy"> org.hibernate.transaction.JTATransactionFactory</attribute> <attribute name="TransactionManagerLookupStrategy"> org.hibernate.transaction.JBossTransactionManagerLookup</attribute> <attribute name="FlushBeforeCompletionEnabled">true</attribute> <attribute name="AutoCloseSessionEnabled">true</attribute> <!-- Fetching options --> <attribute name="MaximumFetchDepth">5</attribute> <!-- Second-level caching --> <attribute name="SecondLevelCacheEnabled">true</attribute> <attribute name="CacheProviderClass">org.hibernate.cache.EhCacheProvider</attribute> <attribute name="QueryCacheEnabled">true</attribute> <!-- Logging --> <attribute name="ShowSqlEnabled">true</attribute> </mbean> </server> Through my Stateless Session EJB i call a method private Session getSession() { if (sessionFactory == null) sessionFactory = // by look up } return sessionFactory.getCurrentSession(); } I get following excpetion 09:29:14,304 INFO [STDOUT] org.hibernate.HibernateException: Unable to locate current JTA transaction at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61) at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:604) at com.daffodilwoods.framework.datasource.ResourceManager.currentSession(ResourceManager.java:234) at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getHibernateSession(DataObjectMetaD at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getDefaultColumns(DataObjectMetaDat at com.daffodilwoods.framework.core.dataobject.server.DataObjectMetaDataLoader.getObject(DataObjectMetaDataLoader. at com.daffodilwoods.framework.core.view.server.metadataloader.AbsTableMetaDataUtil.loadMetadata(AbsTableMetaDataU at com.daffodilwoods.framework.table.server.TableMetaDataLoader.getObject(TableMetaDataLoader.java:87) at com.daffodilwoods.framework.table.server.TableService.createView(TableService.java:32) at com.daffodilwoods.framework.core.view.server.service.AbsViewService.init(AbsViewService.java:41) at com.daffodilwoods.framework.core.view.server.service.AbsViewService.getViewMetaDataHandler(AbsViewService.java: at com.daffodilwoods.framework.table.server.TableService.getData(TableService.java:56) at com.daffodilwoods.framework.core.view.server.service.AbsViewService.getData(AbsViewService.java:68) at com.daffodilwoods.framework.core.view.server.service.ViewService.getData(ViewService.java:71) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:299) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:186) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112) at java.lang.Thread.run(Thread.java:595) 09:29:14,304 INFO [STDOUT] org.hibernate.HibernateException: Unable to locate current JTA transaction Can u tell me wht can i do for it. I think there is not support for providing currentSessionContext attribute in this xml file also Please reply
    via by Kuldeep Singh Virdi,
  • Unable to locate current JTA transaction error
    via by Yahya Elyasse,
  • Problem with Hibernate3 on WAS 5.1
    via by Jaikiran Pai,
  • Deploying on jboss using getCurrentSession
    via Stack Overflow by Sandeep
    ,
    • org.hibernate.HibernateException: Unable to locate current JTA transaction at org.hibernate.context.JTASessionContext.currentSession(JTASessionContext.java:61) at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:604) at com.daffodilwoods.framework.datasource.ResourceManager.currentSession(ResourceManager.java:234)

    Users with the same issue

    Unknown visitor1 times, last one,