hello all,
I am facing a problem while deploying a spring + hibernate project war on JBoss AS 7.0
Here is stack trace::::::::
13:48:51,551 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/RI]] (MSC service thread 1-1) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListe ner: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-business-context.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingNotFoundException: resource: /com/ri/hbm/TblSysUser.hbm.xml not found
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1420) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 93) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:290 ) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:192) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:567) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895) [spring-context-3.0.6.RELEASE.jar:]
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425) [spring-context-3.0.6.RELEASE.jar:]
at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:282) [spring-web-3.0.6.RELEASE.jar:]
at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:204) [spring-web-3.0.6.RELEASE.jar:]
at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47) [spring-web-3.0.6.RELEASE.jar:]
at org.apache.catalina.core.StandardContext.contextLi stenerStart(StandardContext.java:3368) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:3821) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.jboss.as.web.deployment.WebDeploymentService.s tart(WebDeploymentService.java:70) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartT ask.run(ServiceControllerImpl.java:1765)
at org.jboss.msc.service.ServiceControllerImpl$ClearT CCLTask.run(ServiceControllerImpl.java:2291)
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886) [:1.6.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908) [:1.6.0_25]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_25]
Caused by: org.hibernate.MappingNotFoundException: resource: /com/ri/hbm/TblSysUser.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Config uration.java:610) [hibernate-core-3.3.2.GA.jar:]
at org.hibernate.cfg.Configuration.parseMappingElemen t(Configuration.java:1635) [hibernate-core-3.3.2.GA.jar:]
at org.hibernate.cfg.Configuration.parseSessionFactor y(Configuration.java:1603) [hibernate-core-3.3.2.GA.jar:]
at org.hibernate.cfg.Configuration.doConfigure(Config uration.java:1582)[hibernate-core-3.3.2.GA.jar:]
at org.hibernate.cfg.Configuration.doConfigure(Config uration.java:1556)[hibernate-core-3.3.2.GA.jar:]
at org.hibernate.cfg.Configuration.configure(Configur ation.java:1491) [hibernate-core-3.3.2.GA.jar:]
at org.springframework.orm.hibernate3.LocalSessionFac toryBean.buildSessionFactory(LocalSessionFactoryBe an.java:642) [spring-orm-3.0.6.RELEASE.jar:]
at org.springframework.orm.hibernate3.AbstractSession FactoryBean.afterPropertiesSet(AbstractSessionFact oryBean.java:211) [spring-orm-3.0.6.RELEASE.jar:]

at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1477) [spring-beans-3.0.6.RELEASE.jar:]
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1417) [spring-beans-3.0.6.RELEASE.jar:]
... 20 more

13:48:51,629 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Error listenerStart
13:48:51,629 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-1) Context [/RI] startup failed due to previous errors
13:48:51,692 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/RI]] (MSC service thread 1-1) Closing Spring root WebApplicationContext
13:48:51,692 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/RI]] (MSC service thread 1-1) Shutting down log4j
13:48:51,692 INFO [org.jboss.web] (MSC service thread 1-1) registering web context: /RI
13:48:51,739 INFO [org.jboss.as.server.controller] (DeploymentScanner-threads - 2) Deployed "RI.war"


I have TblSysUser.hbm.xml in my project.
Here in my session factory bean in spring-context.xml:::::::

<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean"
p:dataSource-ref="dataSource" p:configLocation="classpath:hibernate.cfg.xml">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLS erverDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
Plz guide why this exception is coming?