2016-02-25 21 views
0

我新的春天,我正在做的日食月亮同样的例子在MyEclipse的工作弹簧注释的例子,但在Eclipse中没有工作春天注释例如服务器加载时间就显示错误

收到此错误任何一个可以帮助我

org.springframework.beans.factory.BeanCreationException:创建名为'studentController'的bean时出错:注入自动装配依赖失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装入字段:private com.vcs.service.StudentService com.vcs.controller.StudentController.studentService;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名为'studentServiceImpl'的bean时出错:注入自动装配依赖失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装入字段:private com.vcs.dao.StudentDao com.vcs.service.StudentServiceImpl.studentDao;嵌套异常是org.springframework.beans.factory.BeanCreationException:创建名为'studentdaoImpl'的bean时出错:注入自动装配依赖失败;嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装入字段:private org.hibernate.SessionFactory com.vcs.dao.StudentdaoImpl.sessionFactory;嵌套异常是org.springframework.beans.factory.BeanCreationException:在ServletContext资源[/WEB-INF/DispatcherServlet-servlet.xml]中定义名称为'sessionFactory'的Bean时创建错误:调用init方法失败;嵌套的例外是java.lang.NoClassDefFoundError:在org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)

+0

如果你仔细阅读错误,你会看到你错过了一个包含类'组织/休眠罐子/上下文/ CurrentSessionContext' – Augusto

回答

0

纵观过去错误的Java组织/休眠/上下文/ CurrentSessionContext 。 lang.NoClassDefFoundError'看起来好像你缺少一个包含CurrentSessionContext的hibernate依赖(hibernate-core)。

0

您正在获取org.hibernate.context.CurrentSessionContext的NoClassDefFoundError异常。

我的猜测是,在你的eclipse设置下,所需的依赖关系不在你的类路径中。

检查您的eclipse构建的war文件夹内的lib文件夹。我假设它是来自WEB-INF存在的WAR存档。

可我也建议你格式化你的代码的代码块为了便于阅读