struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Rein (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-3023) ClassNotFoundException in Convention plugin using WebSphere shared library
Date Fri, 06 Mar 2009 16:15:46 GMT

     [ https://issues.apache.org/struts/browse/WW-3023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Travis Rein updated WW-3023:
----------------------------

    Attachment: ConventionServiceImpl.patch

Here is the patch that worked for me

> ClassNotFoundException in Convention plugin using WebSphere shared library
> --------------------------------------------------------------------------
>
>                 Key: WW-3023
>                 URL: https://issues.apache.org/struts/browse/WW-3023
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Convention
>    Affects Versions: 2.1.6
>         Environment: WebSphere Application Server 6.1.0.17
>            Reporter: Travis Rein
>            Priority: Minor
>         Attachments: ConventionServiceImpl.patch
>
>
> The following exception occurs when the Convention plugin is installed as a shared library
in WebSphere 6.1 and the result is not explicitly mapped in struts.xml or with an annotation.
It is caused because the plugin JAR is loaded by the extension classloader and the actions
are loaded by the WAR classloader. ConventionServiceImpl.determineResultPath simply uses Class.forName
rather than checking the context classloader. So it fails to find the action--even though
the action class is already loaded on the WAR classloader.
> I have created a patch that uses the core ClassLoaderUtils to load the class instead
of Class.forName.
> java.lang.RuntimeException: Invalid action class configuration that references an unknown
class named [com.example.action.MyAction]
> 	at org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:99)
> 	at org.apache.struts2.convention.ConventionUnknownHandler.determinePath(ConventionUnknownHandler.java:379)
> 	at org.apache.struts2.convention.ConventionUnknownHandler.handleUnknownResult(ConventionUnknownHandler.java:268)
> 	at com.opensymphony.xwork2.DefaultUnknownHandlerManager.handleUnknownResult(DefaultUnknownHandlerManager.java:76)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:214)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:355)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
> 	at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
> 	at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
> 	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at org.apache.struts2.rest.ContentTypeInterceptor.intercept(ContentTypeInterceptor.java:67)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
> 	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
> 	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
> 	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:204)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
> 	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
> 	at com.opensymphony.xwork2.DefaultActionProxy.execute(DefaultActionProxy.java:129)
> 	at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
> 	at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
> 	at org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:76)
> 	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> 	at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
> 	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
> 	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> 	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:65)
> 	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:773)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:681)
> 	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:696)
> 	at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:118)
> 	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:791)
> 	at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:741)
> 	at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113)
> 	at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3391)
> 	at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
> 	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
> 	at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
> 	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:115)
> 	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
> 	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
> 	at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
> 	at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)
> 	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
> 	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
> 	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
> 	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> 	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
> 	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
> 	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
> 	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
> Caused by: java.lang.ClassNotFoundException: com.example.action.MyAction
> 	at java.lang.Class.forNameImpl(Native Method)
> 	at java.lang.Class.forName(Class.java:130)
> 	at org.apache.struts2.convention.ConventionsServiceImpl.determineResultPath(ConventionsServiceImpl.java:97)
> 	... 87 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message