2013-10-13 14:29:06 org.apache.struts2.dispatcher.Dispatcher error
严重: Dispatcher initialization failed
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

Caused by: java.lang.reflect.InvocationTargetExceptionCaused by: java.lang.ClassNotFoundException: javassist.ClassPool

2013-10-13 14:29:06 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector
File: ContainerImpl.java
Method: injectCaused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

Caused by: java.lang.reflect.InvocationTargetException

Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!

Caused by: java.lang.ClassNotFoundException: javassist.ClassPool

2013-10-13 14:29:06 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2013-10-13 14:29:06 org.apache.catalina.core.StandardContext start
严重: Context [/struts2] startup failed due to previous errors-------------------------------------------------------------------------strust.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd"><struts></struts>------------------------------------------------------------------------------------web.xml<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

解决方案 »

  1.   

    加上Javassist.jar这个包试一下。
      

  2.   


    我跟视频做的。  视频都没错啊。
    我怀疑是缺包的原因。你把web-inf/lib/下的包贴出来看一下。
      

  3.   

    来自百度:
    “你使用struts-2.2.1吗?如果是,需要引入javassist-3.7.ga.jar,而这个在struts-2.2.1\lib下是没有的,需要在struts-2.2.1\apps\struts2-blank-2.2.1.war下的lib中找。”
    就是这样,灰常标准的解答,喵~