[ https://issues.apache.org/jira/browse/WW-2561?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-2561: ------------------------------ Fix Version/s: (was: 3.0) 2.5.6 > Included XSL files' URI not being resolved for actions with result type="xslt" > ------------------------------------------------------------------------------ > > Key: WW-2561 > URL: https://issues.apache.org/jira/browse/WW-2561 > Project: Struts 2 > Issue Type: Bug > Affects Versions: 2.0.11.1 > Environment: Windows XP/SP2; WebSphere Application Server v6.1.0.7. > Reporter: Victor Voronenko > Assignee: Don Brown > Fix For: 2.5.6 > > > Make Struts action e.g: > {code:xml} > > > {deals} > /WEB-INF/xsl/dealList.xsl > > > {code} > Supply any XML by including some code like this in action class: > {code:java} > public String[] getMonths(){ > String months[] = > {"Jan", "Feb", "Mar", "Apr", "May", "Jun", > "July", "Aug", "Sep", "Oct", "Nov", "Dec"}; > return months; > } > {code} > Supply the XSL file, sort of this: > {code:xml} > > > > > > > > > >
> There are following months in a year:

> > , > > > > >
>
> {code} > At a run time it will generate the error: > {noformat} > [3/24/08 10:05:03:927 EDT] 0000001e SystemErr R SystemId Unknown; Line #3; Column #51; Had IO Exception with stylesheet file: /WEB-INF/xsl/pageFooter.xsl > [3/24/08 10:05:03:927 EDT] 0000001e SystemErr R SystemId Unknown; Line #19; Column #41; javax.xml.transform.TransformerException: ElemTemplateElement error: pagefooter > {noformat} > with the following stack: > {noformat} > java.lang.NullPointerException > at org.apache.struts2.views.xslt.XSLTResult.execute(XSLTResult.java:325) > at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) > at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221) > at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150) > at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48) > at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:123) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:167) > at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:105) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:83) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:207) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:74) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:127) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:107) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:206) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:115) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:143) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:121) > at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:170) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:123) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) > at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) > at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) > at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) > at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) > at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) > at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) > at com.tss.admin.revreal.web.RRDispatcher.doFilter(RRDispatcher.java:68) > 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:761) > at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673) > at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:688) > at com.ibm.ws.wswebcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:96) > at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:737) > at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:697) > at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113) > at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3184) > at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:254) > at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811) > at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433) > at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:111) > at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454) > at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383) > at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263) > at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) > at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) > 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:1469) > {noformat} > None of the {{}} directive variations ("../filename", "WEB-INF/filename" etc) don't work. > Short analysis: > - the {{URIResolver}} method in {{XSLTResult}} class is accessing the action context to get the realPath and use it as a base for included XSL file: > {code:java} > protected URIResolver getURIResolver () { > return new ServletURIResolver ( > ServletActionContext.getServletContext()); > } > {code} > Path returned during the test was correct, like C:\Projects\DealApplication\WebContent. The XSL file existed and was well formed. > Suggestion: the base might be ignored and not applied to URI. -- This message was sent by Atlassian JIRA (v6.3.4#6332)