[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2023) Hibernate 3.2 not working under WebSphere 6.0.2

Andrei Iltchenko (JIRA) noreply at atlassian.com
Thu Aug 24 04:45:24 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2023?page=comments#action_24063 ] 

Andrei Iltchenko commented on HHH-2023:
---------------------------------------

I will try CMTTransactionFactory, but the point is that it should work with JTATransactionFactory just as well. Here's what Hibernate's official reference manual says:
org.hibernate.transaction.JTATransactionFactory
delegates to container-managed transaction if an existing transaction is underway in this context (e.g. EJB
session bean method), otherwise a new transaction is started and bean-managed transaction are used.

Besides, if we look at the scenario of <http://opensource.atlassian.com/projects/hibernate/browse/HHH-198>, we'll see that there they were also using CMT SLSBs and got it to work with JTATransactionFactory.

> Hibernate 3.2 not working under WebSphere 6.0.2
> -----------------------------------------------
>
>          Key: HHH-2023
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2023
>      Project: Hibernate3
>         Type: Bug

>   Components: core
>     Versions: 3.2.0.cr2
>  Environment: 1) WebSphere Application Server 6.0.2.9, Base
> 2) Hibernate version: 3.2.CR2
> 3) Oracle 10g
> 4) Driver Oracle 10g XA thin driver (Managed Connection) 
> 5) SessionFacade with a transactional attribute Requires
>     Reporter: Andrei Iltchenko
>     Priority: Blocker

>
>
> I am getting the following exception when I try to use Hibernate on WebSphere 6.0.2.9 in a business method of a CMT SLSB. The exception occurs when I call 'session.beginTransaction()':
> org.hibernate.TransactionException: Could not find UserTransaction in JNDI: 
>    at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:64) 
>    at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:57) 
>    at org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java:186) 
>    at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1308) 
>    at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1318) 
>    at rootpackage.application.business.logic.ServiceAgreementSvcBean.storeServiceAgreement(ServiceAgreementSvcBean.java:832) 
>    ... 37 more 
> Caused by: javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:". 
>    at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1094) 
>    at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:990) 
>    at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) 
>    at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:201) 
>    at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:142) 
>    at javax.naming.InitialContext.lookup(InitialContext.java:361) 
>    at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:60) 
> My SessionFactory configuration file looks as follows: 
> <session-factory name="java:hibernate/RootpackageEntitySessionFactory"> 
>     <!-- DBMS dialect: oracle. --> 
>     <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property> 
>     <property name="hibernate.connection.datasource">jdbc/optimalj5</property> 
>     <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property> 
>     <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property> 
>     <!-- Cache manager --> 
>     <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property> 
>     <!-- Mapping files for entity module: --> 
>     ... 
>   </session-factory> 
> adding additional configuration options as suggested in <http://opensource.atlassian.com/projects/hibernate/browse/HHH-198>
>         <property name="hibernate.transaction.flush_before_completion">true</property>
>         <property name="hibernate.transaction.auto_close_session">true</property>
> causes the exception to be thrown at a time when I call openSession() on a SessionFactory instance:
>  Exception data: org.hibernate.TransactionException: Unable to locate UserTransaction to check status
>         at org.hibernate.transaction.JTATransactionFactory.isTransactionInProgress(JTATransactionFactory.java:86)
>         at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:180)
>         at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:158)
>         at org.hibernate.jdbc.JDBCContext.<init>(JDBCContext.java:75)
>         at org.hibernate.impl.SessionImpl.<init>(SessionImpl.java:215)
>         at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:470)
>         at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:494)
>         at org.hibernate.impl.SessionFactoryImpl.openSession(SessionFactoryImpl.java:502)
>         at rootpackage.application.business.logic.ServiceAgreementSvcBean.retrieveAll(ServiceAgreementSvcBean.java:1584)
>         at rootpackage.application.business.logic.EJSRemoteStatelessServiceAgreementSvc_10611836.retrieveAll(Unknown Source)
>         at rootpackage.application.business.logic._ServiceAgreementSvc_Stub.retrieveAll(_ServiceAgreementSvc_Stub.java:799)
>         at rootpackage.application.business.facade.ServiceAgreementSvcServiceAgreementBusinessFacade.retrieveAll(ServiceAgreementSvcServiceAgreementBusinessFacade.java:1980)
>         at rootpackage.application.business.facade.ServiceAgreementSvcServiceAgreementBusinessFacade.retrieveAll(ServiceAgreementSvcServiceAgreementBusinessFacade.java:1948)
>         at rootpackage.application.presentation.ServiceAgreementSvcAction.invokeRetrieveAll(ServiceAgreementSvcAction.java:226)
>         at rootpackage.application.presentation.ServiceAgreementSvcRetrieveAction.handleRetrieveAll(ServiceAgreementSvcRetrieveAction.java:144)
>         at rootpackage.application.presentation.ServiceAgreementSvcRetrieveAction.retrieve(ServiceAgreementSvcRetrieveAction.java:247)
>         at rootpackage.application.presentation.ServiceAgreementSvcRetrieveAction.execute(ServiceAgreementSvcRetrieveAction.java:87)
>         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
>         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
>         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
>         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1239)
>         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:113)
>         at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:670)
>         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:322)
>         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
>         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388)
>         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
>         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
>         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1282)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1239)
>         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:136)
>         at rootpackage.application.presentation.filters.SetCharacterEncodingFilterRootpackageWeb.doFilter(SetCharacterEncodingFilterRootpackageWeb.java:139)
>         at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
>         at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
>         at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
>         at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:670)
>         at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:2965)
>         at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:221)
>         at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
>         at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1931)
>         at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:84)
>         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
>         at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
>         at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
>         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
>         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
>         at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
>         at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
>         at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
> Forum reference: <http://forum.hibernate.org/viewtopic.php?t=963579>

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list