整合SSH框架报错java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java。。。

博主尝试自己整合SSH(Struts 2.5.17, Spring 4.0.0, Hibernate 4.0.0)框架,但过程中遇到了java.lang.RuntimeException的报错,尽管尝试了搜索解决方案,仍然无法解决。希望社区中的人能提供帮助。" 80431304,1184137,Python编程中的设计模式实战,"['设计模式', 'Python编程', '软件设计', '编程实践']
摘要由CSDN通过智能技术生成

以前使用了SSH框架都是使用网上整理好的,最近几天好奇,突然想自己整理一份SSH框架(struts-2.5.17,spring 4.0.0,hibernate 4.0.0),这样用着也更加的得心应手,事与愿违,还是遇到了不能解决的问题,都已经几天了,百度,Google,都无济于事(扎心一样的痛),求助,希望各路神仙,多多留言啊,万分感谢

引用jar包如下

配置文件web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	id="WebApp_ID" version="3.0">
	<display-name>ssh2</display-name>	
	<context-param>
		<param-name>log4jConfigLocation</param-name>
		<param-value>/WEB-INF/conf/log4j.properties</param-value>
	</context-param>
	<context-param>
		<param-name>log4jRefreshInterval</param-name>
		<param-value>60000</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<!-- <param-value>classpath:application.xml</param-value> -->
		<param-value>/WEB-INF/conf/application.xml</param-value>
	</context-param>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<filter>
		<filter-name>openSessionInViewFilter</filter-name>
		<filter-class>
org.springframework.orm.hibernate4.support.OpenSessionInViewFilter
                </filter-class>
	</filter>
	<filter-mapping>
		<filter-name>openSessionInViewFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>struts2</filter-name>
		<filter-class>
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
                </filter-class>
		<init-param>
			<param-name>config</param-name> -->
			<param-value>
struts-default.xml,struts-plugin.xml,../config/struts.xml
                        </param-value>
		</init-param> 
	</filter>
	<filter-mapping>
		<filter-name>struts2</filter-name>
		<url-pattern>/mgt/*</url-pattern>
	</filter-mapping>
	<filter>
		<filter-name>CharacterEncodingFilter</filter-name>
		<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
                </filter-class>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>
		<init-param>
			<param-name>forceEncoding</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>CharacterEncodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>	
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>default.html</welcome-file>
		<welcome-file>default.htm</welcome-file>
		<welcome-file>default.jsp</welcome-file>
	</welcome-file-list>
</web-app>

Struts.xml配置如下:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
	"-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
	"http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
	<constant name="struts.i18n.encoding" value="UTF-8" />
	<constant name="struts.enable.DynamicMethodInvocation" value="true" />
	<constant name="struts.devMode" value="true" />
	<constant name="struts.objectFactory" value="spring"></constant>
	<constant name="struts.configuration.xml.reload" value="true" />
	<constant name="struts.objectTypeDeterminer" value="notiger" />
	<constant name="struts.enable.SlashesInActionNames" value="true"/>
	<constant name="struts.action.extension" value="do" />
	<package name="default" 
		namespace="/mgt" 
		extends="struts-default,json-default"
		strict-method-invocation="false"
		>
		<action name="uAction" class="userAction">
			<result name="success" type="redirect">/index.jsp</result>
			<result name="login" type="redirect">/login.jsp</result>
		</action>
	</package>
</struts>

报错如下:

2018-09-02 02:43:27,411 ERROR [localhost-startStop-1] dispatcher.Dispatcher (Dispatcher.java:508) - Dispatcher initialization failed
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:284) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:417) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:253) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:52) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:118) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:616) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:613) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:555) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:613) ~[struts2-core-2.5.17.jar:2.5.17]
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(D
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值