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

createInstance method signature change of TextProviderFactory from merged xwork-core code inside struts2-core-2.5.13.jar which was present with xwork-core jar

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.12, 2.5.13
    • 2.5.14
    • Core
    • None

    Description

      xwork-core-2.3.32 had these createInstance methods.

      public TextProvider createInstance(Class clazz, LocaleProvider provider) {
          TextProvider instance = getTextProvider(clazz, provider);
          if (instance instanceof ResourceBundleTextProvider) {
            ((ResourceBundleTextProvider)instance).setClazz(clazz);
            ((ResourceBundleTextProvider)instance).setLocaleProvider(provider);
          }
          return instance;
        }
      
        public TextProvider createInstance(ResourceBundle bundle, LocaleProvider provider) {
          TextProvider instance = getTextProvider(bundle, provider);
          if (instance instanceof ResourceBundleTextProvider) {
            ((ResourceBundleTextProvider)instance).setBundle(bundle);
            ((ResourceBundleTextProvider)instance).setLocaleProvider(provider);
          }
          return instance;
        }
      

      struts2-core-2.5.13.jar has merged the xwork-core code and there only these methods are available:

      public abstract TextProvider createInstance(Class paramClass);
      public abstract TextProvider createInstance(ResourceBundle paramResourceBundle);
      

      As We have called the createInstance method from many places of Our Application, So migration to struts-2.5.13 is creating a problem. We are having code like:

      private final transient TextProvider textProvider = new TextProviderFactory().createInstance(getClass(), this);
      

      method signature should not be changed which has huge effect rather there should be overloaded method with merged xwork-core code inside struts2-core-2.5.13.jar.

      We are getting such error:

      2017-10-06|16:53:23,965|ERROR||[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'|com.tcs.bancs.filter.BancsServletFilter:210|:G:dl3xbKkVBfwQOly9zGyiU1g_MDVUFEoaUV5nTc3nKJP-btoWLMoK!183988368!1507288983829:0:0:0:0:0:0:0:1: |Validation exception |
      javax.servlet.ServletException: java.lang.InstantiationError: com.opensymphony.xwork2.TextProviderFactory
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:387) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:483) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:372) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:587) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:481) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at org.springframework.security.web.firewall.RequestWrapper$FirewalledRequestAwareRequestDispatcher.include(RequestWrapper.java:136) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at com.tcs.bfsarch.security.action.AuthSuccessHandler.onAuthenticationSuccess(AuthSuccessHandler.java:211) ~[coreweb.jar:?]
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.successfulAuthentication(AbstractAuthenticationProcessingFilter.java:331) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.successfulAuthentication(AbstractAuthenticationProcessingFilter.java:298) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:235) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at com.tcs.mastercraft.userlib.AccessVerifierFilter.doFilter(AccessVerifierFilter.java:78) ~[coreweb.jar:?]
      	at com.tcs.bancs.filter.BancsServletFilter.doFilter(BancsServletFilter.java:208) [coreweb.jar:?]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) [weblogic.server.merged.jar:12.1.3.0.0]
      	at com.tcs.bfsarch.filter.session.SessionSyncFilter.doFilter(SessionSyncFilter.java:38) [coreweb.jar:?]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) [com.oracle.css.weblogic.security.wls_7.1.0.0.jar:CSS 7.1 0.0]
      	at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.work.ExecuteThread.run(ExecuteThread.java:263) [weblogic.server.merged.jar:12.1.3.0.0]
      Caused by: java.lang.InstantiationError: com.opensymphony.xwork2.TextProviderFactory
      	at com.tcs.bancs.repackaged.struts.taglib.TagUtils.<init>(TagUtils.java:357) ~[mc.jar:?]
      	at com.tcs.bancs.repackaged.struts.taglib.TagUtils.<clinit>(TagUtils.java:61) ~[mc.jar:?]
      	at com.tcs.bfsarch.tags.eh.bfsMessagesTag.doEndTag(bfsMessagesTag.java:195) ~[coreweb.jar:?]
      	at jsp_servlet._common.__loginapimessages._jsp__tag0(__loginapimessages.java:145) ~[__loginapimessages.class:?]
      	at jsp_servlet._common.__loginapimessages._jspService(__loginapimessages.java:96) ~[__loginapimessages.class:?]
      	at weblogic.servlet.jsp.JspBase.service(JspBase.java:35) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	... 43 more
      2017-10-06|16:53:38,620|ERROR||[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'|com.tcs.bancs.filter.BancsServletFilter:210|:G:dl3xbKkVBfwQOly9zGyiU1g_MDVUFEoaUV5nTc3nKJP-btoWLMoK!183988368!1507288983829:0:0:0:0:0:0:0:1: |Validation exception |
      javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.tcs.bancs.repackaged.struts.taglib.TagUtils
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:387) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:483) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:372) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at com.tcs.bancs.filter.BancsServletFilter.enableGZIP(BancsServletFilter.java:414) ~[coreweb.jar:?]
      	at com.tcs.bancs.filter.BancsServletFilter.doFilter(BancsServletFilter.java:170) ~[coreweb.jar:?]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:588) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:273) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at org.springframework.security.web.firewall.RequestWrapper$FirewalledRequestAwareRequestDispatcher.forward(RequestWrapper.java:132) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at com.tcs.bfsarch.security.action.AuthSuccessHandler.onAuthenticationSuccess(AuthSuccessHandler.java:502) ~[coreweb.jar:?]
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.successfulAuthentication(AbstractAuthenticationProcessingFilter.java:331) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.successfulAuthentication(AbstractAuthenticationProcessingFilter.java:298) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:235) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) ~[spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
      	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) ~[spring-web-4.0.2.RELEASE.jar:4.0.2.RELEASE]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at com.tcs.mastercraft.userlib.AccessVerifierFilter.doFilter(AccessVerifierFilter.java:78) ~[coreweb.jar:?]
      	at com.tcs.bancs.filter.BancsServletFilter.doFilter(BancsServletFilter.java:208) [coreweb.jar:?]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) [weblogic.server.merged.jar:12.1.3.0.0]
      	at com.tcs.bfsarch.filter.session.SessionSyncFilter.doFilter(SessionSyncFilter.java:38) [coreweb.jar:?]
      	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3436) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) [com.oracle.css.weblogic.security.wls_7.1.0.0.jar:CSS 7.1 0.0]
      	at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311) [weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.work.ExecuteThread.run(ExecuteThread.java:263) [weblogic.server.merged.jar:12.1.3.0.0]
      Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.tcs.bancs.repackaged.struts.taglib.TagUtils
      	at com.tcs.mastercraft.taglib.MCJSLoadingTag.doStartTag(MCJSLoadingTag.java:61) ~[coreweb.jar:?]
      	at jsp_servlet._common.__mainframe._jsp__tag99(__mainframe.java:5928) ~[__mainframe.class:?]
      	at jsp_servlet._common.__mainframe._jspService(__mainframe.java:3556) ~[__mainframe.class:?]
      	at weblogic.servlet.jsp.JspBase.service(JspBase.java:35) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346) ~[weblogic.server.merged.jar:12.1.3.0.0]
      	... 47 more
      

      Attachments

        1. s1.png
          172 kB
          Ananga Mohan Bera
        2. s2.png
          196 kB
          Ananga Mohan Bera
        3. s3.png
          191 kB
          Ananga Mohan Bera
        4. s4.png
          185 kB
          Ananga Mohan Bera

        Activity

          People

            lukaszlenart Lukasz Lenart
            anbera Ananga Mohan Bera
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: