This is not a duplicate of Same question but not for a webapp
My persistence.xml
file is located in wepapp/WEB-INF/config/persistence.xml
I use annotations to bring it in, I did it this way because I am using hibernate and JPA 2 at the same time. I am cleaning out hibernateTemplate
but need them to work together for the moment.
@Configuration
@EnableJpaRepositories("request.repositoryJPA")
@ComponentScan("request.domain, classes.applicant")
@PropertySource("classpath:WEB-INF/config/persistence.xml")
@EnableTransactionManagement
public class JpaConfiguration {
Full stack trace:
Caused By: java.io.FileNotFoundException: class path resource [WEB-INF/config/persistence.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
at org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:153)
at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:90)
at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:72)
at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:58)
Truncated. see log file for complete stacktrace