• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TransactionManager not bound. (Hibernate + JBoss + Oracle)

 
Swetha Ganapa
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

I am trying to fetch a record from the database as an initial step after configuring Hibernate3 + JBoss 4.0.5 with Oracle as the backend.

I am using the default server in JBoss, configured a datasource called OracleDS. Below is how I mapped it with hibernate.

<?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">http://localhost:8080/invoker/JNDIFactory</property>
<property name="jndi.class">org.jboss.naming.HttpNamingContextFactory</property>
<property name="connection.datasource">java:/OracleDS</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="current_session_context_class">jta</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="show_sql">true</property>

<!-- <property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>-->
<mapping resource="valueObjects/Contract.hbm.xml"/>

</session-factory>
</hibernate-configuration>


and the code I am trying to fetch the record is:



I am getting the exception as 'TransactionManager not bound', Please find the stackTrace below. Being new to both Hibernate and JBoss, am not sure whether the problem is with configuring JBoss or Hibernate. Thanks for any help in advance.

[java] Exception in thread "main" org.hibernate.HibernateException: Could not locate TransactionManager
[java] at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)
[java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:325)
[java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
[java] at dao.TestDAO.main(Unknown Source)
[java] Caused by: javax.naming.NameNotFoundException: TransactionManager not bound
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
[java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
[java] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
[java] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
[java] at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.jboss.naming.NamingService.invoke(NamingService.java:361)
[java] at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
[java] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
[java] at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
[java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
[java] at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke ModelMBeanOperationInterceptor.java:142)
[java] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
[java] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
[java] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
[java] at org.jboss.invocation.http.servlet.InvokerServlet.processReque
st(InvokerServlet.java:162)
[java] at org.jboss.invocation.http.servlet.InvokerServlet.doPost(InvokerServlet.java:224)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[java] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFil
ter(ApplicationFilterChain.java:252)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
[java] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
[java] at org.apache.catalina.core.ApplicationFilterChain.internalDoFil
ter(ApplicationFilterChain.java:202)
[java] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
[java] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
[java] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
[java] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke
(SecurityAssociationValve.java:175)
[java] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Au
thenticatorBase.java:432)
[java] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
[java] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
[java] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
[java] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
[java] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
[java] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
[java] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
[java] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionH
andler.processConnection(Http11BaseProtocol.java:664)
[java] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
[java] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
[java] at java.lang.Thread.run(Thread.java:595)
[java] Java Result: 1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic