从 Struts 2.3.37 迁移到 Struts 2.5.33

问题描述 投票:0回答:1

您好,我想从 struts 2.3.37 迁移到 struts 2.5.33 。遵循此页面(https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration)并更新了我的项目。这是我目前正在使用的与struts相关的jar。任何人都可以建议应该做什么来解决这个问题。当我尝试加载链接时出现 404 错误页面

c.o.xwork2.ognl.OgnlValueStack - Could not find property [struts.actionMapping]!
ognl.NoSuchPropertyException: com.opensymphony.xwork2.util.CompoundRoot.struts
    at com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:158)
    at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2422)
    at ognl.ASTProperty.getValueBody(ASTProperty.java:114)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.ASTChain.getValueBody(ASTChain.java:141)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.Ognl.getValue(Ognl.java:470)
    at ognl.Ognl.getValue(Ognl.java:434)
    at com.opensymphony.xwork2.ognl.OgnlUtil$2.execute(OgnlUtil.java:484)
    at com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:523)
    at com.opensymphony.xwork2.ognl.OgnlUtil.getValue(OgnlUtil.java:482)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.getValueUsingOgnl(OgnlValueStack.java:296)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.tryFindValue(OgnlValueStack.java:279)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.tryFindValueWhenExpressionIsNotNull(OgnlValueStack.java:261)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:241)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:303)
    at org.apache.struts2.dispatcher.StrutsRequestWrapper.getAttribute(StrutsRequestWrapper.java:94)
    at org.apache.struts2.dispatcher.PrepareOperations.findActionMapping(PrepareOperations.java:181)
    at org.apache.struts2.dispatcher.PrepareOperations.findActionMapping(PrepareOperations.java:165)
    at org.apache.struts2.dispatcher.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:90)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at com.comviva.mfs.security.XSSFilter.doFilter(XSSFilter.java:100)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at com.comviva.mfs.security.RefererFilter.doFilter(RefererFilter.java:104)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
10:54:51.118 [http-nio-8082-exec-3] WARN  c.o.xwork2.ognl.OgnlValueStack - Could not find property [struts.valueStack]!
ognl.NoSuchPropertyException: com.opensymphony.xwork2.util.CompoundRoot.struts
    at com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.getProperty(CompoundRootAccessor.java:158)
    at ognl.OgnlRuntime.getProperty(OgnlRuntime.java:2422)
    at ognl.ASTProperty.getValueBody(ASTProperty.java:114)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.ASTChain.getValueBody(ASTChain.java:141)
    at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
    at ognl.SimpleNode.getValue(SimpleNode.java:258)
    at ognl.Ognl.getValue(Ognl.java:470)
    at ognl.Ognl.getValue(Ognl.java:434)
    at com.opensymphony.xwork2.ognl.OgnlUtil$2.execute(OgnlUtil.java:484)
    at com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:523)
    at com.opensymphony.xwork2.ognl.OgnlUtil.getValue(OgnlUtil.java:482)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.getValueUsingOgnl(OgnlValueStack.java:296)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.tryFindValue(OgnlValueStack.java:279)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.tryFindValueWhenExpressionIsNotNull(OgnlValueStack.java:261)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:241)
    at com.opensymphony.xwork2.ognl.OgnlValueStack.findValue(OgnlValueStack.java:303)
    at org.apache.struts2.dispatcher.StrutsRequestWrapper.getAttribute(StrutsRequestWrapper.java:94)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:545)
    at org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
    at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.struts2.dispatcher.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:92)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at com.comviva.mfs.security.XSSFilter.doFilter(XSSFilter.java:100)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at com.comviva.mfs.security.RefererFilter.doFilter(RefererFilter.java:104)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
