-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: org.hibernate.TransactionException with WebLogic 8.1
PostPosted: Thu Mar 16, 2006 8:22 am 
Newbie

Joined: Thu Mar 16, 2006 8:15 am
Posts: 1
Friends,

I am using WebLogic 8.1 and When I try to run my program, I get the following error. I am using "org.hibernate.transaction.WeblogicTransactionManagerLookup" as my "hibernate.transaction.manager_lookup_class".

Thanks in advance....
Nag.

WeblogicNonCatalogAppender.append(LoggingEvent)] DEBUG: Obtained UserTransaction

<Mar 16, 2006 5:27:30 PM GMT+05:30> <Error> <HTTP> <BEA-101020> <[ServletContext(id=8087063,name=budgetWeb,context-path=/budgetWeb)] Servlet failed with Exception

org.hibernate.TransactionException: could not register synchronization

at org.hibernate.transaction.JTATransaction.registerSynchronization(JTATransaction.java:309)

at org.hibernate.context.ThreadLocalSessionContext.currentSession(ThreadLocalSessionContext.java:78)

at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:507)

at com.budget.biz.hibernate.GetStationBO.displayStationDetails(GetStationBO.java:16)

at jsp_servlet._jsp._test.__testhibernate._jspService(__testhibernate.java:124)

at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)

at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)

at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:351)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6458)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)

at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)

at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

Caused by: java.lang.NullPointerException

at org.hibernate.transaction.JTATransaction.registerSynchronization(JTATransaction.java:306)

... 19 more

>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 15, 2006 10:17 am 
Newbie

Joined: Thu Jun 15, 2006 10:10 am
Posts: 2
Hi,
I have the same error. Did you have find any solution?


Top
 Profile  
 
 Post subject: RE:org.hibernate.TransactionException with WebLogic 8.1
PostPosted: Fri Jun 16, 2006 5:07 am 
Newbie

Joined: Thu Jun 15, 2006 10:10 am
Posts: 2
Hi,
I found the problem solution.

You must configure the hibernate (hibernate.cfg.xml) like this, note the value of "current_session_context_class" parameter to "jta":

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd" >
<hibernate-configuration>
<session-factory>

<property name="jndi.url">t3://localhost:7001</property>
<property name="jndi.class">weblogic.jndi.WLInitialContextFactory</property>


<!-- JBoss Data Source Connection -->
<property name="connection.datasource">myDataSource</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<!--
<property name="transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
-->
<!--
<property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.WeblogicTransactionManagerLookup</property>
-->


<!-- Database connection settings -->
<!--
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql:///hibernate</property>
<property name="connection.username">root</property>
<property name="connection.password" />
-->
<!-- JDBC connection pool (use the built-in) -->
<!--
<property name="connection.pool_size">1</property>
-->
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="dialect">org.hibernate.dialect.MySQLMyISAMDialect</property>

<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">jta</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

<!-- Drop and re-create the database schema on startup -->
<!-- property name="hbm2ddl.auto">create</property -->

<mapping resource="com/atosorigin/next/mrm/engine/db/Indexes.hbm.xml"/>

</session-factory>


</hibernate-configuration>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.