required a bean of type 'org.hibernate.SessionFactory' that could not be found.
2018-04-03 13:55
609 查看
最近做了个项目,由于之前一直是普通项目,但后来想继承一些技术在上面,首先是要把它转为maven项目
在原项目上直接转,结果出现了一些莫名其妙的问题,最后也运行不了,只好重建一个新的maven项目(重头开始),然后将源码复制过去即可
但是复制过去之后,出现了一个问题
参考https://blog.csdn.net/u014137486/article/details/54381341这篇文章,了解了classpath的真实地址
将此文件夹考过去,就找得到application.xml了
问题解决
在原项目上直接转,结果出现了一些莫名其妙的问题,最后也运行不了,只好重建一个新的maven项目(重头开始),然后将源码复制过去即可
但是复制过去之后,出现了一个问题
required a bean of type 'org.hibernate.SessionFactory' that could not be found.
找不到SessionFactory这个bean,其实是找不到application.xml这个文件,原因在于,我不了解maven的项目结构和web.xml中的classpath到底指的是什么,就忘记了将classes目录拷过来,参考https://blog.csdn.net/u014137486/article/details/54381341这篇文章,了解了classpath的真实地址
将此文件夹考过去,就找得到application.xml了
问题解决
相关文章推荐
- required a bean of type 'org.hibernate.SessionFactory' that could not be found.
- springcloud-3:required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found.
- mybatis Field xxxMapper in xxxx required a bean of type 'XXXMapper' that could not be found.
- Field XXX in XXXX required a bean of type XXXX that could not be found.
- 解决 A component required a bean of 'XXX.RoleService' that could not be found.
- 记录A component required a bean named 'studentService' that could not be found.
- org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named "" must be of type [org.apache.struts.action.Action
- org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'faceAction' must be of
- Found conflicts between different versions of the same dependent assembly that could not be resolved
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.oskyhang.gbd.service.UserService] found for dependency: expected at least 1 bean which qualifies as aut
- javax.validation.UnexpectedTypeException: No validator could be found for constraint 'org.hibernate.validator.constraints.Length' validating type
- java.lang.ClassNotFoundException: org.hibernate.engine.SessionFactoryImplementor
- 关于Failed to convert property value of type [org.quartz.impl.StdScheduler] to required type [org.springframework.scheduling.quartz.SchedulerFactoryBean
- Mybatis异常:java.lang.ClassNotFoundException: org.mybatis.spring.SqlSessionFactoryBean
- log4j:WARN No appenders could be found for logger (org.hibernate.type.BasicTypeRegistry). log4j:WARN
- spring hiberante 集成出现异常 java.lang.ClassNotFoundException: org.hibernate.engine.SessionFactoryImplementor
- spring事务配置Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.SessionFactoryImplemento
- Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'dao' is exp
- Mybatis异常:java.lang.ClassNotFoundException: org.mybatis.spring.SqlSessionFactoryBean
- org.springframework.beans.factory.BeanNotOfRequiredTypeException must be of type