10:54:52.223 [http-nio-8082-exec-3] WARN  o.a.struts2.dispatcher.Dispatcher - Could not find action or result: /CoreWeb/reconciliation/reconciliation_loadReconciliationBalance.action?ORIGIN=LUIGI&language=en&token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Imp3cy1rZXktcHVibGljLTEifQ.eyJzZXJ2aWNlUmVxdWVzdElkIjoiNTdmOTcxM2UtOThiNy00ZWE2LTk2OGEtMDQzMzVjNmM0YzVmIiwidXNlcl9uYW1lIjoiNTdmOTcxM2UtOThiNy00ZWE2LTk2OGEtMDQzMzVjNmM0YzVmIiwiYXV0aG9yaXphdGlvblByb2ZpbGVDb2RlIjoiTmV0YWRtaW5EZWZhdWx0IiwiaWRlbnRpZmllclZhbHVlIjoiU1lTQURNNzc3NzQ1NzgxOCIsImlkZW50aWZpZXJUeXBlIjoiTE9HSU5JRCIsImNhdGVnb3J5Q29kZSI6Ik5XQURNIiwidXNlcklkIjoiVVMuNTkxMjczNjc0MTMwMjUzIiwiZGV2aWNlSWQiOm51bGwsImF1dGhvcml0aWVzIjpbIlJPTEVfVVNFUiJdLCJjbGllbnRfaWQiOiJDb3JlV2ViIiwic2NvcGUiOlsiR0VUX1VTRVJfQU5EX0FDQ09VTlRfREVUQUlMUyIsIlNFTEZTRVRBVVRIRkFDVE9SIiwiRkVUQ0hfVVNFUl9RVUVTVElPTiIsIlRYTkNPUlJFQ1QiLCJBVE1DQVNIT1VUIiwiQVRNQ0FTSE9VVF9WNCIsIkFETVRYTlJFRklEIl0sIm5hbWUiOiJOZXR3b3JrIE5XQURNIEFkbWluIiwiYmVhcmVyQ29kZSI6IldFQiIsImV4cCI6MTcxMzUzMTk0NywianRpIjoiNTM1ZmRlMGItZTI2Yy00NTFlLThiZWQtNTIzOGI5YWRiNTEzIn0.f5qvkNC1naH6Wdi1DAsZGnNuvCkUM2UOWhYvHTrm5S9tfp5g_hSZqNG0sexNOAoq7vhCkD2RLNr3lmXsW6nrATM3ZqlWSLIO1XOlANwA4lRfaV9PbVqTcbbDRrGXRI0_kCWCdBtO7LLoEtksYJpUIb_Y2Ip00O60oCn9Fcu-zjk7n5zr5AxiR7DVmMkovfM9_hnCaT_B5CgbdPnwL4V-W7h8EN1cvxSkjCklJhBcdYTupJZiLu57MCIyXbkw79Itdj6PHYuCYoG98TgoZB8TEjL0L12fLFfj710ug08w2a3wfdYI_2mUk71c57Dq8Om-3myb9FEJxSmEML50sM5GrA
com.opensymphony.xwork2.config.ConfigurationException: There is no Action mapped for namespace [/reconciliation] and action name [reconciliation_loadReconciliationBalance] associated with context path [/CoreWeb].
    at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:195)
    at org.apache.struts2.factory.StrutsActionProxy.prepare(StrutsActionProxy.java:57)
    at org.apache.struts2.factory.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:32)
    at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:60)
    at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
    at org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
    at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.struts2.dispatcher.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:92)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at com.comviva.mfs.security.XSSFilter.doFilter(XSSFilter.java:100)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at com.comviva.mfs.security.RefererFilter.doFilter(RefererFilter.java:104)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
Apr 19, 2024 10:55:21 AM org.apache.catalina.session.StandardSession tellNew
SEVERE: Session event listener threw exception
java.lang.NullPointerException
    at org.apache.struts2.ServletActionContext.getServletContext(ServletActionContext.java:133)
    at com.btsl.common.util.SessionCounter.sessionCreated(SessionCounter.java:41)
    at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:387)
    at org.apache.catalina.session.StandardSession.setId(StandardSession.java:361)
    at org.apache.catalina.session.StandardSession.setId(StandardSession.java:342)
    at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:719)
    at org.apache.catalina.connector.Request.doGetSession(Request.java:3096)
    at org.apache.catalina.connector.Request.getSession(Request.java:2494)
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:908)
    at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:244)
    at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:583)
    at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:528)
    at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:133)
    at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:108)
    at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:59)
    at org.apache.jsp.defaultErrorPage_jsp._jspService(defaultErrorPage_jsp.java:98)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:467)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:378)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:326)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:710)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
    at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:398)
    at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:257)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:179)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:687)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
struts2 migration struts ognl
1个回答
0
投票

不同版本的 Struts 存在混乱的依赖关系。其中

xwork-core.jar
。该库已集成到
struts2-core.jar
中并从依赖项中删除。

您应该执行相同的操作,只需将其从依赖项中删除,看看它是否可以解决您的问题。

如果您需要更多详细信息,您可以阅读此答案:XWork 和 XWork 核心库冲突

当您升级Struts2版本时,您必须将应用程序所需的库更新到目标版本。每个 Struts2 发行版在 lib 文件夹中都提供了与该发行版版本兼容的相应库集。如果您使用 Maven 来解析和获取依赖项,您应该考虑该工件

struts2-core

© www.soinside.com 2019 - 2024. All rights reserved.