Struts2,Hibernate,Spring整合时的错误

 1 type Exception report
 2
 3 message
 4
 5 description The server encountered an internal error that prevented it from fulfilling this request.
 6
 7 exception
 8
 9 java.lang.NullPointerException
10     com.bjsxt.registration.action.UserAction.execute(UserAction.java:43)
11     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14     java.lang.reflect.Method.invoke(Method.java:497)
15     com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
16     com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
17     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
18     org.apache.struts2.interceptor.DeprecationInterceptor.intercept(DeprecationInterceptor.java:41)
19     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
20     org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256)
21     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
22     com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:167)
23     com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
24     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
25     com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
26     org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
27     com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
28     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
29     com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138)
30     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
31     com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
32     com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
33     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
34     com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:249)
35     com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
36     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
37     com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
38     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
39     org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)
40     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
41     org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
42     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
43     org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)
44     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
45     com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
46     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
47     com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
48     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
49     com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
50     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
51     com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
52     com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
53     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
54     com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
55     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
56     org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
57     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
58     com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
59     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
60     com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
61     com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
62     org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
63     org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:562)
64     org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
65     org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
66 note The full stack trace of the root cause is available in the Apache Tomcat/8.0.20 logs.

原因:缺少struts2-spring-plugin-2.3.16.jar的jar包

时间: 2024-11-06 22:35:40

Struts2,Hibernate,Spring整合时的错误的相关文章

struts2与spring整合时需要注意的点

首先我们需要明白spring整合struts2中的什么东西,spring中的核心就是IOC和AOP,IOC是对象的容器,AOP是处理动态代理的;比如spring与hibernate整合时就要用到aop,具体就是把事务的开启与关闭交于spring中的aop处理.一句话,spring就是整合struts2的对象. 先前struts.xml配置文件中action标签中的class属性的值是"包名+类名",这样配置就可以让struts2自己生成对象,但这样不符合模式设计六大原则,为了解决这个问

Struts2+Hibernate+Spring 整合示例[转]

原文 http://blog.csdn.net/tkd03072010/article/details/7468769 Spring整合Struts2.Hibernate原理概述: 从用户角度来看,用户发出HTTP请求,当MVC框架的控制器组件拦截到用户请求时,将调用系统的业务逻辑组件,业务逻辑组件则调用系统的DAO组件,而DAO组件则依赖于SessionFactory和DataSource等底层组件实现数据库访问. 从系统实现角度看,Ioc容器先创建SessionFactory和DataSou

struts2与spring集成时,关于class属性及成员bean自动注入的问题

正常来说按照Spring官方配置,在struts2与spring整合时,struts配置文件中class属性指向spring配置的bean id,但是在class指向类路径时,依然能注入service. public class LoginAction extends ActionSupport{ private LoginService loginService; public void setLoginService(LoginService loginService) { System.o

Spring+Struts2+Hibernate的整合

这篇主要采用Maven搭建Spring+Struts2+Hibernate的整合项目,复习一下SSH框架,虽然spring提供自己的MVC框架, 但是Spring也提供和其他框架的无缝整合,采用组件形式对个框架进行管理,项目实例是按照真实企业里面的开发搭建,也是web的最后一片了.数据库使 用mysql,连接池使用的是Druid数据源(这些都无关紧要,可以随时的替换),下面就将详细的介绍一下Maven搭建 Spring,Struts2,和hibernation的步奏. 1.数据库设计 数据库库表

struts2+hibernate+spring简单整合且java.sql.SQLException: No suitable driver 问题解决

最近上j2ee的课,老师要求整合struts2+hibernate+spring,我自己其实早早地有准备弄的,现在都第9个项目了,无奈自己的思路和头绪把自己带坑了,当然也是经验问题,其实只是用myeclipse进行整合的,本来也没那么多问题,看视频吧居然好多要手打,我不喜欢看不下去放弃了,教程把就是一堆坑,最最让人不解的是明明有一个冲突是需要解决的,但我看到的教程居然都没有提到,还有一个错误居然好多人都好像自动忽略一样,能解决我问题的都是要漫长的找,所以我一定一定要把这个过程记录下来,给第一次搞

Struts2+Hibernate+Spring(SSH)三大框架整合jar包

Struts2 + Spring3 + Hibernate3 框架整合 1. 每个框架使用 (开发环境搭建 )* 表现层框架 struts2 1) jar包导入: apps/struts2_blank.war 包含struts2 开发最基本的jar包 struts2-convention-plugin-2.3.7.jar用于struts使用注解 (如果不使用注解开发,无需导入) struts2-json-plugin-2.3.7.jar 用于struts2整合Ajax struts2-sprin

maven搭建Struts2+Hibernate+Spring

注:本文用的是PostgreSQL,所以引的包和数据库配置也是PostgreSQL的,可以根据自己需要修改即可 1.建立maven工程 (1)File->New->Maven Project (2)点击Next (3) 选中默认的maven-archetype-quickstart,点击Next (4)输入Group Id和Artifact Id,点击Finish 2.转换为web项目 右键项目->Properties->Project Facets,选中Dynamic Web M

工作笔记3.手把手教你搭建SSH(struts2+hibernate+spring)环境

上文中我们介绍<工作笔记2.软件开发常用工具> 从今天开始本文将教大家如何进行开发?本文以搭建SSH(struts2+hibernate+spring)框架为例,共分为3步: 1)3个独立配置:struts2. Hibernate. Spring 2)2个整合:整合Sring和struts2. 整合Spring和Hibernate 3)资源分类 开发包.软件.框架源码,已经共享到百度网盘:http://pan.baidu.com/s/1o6FkbA6 一.3个独立配置 1.Struts2: 1

Struts2+Hibernate+Spring框架实现增删改查

一.添加3个框架的JAR包,完成后写配置文件: 1.web配置文件: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation=&quo