升级到 struts 2.5.17 时出现运行时异常
Runtime exception while upgrading to struts 2.5.17
我正在尝试将 struts 从版本 2.2.1.1 升级到 2.5.17。但是在将其升级到 2.5.17 并升级了更多依赖项之后,我遇到了 运行 时间异常?我还升级了 jar,例如 jquery plugin、tiles、ognl、dojo 等。
我正在尝试将 struts 从版本 2.2.1.1 升级到 2.5.17。但是在将其升级到 2.5.17 并升级了更多依赖项之后,我遇到了 运行 时间异常?我还升级了 jar,例如 jquery plugin、tiles、ognl、dojo 等。
谁能推荐一下。
发生异常:
java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [LoginAction]
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:97)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:376)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:272)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:95)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:223)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)
com.aniket.web.struts.interceptors.CDMVI18nInterceptor.intercept(CDMVI18nInterceptor.java:43)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
com.aniket.web.filter.EncodingFilter.doFilter(EncodingFilter.java:41)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
java.lang.ClassNotFoundException: LoginAction
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)
weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:104)
weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:89)
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:53)
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:179)
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:95)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:376)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:272)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:95)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:223)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)
com.aniket.web.struts.interceptors.CDMVI18nInterceptor.intercept(CDMVI18nInterceptor.java:43)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
com.aniket.web.filter.EncodingFilter.doFilter(EncodingFilter.java:41)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
我通过以下替换解决了这个问题:
<context-param>
<param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
与 :
<context-param>
<param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
根据以下文档,我们不必在 web.xml post 升级到 struts 2.5 时指定 tiles.xml 路径。但是在weblogic server的情况下就不是这样了。
https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration
我正在尝试将 struts 从版本 2.2.1.1 升级到 2.5.17。但是在将其升级到 2.5.17 并升级了更多依赖项之后,我遇到了 运行 时间异常?我还升级了 jar,例如 jquery plugin、tiles、ognl、dojo 等。
我正在尝试将 struts 从版本 2.2.1.1 升级到 2.5.17。但是在将其升级到 2.5.17 并升级了更多依赖项之后,我遇到了 运行 时间异常?我还升级了 jar,例如 jquery plugin、tiles、ognl、dojo 等。
谁能推荐一下。
发生异常:
java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [LoginAction]
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:97)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:376)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:272)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:95)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:223)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)
com.aniket.web.struts.interceptors.CDMVI18nInterceptor.intercept(CDMVI18nInterceptor.java:43)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
com.aniket.web.filter.EncodingFilter.doFilter(EncodingFilter.java:41)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
java.lang.ClassNotFoundException: LoginAction
weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029)
weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990)
weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:104)
weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611)
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543)
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:496)
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:89)
weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:53)
com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:179)
org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:95)
org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:376)
org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:272)
com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:95)
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:223)
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:369)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:279)
com.aniket.web.struts.interceptors.CDMVI18nInterceptor.intercept(CDMVI18nInterceptor.java:43)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:48)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:574)
org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:79)
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:141)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
com.aniket.web.filter.EncodingFilter.doFilter(EncodingFilter.java:41)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
我通过以下替换解决了这个问题:
<context-param>
<param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
与 :
<context-param>
<param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
根据以下文档,我们不必在 web.xml post 升级到 struts 2.5 时指定 tiles.xml 路径。但是在weblogic server的情况下就不是这样了。
https://cwiki.apache.org/confluence/display/WW/Struts+2.3+to+2.5+migration