如果配置良好,我想测试我的application-context.xml.所以,这就是我做的:
public static void main( String[] args )
{
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:spring/context/application-context.xml");
applicationContext.getBean("entityManagerFactory");
}
Run Code Online (Sandbox Code Playgroud)
我在entityManagerFactory中遇到了这个问题
我很确定我的依赖项都是兼容的,并且hibernate-entitymanager在我的存储库中可用.
我的错误:
org.springframework.context.support.ClassPathXmlApplicationContext #prepareRefresh
INFOS: Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@3dd6e4a4: startup date [Thu Mar 12 17:02:52 CET 2015]; root of context hierarchy org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFOS: Loading XML bean definitions from class path resource [spring/context/application-context.xml]
org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
INFOS: Loaded JDBC driver: oracle.jdbc.OracleDriver
org.springframework.context.support.ClassPathXmlApplicationContext refresh
AVERTISSEMENT: Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring/context/application-context.xml]: …Run Code Online (Sandbox Code Playgroud)