• Post Reply Bookmark Topic Watch Topic
  • New Topic

Running Hibernate in Standalone ?

 
Pankaj Patro
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Everybody,


this exception , when I am running a standalone application


Initial SessionFactory creation failed. org.hibernate.HibernateException: Could not locate TransactionManager
java.lang.ExceptionInInitializerError
at com.tomax.ejb.groups.TestClass.<clinit>(TestClass.java:28)
Caused by: org.hibernate.HibernateException: Could not locate TransactionManager
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:301)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at com.tomax.ejb.groups.TestClass.<clinit>(TestClass.java:24)
Caused by: javax.naming.NamingException: Failed to find j2ee.clientName in jndi env
at org.jboss.naming.client.java.javaURLContextFactory.getObjectInstance(javaURLContextFactory.java:66)
at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:584)
at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:533)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:279)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)
... 3 more
Exception in thread "main"

any help....

Thanks,
 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
show your hibernate.cfg.xml

or else if you are using hibernate.properties

show me that

from the console you can understand that session factory is not

created so their may be some problem
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!