Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3408

java.lang.NoSuchMethodError: com.opensymphony.xwork2.ActionContext.get(Ljava/lang/Object;)Ljava/lang/Object;

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.1.6, 2.1.8, 2.1.8.1
    • Fix Version/s: 2.2.1
    • Component/s: None
    • Labels:
      None

      Description

      I'm trying to write a custom result type that extends StrutsResultSupport. I have the following line of line that works fine using struts 2.0.14, but throws an exception using 2.1.6 and 2.1.8.1:

      HttpServletResponse response = (HttpServletResponse)invocation.getInvocationContext().get(HTTP_RESPONSE);
      

      Here's the exception:

      [ERROR] 2010-03-16 08:16:12,934 {http-8080-3} org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/dibs-registrar-web].[default] - Servlet.service() for servlet default threw exception
       java.lang.NoSuchMethodError: com.opensymphony.xwork2.ActionContext.get(Ljava/lang/Object;)Ljava/lang/Object;
      	at com.xxx.xw.DownloadAttachedFileResult.doExecute(DownloadAttachedFileResult.java:73)
      	at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
      	at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
      	at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
      	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
      	at com.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	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.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	at com.xxx.xxx.xw.VitalizeInterceptor.intercept(VitalizeInterceptor.java:44)
      	at com.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
      	at com.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)
      	at com.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
      	at com.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	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.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	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.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	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.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
      	at com.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	at com.xxx.xxx.xw.RedirectMessageInterceptor.doIntercept(RedirectMessageInterceptor.java:64)
      	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
      	at com.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	at com.xxx.xxx.xw.VitalizeForInputResultInterceptor.intercept(VitalizeForInputResultInterceptor.java:45)
      	at com.google.inject.servlet.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:234)
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
      	at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
      	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.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
      	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
      	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
      	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
      	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
      	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
      	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java:65)
      	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
      	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
      	at com.xxx.xxx.servlet.CurrentUserInfoFilter.doFilter(CurrentUserInfoFilter.java:70)
      	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
      	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
      	at com.xxx.xxx.servlet.HibernateTXFilter.doFilter(HibernateTXFilter.java:47)
      	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
      	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
      	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:122)
      	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      	at java.lang.Thread.run(Thread.java:595)
      

        Attachments

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              fmpdmb Frank Pedroza
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: