Struts 2.5.34 到 Struts 6.3 迁移
我们的应用程序当前采用 struts 2.5.3 版本。 由于 Apache 为此宣布 EOL,我们将使用官方迁移指南 https://cwiki.apache.org/confluence/display/WW/Struts+2.5+to+ 升级到 Struts 6(确切地说是 6.3) 6.0.0+迁移.
这样做,我们面临以下问题。有没有人遇到同样的问题并且可以提供帮助?
附加说明:我相信新 servlet 无法识别其 struts 标签。意思是说,每当我们在 .jsp 中使用 struts 标签时,就会抛出以下异常。如果我们使用普通形式,jsp 渲染得很好。
[23:05:57,539] DEBUG (com.opensymphony.xwork2.security.DefaultAcceptedPatternsChecker:104) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Sets accepted patterns to [[\w+((\.\w+)|(\[\d+])|(\(\d+\))|(\['(\w-?|[\u4e00-\u9fa5]-?)+'])|(\('(\w-?|[\u4e00-\u9fa5]-?)+'\)))*]], note this impacts the safety of your application!
[23:05:57,540] DEBUG (org.apache.struts2.url.StrutsUrlEncoder:38) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Using default encoding: UTF-8
[23:05:57,540] DEBUG (org.apache.struts2.dispatcher.DefaultStaticContentLoader:98) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - "struts.ui.staticContentPath" has been set to "/static"
[23:05:57,545] DEBUG (org.apache.struts2.url.StrutsUrlDecoder:39) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Using default encoding: UTF-8
[23:05:57,548] DEBUG (com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler:98) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Entering nullPropertyValue [target={}, property=theme]
[23:05:57,550] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:406) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Retrieving convert for class [class com.opensymphony.xwork2.util.CompoundRoot] and property [null]
[23:05:57,550] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:286) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - field-level type converter for property [null] = none found
[23:05:57,551] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:309) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - global-level type converter for property [null] = none found
[23:05:57,551] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:326) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@7f6670f8]
[23:05:57,551] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:309) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - global-level type converter for property [null] = none found
[23:05:57,551] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:326) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@7f6670f8]
[23:05:57,553] DEBUG (com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler:98) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Entering nullPropertyValue [target={}, property=templateDir]
[23:05:57,553] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:406) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Retrieving convert for class [class com.opensymphony.xwork2.util.CompoundRoot] and property [null]
[23:05:57,553] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:286) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - field-level type converter for property [null] = none found
[23:05:57,553] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:309) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - global-level type converter for property [null] = none found
[23:05:57,554] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:326) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@7f6670f8]
[23:05:57,554] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:309) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - global-level type converter for property [null] = none found
[23:05:57,554] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:326) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@7f6670f8]
[23:05:57,556] ERROR (org.apache.struts2.components.ClosingUIBean:57) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Could not open template
java.lang.NullPointerException: null
at org.apache.struts2.components.Component.getNamespace(Component.java:448) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at org.apache.struts2.components.Component.determineNamespace(Component.java:433) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at org.apache.struts2.components.ServletUrlRenderer.renderFormUrl(ServletUrlRenderer.java:140) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at org.apache.struts2.components.Form.populateComponentHtmlId(Form.java:232) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:808) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at org.apache.struts2.components.ClosingUIBean.start(ClosingUIBean.java:53) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at org.apache.struts2.views.jsp.ComponentTagSupport.doStartTag(ComponentTagSupport.java:54) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at jsp_servlet._portal._jsp._login.__login._jspService(__login.java:300) ~[il1xnc/:?]
at weblogic.servlet.jsp.JspBase.service(JspBase.java:35) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.handleRequest(StrutsPrepareAndExecuteFilter.java:154) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.tryHandleRequest(StrutsPrepareAndExecuteFilter.java:140) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:128) ~[struts2-core-6.3.0.2.jar:6.3.0.2]
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326) ~[com.oracle.weblogic.security.subject.jar:12.2.1.3]
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197) ~[com.oracle.weblogic.security.subject.jar:12.2.1.3]
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272) ~[com.oracle.weblogic.servlet.jar:12.2.1.3]
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352) ~[com.bea.core.utils.full.jar:12.2.1.3]
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337) ~[com.bea.core.utils.full.jar:12.2.1.3]
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57) ~[com.oracle.weblogic.work.jar:12.2.1.3]
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41) ~[com.bea.core.weblogic.workmanager.jar:12.2.1.3]
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644) ~[com.bea.core.weblogic.workmanager.jar:12.2.1.3]
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415) ~[com.bea.core.weblogic.workmanager.jar:12.2.1.3]
at weblogic.work.ExecuteThread.run(ExecuteThread.java:355) ~[com.bea.core.weblogic.workmanager.jar:12.2.1.3]
[23:05:57,568] DEBUG (org.apache.struts2.dispatcher.DefaultStaticContentLoader:98) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - "struts.ui.staticContentPath" has been set to "/static"
[23:05:57,570] DEBUG (com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler:98) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Entering nullPropertyValue [target={}, property=theme]
[23:05:57,571] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:406) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Retrieving convert for class [class com.opensymphony.xwork2.util.CompoundRoot] and property [null]
[23:05:57,571] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:286) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - field-level type converter for property [null] = none found
[23:05:57,571] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:309) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - global-level type converter for property [null] = none found
[23:05:57,571] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:326) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@7f6670f8]
[23:05:57,572] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:309) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - global-level type converter for property [null] = none found
[23:05:57,572] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:326) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@7f6670f8]
[23:05:57,572] DEBUG (com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler:98) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Entering nullPropertyValue [target={}, property=templateDir]
[23:05:57,572] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:406) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Retrieving convert for class [class com.opensymphony.xwork2.util.CompoundRoot] and property [null]
[23:05:57,572] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:286) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - field-level type converter for property [null] = none found
[23:05:57,573] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:309) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - global-level type converter for property [null] = none found
[23:05:57,573] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:326) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@7f6670f8]
[23:05:57,573] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:309) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - global-level type converter for property [null] = none found
[23:05:57,573] DEBUG (com.opensymphony.xwork2.conversion.impl.XWorkConverter:326) [[ACTIVE] ExecuteThread: '24' for queue: 'weblogic.kernel.Default (self-tuning)'] - Falling back to default type converter [com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter@7f6670f8]
<4 Mar, 2024 11:05:57,580 PM SGT> <Error> <HTTP> <BEA-101020> <[ServletContext@1397832529[app:osci module:/osc path:null spec-version:3.1]] Servlet failed with an Exception
java.lang.NullPointerException
at org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:816)
at org.apache.struts2.components.UIBean.end(UIBean.java:550)
at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:40)
at jsp_servlet._portal._jsp._login.__login._jsp__tag2(__login.java:435)
at jsp_servlet._portal._jsp._login.__login._jspService(__login.java:357)
Truncated. see log file for complete stacktrace
>
P.S 正在使用以下库