I am creating a web application (MVC) using Spring, Hibernate, and I receive the error when I run it on server (Glassfish v4.1 is used). Below is the error:
cannot Deploy project1 deploy is failing=Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'dataSource1' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dataSource1' is defined. Please see server.log for more details.
How can I fix the this error? Thanks in advance.
This is 'applicationContext.xml' file:
http://i.stack.imgur.com/ZuzHR.jpg
This is 'persistence.xml' file:
No bean named 'dataSource1' is defined.
You are referencing a datasource that doesn't exist. – M. DeinumdataSource
. – M. Deinum