Meaningless Drivel is fun!*
The moose likes JBoss/WildFly and the fly likes i am using Hibernate with Seam and getting errors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "i am using Hibernate with Seam and getting errors" Watch "i am using Hibernate with Seam and getting errors" New topic
Author

i am using Hibernate with Seam and getting errors

naresh dharami vatsal
Greenhorn

Joined: Aug 19, 2007
Posts: 2
i have taken hibernate example from jboss-seam-2.1.0.SP1\examples\hibernate.
But my application deployment failed.
i got error

ERROR [[/Hotelbooking]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component: hibernateSessionFactory
at org.jboss.seam.Component.newInstance(Component.java:2096)


Can anyone guide me?

Regards
Naresh Vatsal
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9963
    
163

Please post the console logs and the entire exception stacktrace and the version of JBoss that you are using.


[My Blog] [JavaRanch Journal]
Alexander Poleschuk
Greenhorn

Joined: Dec 17, 2008
Posts: 3
Hi everyone!

I have the same problem. I'm using jboss-seam-2.1.0.SP1 with Tomcat 6.0
I'm playing around with examples that come with jboss-seam. In Hibernate configuration, I switched from JDBCTransactionFactory to JTATransactionFactory and added the following property:
<property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>

As a result, I get an exception:

SEVERE: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component: hibernateSessionFactory
at org.jboss.seam.Component.newInstance(Component.java:2096)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:112)
at org.jboss.seam.init.Initialization.init(Initialization.java:727)
at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
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.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
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:325)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.jboss.seam.persistence.HibernateSessionFactory.createSessionFactory(HibernateSessionFactory.java:165)
at org.jboss.seam.persistence.HibernateSessionFactory.startup(HibernateSessionFactory.java:79)
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.jboss.seam.util.Reflections.invoke(Reflections.java:22)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
at org.jboss.seam.Component.callComponentMethod(Component.java:2201)
at org.jboss.seam.Component.callCreateMethod(Component.java:2124)
at org.jboss.seam.Component.newInstance(Component.java:2084)
... 29 more
Caused by: javax.naming.NameNotFoundException: Name TransactionManager is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)
... 43 more

As I understand, I should configure JNDI context. How can it be done? Please help.

Thanks a lot
 
 
subject: i am using Hibernate with Seam and getting errors
 
Similar Threads
JBoss and Seam
problem in displaying appropriate error message
is Seam just another framework?
What's wrong(Hibernate.cfg.xml + Components.xml + Context.xml) on tomcat
Calling JBoss Seam action methods from Servlet