File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Could not locate TransactionManager Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Could not locate TransactionManager" Watch "Could not locate TransactionManager" New topic
Author

Could not locate TransactionManager

harshall patil
Greenhorn

Joined: May 29, 2012
Posts: 2

Hi I am new to the JPA & J2EE. I want to implement JTA transaction for the API test framework. I have done most of the things but here I am
getting the saying: Could not locate TransactionManager:
Let me know if anyone of you need more information.

here are logs:

sessionFactoryJNDIName==>>>java:/hibernate/ApvlSessionFactory
INFO [main] (HbmBinder.java:2385) - Mapping collection: com.bp.apvl.ApvlConfig.detailsParts -> APVL_CFG_DTLS_PART
INFO [main] (HbmBinder.java:2385) - Mapping collection: com.ApvlInstance.objDetailsParts -> APVL_INSTANCE_OBJ_DTLS_PART
INFO [main] (DriverManagerConnectionProvider.java:41) - Using Hibernate built-in connection pool (not for production use!)
INFO [main] (DriverManagerConnectionProvider.java:42) - Hibernate connection pool size: 20
INFO [main] (DriverManagerConnectionProvider.java:45) - autocommit mode: false
INFO [main] (DriverManagerConnectionProvider.java:80) - using driver: oracle.jdbc.driver.OracleDriver at URL: jdbcracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ac4-devdb-001-v.ysm.ac4.com) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=XXX)))
INFO [main] (DriverManagerConnectionProvider.java:86) - connection properties: {user=IDM_USER, password=****, schema=PM}
INFO [main] (SettingsFactory.java:89) - RDBMS: Oracle, version: Oracle Database 11g Release 11.1.0.0.0 - Production
INFO [main] (SettingsFactory.java:90) - JDBC driver: Oracle JDBC driver, version: 10.2.0.4.0
INFO [main] (Dialect.java:152) - Using dialect: org.hibernate.dialect.OracleDialect
INFO [main] (TransactionFactoryFactory.java:34) - Transaction strategy: org.hibernate.transaction.JTATransactionFactory
INFO [main] (NamingHelper.java:26) - JNDI InitialContext properties:{}
INFO [main] (TransactionManagerLookupFactory.java:38) - instantiating TransactionManagerLookup: com.apex.backend.idmbe.accountservice.DynamicTransactionManagerLookup
INFO [main] (TransactionManagerLookupFactory.java:42) - instantiated TransactionManagerLookup
INFO [main] (TransactionManagerLookupFactory.java:38) - instantiating TransactionManagerLookup: com.apex.backend.idmbe.accountservice.DynamicTransactionManagerLookup
INFO [main] (TransactionManagerLookupFactory.java:42) - instantiated TransactionManagerLookup
INFO [main] (SettingsFactory.java:143) - Automatic flush during beforeCompletion(): disabled
INFO [main] (SettingsFactory.java:147) - Automatic session close at end of transaction: disabled
INFO [main] (SettingsFactory.java:154) - JDBC batch size: 15
INFO [main] (SettingsFactory.java:157) - JDBC batch updates for versioned data: disabled
INFO [main] (SettingsFactory.java:162) - Scrollable result sets: enabled
INFO [main] (SettingsFactory.java:170) - JDBC3 getGeneratedKeys(): disabled
INFO [main] (SettingsFactory.java:178) - Connection release mode: auto
INFO [main] (SettingsFactory.java:205) - Default batch fetch size: 1
INFO [main] (SettingsFactory.java:209) - Generate SQL with comments: disabled
INFO [main] (SettingsFactory.java:213) - Order SQL updates by primary key: enabled
INFO [main] (SettingsFactory.java:217) - Order SQL inserts for batching: disabled
INFO [main] (SettingsFactory.java:386) - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO [main] (ASTQueryTranslatorFactory.java:24) - Using ASTQueryTranslatorFactory
INFO [main] (SettingsFactory.java:225) - Query language substitutions: {}
INFO [main] (SettingsFactory.java:230) - JPA-QL strict compliance: disabled
INFO [main] (SettingsFactory.java:235) - Second-level cache: disabled
INFO [main] (SettingsFactory.java:239) - Query cache: disabled
INFO [main] (SettingsFactory.java:254) - Optimize cache for minimal puts: disabled
INFO [main] (SettingsFactory.java:263) - Structured second-level cache entries: disabled
INFO [main] (SettingsFactory.java:283) - Echoing all SQL to stdout
INFO [main] (SettingsFactory.java:290) - Statistics: disabled
INFO [main] (SettingsFactory.java:294) - Deleted entity synthetic identifier rollback: disabled
INFO [main] (SettingsFactory.java:309) - Default entity-mode: pojo
INFO [main] (SettingsFactory.java:313) - Named query checking : enabled
INFO [main] (SessionFactoryImpl.java:161) - building session factory
INFO [main] (CachedSequenceGenerator.java:294) - using apvl as schema
INFO [main] (CachedSequenceGenerator.java:294) - using apvl as schema
INFO [main] (CachedSequenceGenerator.java:294) - using apvl as schema
INFO [main] (CachedSequenceGenerator.java:294) - using apvl as schema
INFO [main] (CachedSequenceGenerator.java:294) - using apvl as schema
INFO [main] (SessionFactoryObjectFactory.java:82) - Not binding factory to JNDI, no JNDI name configured
INFO [main] (NamingHelper.java:26) - JNDI InitialContext properties:{}
org.hibernate.HibernateException: Could not locate TransactionManager
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)
at com.apex.backend.idmbe.accountservice.DynamicTransactionManagerLookup.getTransactionManager(DynamicTransactionManagerLookup.java:46)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:325)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at com.framework.testactionframework.util.AtariHibernateUtil.registerStandaloneSessionFactory(AtariHibernateUtil.java:524)
at com.framework.testactionframework.util.AtariHibernateUtil.registerStandaloneSessionFactory(AtariHibernateUtil.java:470)
at com.framework.testactionframework.util.AtariHibernateUtil.registerStandaloneSessionFactory(AtariHibernateUtil.java:438)
at com.framework.testactionframework.util.AtariManualApplication.start(AtariManualApplication.java:206)
at com.framework.testactionframework.ApexBaseTestAction.oneTimeSetup(ApexBaseTestAction.java:475)
at com.framework.testactionframework.ApexBaseTestAction.initialize(ApexBaseTestAction.java:443)
at com.apex.backend.idmbe.accountservice.SingleSignOnTest.initTestClass(SingleSignOnTest.java:114)
at com.apex.backend.idmbe.accountservice.SingleSignOnTest.setup(SingleSignOnTest.java:103)
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:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:609)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:421)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:158)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:89)
at org.testng.TestRunner.beforeRun(TestRunner.java:510)
[TestRunner] Found 1 applicable methods
at org.testng.TestRunner.run(TestRunner.java:478)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)
... 37 more
com.sm.ads.common.app.ApplicationException: org.hibernate.HibernateException: Could not locate TransactionManager
at com.framework.testactionframework.util.AtariManualApplication.start(AtariManualApplication.java:230)
at com.framework.testactionframework.ApexBaseTestAction.oneTimeSetup(ApexBaseTestAction.java:475)
at com.framework.testactionframework.ApexBaseTestAction.initialize(ApexBaseTestAction.java:443)
at com.apex.backend.idmbe.accountservice.SingleSignOnTest.initTestClass(SingleSignOnTest.java:114)
at com.apex.backend.idmbe.accountservice.SingleSignOnTest.setup(SingleSignOnTest.java:103)
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:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:609)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:421)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:158)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:89)
at org.testng.TestRunner.beforeRun(TestRunner.java:510)
at org.testng.TestRunner.run(TestRunner.java:478)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:327)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:299)
at org.testng.SuiteRunner.run(SuiteRunner.java:204)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:912)
at org.testng.TestNG.runSuitesLocally(TestNG.java:876)
at org.testng.TestNG.run(TestNG.java:784)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
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:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: org.hibernate.HibernateException: Could not locate TransactionManager
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)
at com.apex.backend.idmbe.accountservice.DynamicTransactionManagerLookup.getTransactionManager(DynamicTransactionManagerLookup.java:46)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:325)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at com.framework.testactionframework.util.AtariHibernateUtil.registerStandaloneSessionFactory(AtariHibernateUtil.java:524)
at com.framework.testactionframework.util.AtariHibernateUtil.registerStandaloneSessionFactory(AtariHibernateUtil.java:470)
at com.framework.testactionframework.util.AtariHibernateUtil.registerStandaloneSessionFactory(AtariHibernateUtil.java:438)
at com.framework.testactionframework.util.AtariManualApplication.start
Anurag Verma
Ranch Hand

Joined: Mar 30, 2012
Posts: 124

Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial


Here is the reason...
harshall patil
Greenhorn

Joined: May 29, 2012
Posts: 2
Anurag Verma wrote:
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial


Here is the reason...



Can you tell me more detail about what I need to do here.
I am running test for business API which are hosted on server. So I have to use standalone JTATransactionManager strictly.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Could not locate TransactionManager
 
Similar Threads
Exception in Spring maven app
Running Hibernate in Standalone ?
Help with Stripes and TestNG error
i am using Hibernate with Seam and getting errors