[ERROR] [2017-12-28 14:42:39][org.springframework.web.context.ContextLoader]Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hotelDao' defined in file [C:\apache-tomcat-7.0.52\webapps\4G\WEB-INF\classes\spring-dao.xml]: Cannot resolve reference to bean 'datastore' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'datastore' defined in file [C:\apache-tomcat-7.0.52\webapps\4G\WEB-INF\classes\spring-morphia.xml]: Cannot resolve reference to bean 'morphia' while setting bean property 'morphia'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'morphia' defined in file [C:\apache-tomcat-7.0.52\webapps\4G\WEB-INF\classes\spring-morphia.xml]: Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
名称或ID为:morphia 的bean初始化失败,原因:出现了IncompatibleClassChangeError 异常,而morphia对应的class 可能由于maven依赖包的缘故出现了多个版本导致冲突,检查该class类是否出现在多个jar包中。如果有超过1个jar包文件包含该类,修改maven的依赖配置并重新打包。
[C:\apache-tomcat-7.0.52\webapps\4G\WEB-INF\classes\spring-morphia.xml]: 这个里面的hotelDao 这个东西有错 你仔细检查下
检查一下spring-morphia.xml中的 'datastore'
spring-dao.xml配置有问题
需要给出具体的有问题的部分代码:spring-morphia.xml
hotelDao中的方法(@Param("datastore") String datastore, @Param("morphia") String morphia)有没有@Param("morphia")
这个是配置文件出了问题
BeanCreationException: Error creating bean with name 'hotelDao' defined in file [C:\apache-tomcat-7.0.52\webapps\4G\WEB-INF\classes\spring-dao.xml] 这句话是重点,你看懂它的意思就知道错误在哪啦
hotelDao
这个有问题,如果你是eclipse开发的话,记得把eclipse里面tomcat的配置复制到你本地tomcat的conf里面覆盖本地的.
web.xml 配置 缺少 了