struts2.32升级到struts2.5.12遇到问题,求指教

网上说说少了javassist.jar我加了还是没反应,我也排除了struts-core的javassist图片描述

报错信息:
2017-07-17 15:05:33.688:WARN::failed struts2-prepare: java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector|File: ContainerImpl.java|Method: construct|Line: 427 - com/opensymphony/xwork2/inject/ContainerImpl.java:427:-1
2017-07-17 15:05:33.688:WARN::Failed startup of context org.mortbay.jetty.webapp.WebAppContext@385781{/rrs,G:ZHWLwslrrs-websrcmainwebapp}
java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector|File: ContainerImpl.java|Method: construct|Line: 427 - com/opensymphony/xwork2/inject/ContainerImpl.java:427:-1

at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:512)
at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:75)
at org.apache.struts2.dispatcher.filter.StrutsPrepareFilter.init(StrutsPrepareFilter.java:56)
at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:713)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at 

org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)

at runjettyrun.Bootstrap.main(Bootstrap.java:97)

2017-07-17 15:05:33.702:INFO::Started SelectChannelConnector@0.0.0.0:8080
排除struts带的javassist
pom.xml
<dependency>

    <groupId>org.apache.struts</groupId>
    <artifactId>struts2-core</artifactId>
    <exclusions>
        <exclusion>
            <groupId>com.sun</groupId>
            <artifactId>tools</artifactId>
        </exclusion>
        <exclusion>
            <artifactId>javassist</artifactId>
            <groupId>javassist</groupId>
        </exclusion>
        
    </exclusions>
</dependency>

maven依赖
<dependency>

         <groupId>org.javassist</groupId>
         <artifactId>javassist</artifactId>
         <version>3.15.0-GA</version>
      </dependency>
      
    web.xml代码
    <filter>
    <filter-name>struts2-prepare</filter-name>
    <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareFilter</filter-class>
    <init-param>
        <param-name>config</param-name>
        <param-value>struts-default.xml,struts-plugin.xml,struts/struts.xml</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>struts2-prepare</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
阅读 4.3k
1 个回答
新手上路,请多包涵

你的问题解决了吗?我也遇到一样的问题,还没解决,如果你解决了,能告诉我下,怎么解决的吗??十分感谢

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题