在集成spring和mybatis框架时出现错误,求解,本人刚刚接触mybatis框架,以前都是S2SH.求帮忙,谢谢了。
2013-11-1922:47:46org.springframework.context.support.AbstractApplicationContextprepa...
2013-11-19 22:47:46 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@3bb2b8: startup date [Tue Nov 19 22:47:46 CST 2013]; root of context hierarchy
2013-11-19 22:47:46 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [applicationContext.xml]
2013-11-19 22:47:46 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1c05ffd: defining beans [dataSource,trancationManager,StudentMapper]; root of factory hierarchy
2013-11-19 22:47:46 org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
信息: Loaded JDBC driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
2013-11-19 22:47:46 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1c05ffd: defining beans [dataSource,trancationManager,StudentMapper]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'StudentMapper' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sqlSessionFactory' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at 展开
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@3bb2b8: startup date [Tue Nov 19 22:47:46 CST 2013]; root of context hierarchy
2013-11-19 22:47:46 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [applicationContext.xml]
2013-11-19 22:47:46 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1c05ffd: defining beans [dataSource,trancationManager,StudentMapper]; root of factory hierarchy
2013-11-19 22:47:46 org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName
信息: Loaded JDBC driver: com.microsoft.sqlserver.jdbc.SQLServerDriver
2013-11-19 22:47:46 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
信息: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1c05ffd: defining beans [dataSource,trancationManager,StudentMapper]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'StudentMapper' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sqlSessionFactory' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询