Hibernate version:3.2
Mapping documents: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>com.mysql.jdbc.Driver</value> </property> <property name="url"> <value>jdbc:mysql://localhost:3306/st</value> </property> <property name="username"> <value>root</value> </property> <property name="password"> <value>121893</value> </property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref local="dataSource"/> </property> <property name="mappingResources"> <list> <value>com/trading/beans/ST_USER_ACCOUNT.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean> <bean id="userRegistrationService" class="com.trading.service.UserRegistrationServiceImpl"> </bean> </beans>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs: 22:43:38,218 ERROR [ContextLoaderPlugIn] Context initialization failed org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: entity class not found: StUserAccount Caused by: org.hibernate.MappingException: entity class not found: StUserAccount at org.hibernate.mapping.PersistentClass.getMappedCla ss(PersistentClass.java:99) at org.hibernate.tuple.PropertyFactory.getGetter(Prop ertyFactory.java:168) at org.hibernate.tuple.PropertyFactory.buildIdentifie rProperty(PropertyFactory.java:44) at org.hibernate.tuple.entity.EntityMetamodel.<init>( EntityMetamodel.java:123) at org.hibernate.persister.entity.AbstractEntityPersi ster.<init>(AbstractEntityPersister.java:434) at org.hibernate.persister.entity.SingleTableEntityPe rsister.<init>(SingleTableEntityPersister.java:109 ) at org.hibernate.persister.PersisterFactory.createCla ssPersister(PersisterFactory.java:55) at org.hibernate.impl.SessionFactoryImpl.<init>(Sessi onFactoryImpl.java:226) at org.hibernate.cfg.Configuration.buildSessionFactor y(Configuration.java:1294) at org.springframework.orm.hibernate3.LocalSessionFac toryBean.newSessionFactory(LocalSessionFactoryBean .java:805) at org.springframework.orm.hibernate3.LocalSessionFac toryBean.buildSessionFactory(LocalSessionFactoryBe an.java:745) at org.springframework.orm.hibernate3.AbstractSession FactoryBean.afterPropertiesSet(AbstractSessionFact oryBean.java:134) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1198) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1167) at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:427) at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 49) at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:155) at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:246) at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:285) at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:352) at org.springframework.web.struts.ContextLoaderPlugIn .createWebApplicationContext(ContextLoaderPlugIn.j ava:354) at org.springframework.web.struts.ContextLoaderPlugIn .initWebApplicationContext(ContextLoaderPlugIn.jav a:295) at org.springframework.web.struts.ContextLoaderPlugIn .init(ContextLoaderPlugIn.java:225) at org.apache.struts.action.ActionServlet.initModuleP lugIns(ActionServlet.java:871) at org.apache.struts.action.ActionServlet.init(Action Servlet.java:359) at javax.servlet.GenericServlet.init(GenericServlet.j ava:211) at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1105) at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:932) at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:3917) at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4201) at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:524) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.modeler.BaseModelMBean.invoke(B aseModelMBean.java:503) at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDy namicInvoker.java:164) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:659) at org.apache.catalina.core.StandardContext.init(Stan dardContext.java:5116) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.commons.modeler.BaseModelMBean.invoke(B aseModelMBean.java:503) at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDy namicInvoker.java:164) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:659) at org.jboss.web.tomcat.tc5.TomcatDeployer.performDep loyInternal(TomcatDeployer.java:297) at org.jboss.web.tomcat.tc5.TomcatDeployer.performDep loy(TomcatDeployer.java:103) at org.jboss.web.AbstractWebDeployer.start(AbstractWe bDeployer.java:371) at org.jboss.web.WebModule.startModule(WebModule.java :83) at org.jboss.web.WebModule.startService(WebModule.jav a:61) at org.jboss.system.ServiceMBeanSupport.jbossInternal Start(ServiceMBeanSupport.java:289) at org.jboss.system.ServiceMBeanSupport.jbossInternal Lifecycle(ServiceMBeanSupport.java:245) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknow n Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation .java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:659) at org.jboss.system.ServiceController$ServiceProxy.in voke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceCo ntroller.java:417) at sun.reflect.GeneratedMethodAccessor9.invoke(Unknow n Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation .java:94) at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:86) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(Ab stractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanSe rverImpl.java:659) at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyE xt.java:210) at $Proxy30.start(Unknown Source) at org.jboss.web.AbstractWebContainer.start(AbstractW ebContainer.java:466) at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invok e(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation .java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invok e(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.j ava:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterc eptor.invoke(ModelMBeanOperationInterceptor.java:1 42) at org.jboss.mx.interceptor.DynamicInterceptor.invoke (DynamicInterceptor.java:97) at org.jboss.system.InterceptorServiceMBeanSupport.in vokeNext(InterceptorServiceMBeanSupport.java:238) at org.jboss.ws.server.WebServiceDeployer.start(WebSe rviceDeployer.java:117)
Problems with Session and transaction handling?
I'm trying to study struts - spring and hibernate, I'm having a problem whenever i put my <bean id="sessionFactory">.... in my spring.xml, can someone help me on this one?
|