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

Struts2.5.12 - NPE in DeligatingValidatorContext

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.5.12
    • Fix Version/s: 2.5.13
    • Component/s: Core
    • Labels:

      Description

      We are upgrading one of our project to Struts 2.5.12. My project setup is as mentioned in the link: https://stackoverflow.com/questions/45347478/struts2-5-12-npe-while-using-gettext-method-from-actionsupport

      When I try to submit request to action on the first page, I see NullPointerException as below. Debugged it and found that textProviderFactory is null. Tried it a several times and I see that it is intermittent. Approximately twice in 10 server restarts the textProviderFactory is initialized.
      Could you please check if I am missing any configuration? I have raised a stackoverflow for this, but haven't got any response yet - https://stackoverflow.com/questions/45483364/struts2-5-12-npe-in-deligatingvalidatorcontext

      Exception:

      java.lang.NullPointerException
          at com.opensymphony.xwork2.validator.DelegatingValidatorContext.makeTextProvider(DelegatingValidatorContext.java:210)
          at com.opensymphony.xwork2.validator.DelegatingValidatorContext.<init>(DelegatingValidatorContext.java:63)
          at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:125)
          at com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.validate(AnnotationActionValidatorManager.java:121)
          at com.opensymphony.xwork2.validator.ValidationInterceptor.doBeforeInvocation(ValidationInterceptor.java:224)
          at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:259)
          at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:52)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.my.company.web.interceptor.ButtonPressedInterceptor.intercept(ButtonPressedInterceptor.java:40)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.doIntercept(ConversionErrorInterceptor.java:139)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:199)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:88)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:246)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:99)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:157)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:123)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:174)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:171)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:134)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:201)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.my.company.web.interceptor.PageflowInterceptor$Executor.execute(PageflowInterceptor.java:220)
          at com.my.company.web.interceptor.PageflowInterceptor.intercept(PageflowInterceptor.java:47)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.my.company.web.interceptor.SessionValidationInterceptor.intercept(SessionValidationInterceptor.java:51)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.my.company.web.interceptor.PageflowAwareTokenSessionStoreInterceptor.handleValidToken(PageflowAwareTokenSessionStoreInterceptor.java:155)
          at com.my.company.web.interceptor.PageflowAwareTokenSessionStoreInterceptor.doIntercept(PageflowAwareTokenSessionStoreInterceptor.java:78)
          at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:193)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:247)
          at org.apache.struts2.factory.StrutsActionProxy.execute(StrutsActionProxy.java:53)
          at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:577)
          at org.apache.struts2.dispatcher.ExecuteOperations.executeAction(ExecuteOperations.java:81)
          at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:143)
          at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
          at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
          at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
          at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
          at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
          at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
          at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
          at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
          at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
          at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
          at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
          at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
          at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
          at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
          at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
          at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
          at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:285)
          at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:264)
          at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
          at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:175)
          at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)
          at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:792)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at java.lang.Thread.run(Thread.java:745)
      
      1. ActionValidatorManager.JPG
        131 kB
        Prasann Grampurohit
      2. struts2_error.log
        70 kB
        Prasann Grampurohit

        Issue Links

          Activity

          Hide
          yasser.zamani Yasser Zamani added a comment -

          Please try following code in your action then post us that lines you get in your output starting with "WW-4841: "

          <yourActionClass>.java
          ...
          import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
          import com.opensymphony.xwork2.util.ClassLoaderUtil;
          import java.net.URL;
          import java.util.Iterator;
          ...
              public String execute() throws Exception {
                  Iterator<URL> urls = ClassLoaderUtil.getResources("struts-default.xml", XmlConfigurationProvider.class, false);
                  while (urls.hasNext()) {
                      URL url = urls.next();
                      System.out.println("WW-4841: " + url);
                  }
                  return SUCCESS;
              }
          
          Show
          yasser.zamani Yasser Zamani added a comment - Please try following code in your action then post us that lines you get in your output starting with " WW-4841 : " <yourActionClass>.java ... import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider; import com.opensymphony.xwork2.util.ClassLoaderUtil; import java.net.URL; import java.util.Iterator; ... public String execute() throws Exception { Iterator<URL> urls = ClassLoaderUtil.getResources( "struts- default .xml" , XmlConfigurationProvider.class, false ); while (urls.hasNext()) { URL url = urls.next(); System .out.println( "WW-4841: " + url); } return SUCCESS; }
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment - - edited

          Yasser Zamani - Thank you for your reply.
          I added the execute method, but it is not invoked when I have the issue with textProviderFactory not being initialized.
          So, I added it in the input method of my action class as:

          @Override
          public String input() {
              Iterator<URL> urls = ClassLoaderUtil.getResources("struts-default.xml", XmlConfigurationProvider.class, false);
              while (urls.hasNext()) {
                  URL url = urls.next();
                  System.out.println("WW-4841: " + url);
              }
              return INPUT;
          }
          

          and see the below printed in logs:

          [stdout] (default task-49) WW-4841: vfs:/D:/JBossEAP/jboss-eap-7.0/bin/content/MyApp.war/WEB-INF/lib/struts2-core-2.5.12.jar/struts-default.xml
          

          Please let me know if you see anything wrong with this.

          Thanks

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - - edited Yasser Zamani - Thank you for your reply. I added the execute method, but it is not invoked when I have the issue with textProviderFactory not being initialized. So, I added it in the input method of my action class as: @Override public String input() { Iterator<URL> urls = ClassLoaderUtil.getResources( "struts- default .xml" , XmlConfigurationProvider.class, false ); while (urls.hasNext()) { URL url = urls.next(); System .out.println( "WW-4841: " + url); } return INPUT; } and see the below printed in logs: [stdout] ( default task-49) WW-4841: vfs:/D:/JBossEAP/jboss-eap-7.0/bin/content/MyApp.war/WEB-INF/lib/struts2-core-2.5.12.jar/struts- default .xml Please let me know if you see anything wrong with this. Thanks
          Hide
          yasser.zamani Yasser Zamani added a comment - - edited

          Thank you, could you also try following code:

          <yourActionClass>.java
          ...
          import com.opensymphony.xwork2.TextProviderFactory;
          import com.opensymphony.xwork2.inject.Inject;
          ...
              private TextProviderFactory textProviderFactory;
              @Inject
              public void setTextProviderFactory(TextProviderFactory textProviderFactory) {
                  this.textProviderFactory = textProviderFactory;
              }
          ...
          @Override
          public String input() {
                  System.out.println("WW-4841: " + this.textProviderFactory);
              return INPUT;
          }
          
          Show
          yasser.zamani Yasser Zamani added a comment - - edited Thank you, could you also try following code: <yourActionClass>.java ... import com.opensymphony.xwork2.TextProviderFactory; import com.opensymphony.xwork2.inject.Inject; ... private TextProviderFactory textProviderFactory; @Inject public void setTextProviderFactory(TextProviderFactory textProviderFactory) { this .textProviderFactory = textProviderFactory; } ... @Override public String input() { System .out.println( "WW-4841: " + this .textProviderFactory); return INPUT; }
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment -

          Hi Yasser Zamani,
          I tried this, but my action class fails instantiation with the error:

          Unable to instantiate Action, membersAction, defined for 'members' in namespace '/ins'com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.TextProviderFactory, name='default'] in public void com.my.acompany.web.action.mem.MembersAction.setTextProviderFactory(com.opensymphony.xwork2.TextProviderFactory).

          Does this mean I am missing any configuration?

          Thanks.

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - Hi Yasser Zamani , I tried this, but my action class fails instantiation with the error: Unable to instantiate Action, membersAction, defined for 'members' in namespace '/ins'com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.TextProviderFactory, name='default'] in public void com.my.acompany.web.action.mem.MembersAction.setTextProviderFactory(com.opensymphony.xwork2.TextProviderFactory). Does this mean I am missing any configuration? Thanks.
          Hide
          yasser.zamani Yasser Zamani added a comment - - edited

          strange! I have no idea now but could you please try this one:

          <yourActionClass>.java
          ...
          import com.opensymphony.xwork2.validator.ActionValidatorManager;
          import com.opensymphony.xwork2.inject.Inject;
          ...
              private ActionValidatorManager actionValidatorManager;
              @Inject
              public void setActionValidatorManager(ActionValidatorManager actionValidatorManager) {
                  this.actionValidatorManager = actionValidatorManager;
              }
          ...
          @Override
          public String input() {
                  System.out.println("WW-4841: " + this.actionValidatorManager);
              return INPUT;
          }
          

          Then put a break-point on return INPUT; and then see what of following properties of this.actionValidatorManager are null and what are not. Are all of them null?

                  validatorFactory
                  validatorFileParser
                  fileManager
                  reloadingConfigs
                  textProviderFactory
          

          ALSO ... please add <constant name="struts.devMode" value="true" /> to your struts.xml and configure log4j2 for your application and then run your application and review it's output for any warnings. I guess you should look for something like Unable to load config class X at Y probably due to a missing jar, which might be fine if you never plan to use the Z interceptor.

          Show
          yasser.zamani Yasser Zamani added a comment - - edited strange! I have no idea now but could you please try this one: <yourActionClass>.java ... import com.opensymphony.xwork2.validator.ActionValidatorManager; import com.opensymphony.xwork2.inject.Inject; ... private ActionValidatorManager actionValidatorManager; @Inject public void setActionValidatorManager(ActionValidatorManager actionValidatorManager) { this .actionValidatorManager = actionValidatorManager; } ... @Override public String input() { System .out.println( "WW-4841: " + this .actionValidatorManager); return INPUT; } Then put a break-point on return INPUT; and then see what of following properties of this.actionValidatorManager are null and what are not. Are all of them null? validatorFactory validatorFileParser fileManager reloadingConfigs textProviderFactory ALSO ... please add <constant name="struts.devMode" value="true" /> to your struts.xml and configure log4j2 for your application and then run your application and review it's output for any warnings. I guess you should look for something like Unable to load config class X at Y probably due to a missing jar, which might be fine if you never plan to use the Z interceptor .
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment - - edited

          Yasser Zamani,
          I have tried this and see the values in

          this.actionValidatorManager
          

          as in the attached file ActionValidatorManager.JPG.

          I have also added

          <constant name="struts.devMode" value="true" />
          

          and I don't see anything additional in logs. I already have the log4j configured on my project.

          Please let me know if I have to do any configuration to initialize textProviderFactory.

          Thanks.

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - - edited Yasser Zamani , I have tried this and see the values in this .actionValidatorManager as in the attached file ActionValidatorManager.JPG . I have also added <constant name= "struts.devMode" value= " true " /> and I don't see anything additional in logs. I already have the log4j configured on my project. Please let me know if I have to do any configuration to initialize textProviderFactory. Thanks.
          Hide
          yasser.zamani Yasser Zamani added a comment - - edited

          I can not see if it's textProviderFactory is null or not. Could you please close collapsed ones to see all of above properties in one image?

          And, Struts 2.5.12 uses log4j2 (log4j major version *2*). Please update your log4j configuration to log4j2 as described at Migrating from Log4j 1.x - Apache Log4j 2

          Show
          yasser.zamani Yasser Zamani added a comment - - edited I can not see if it's textProviderFactory is null or not. Could you please close collapsed ones to see all of above properties in one image? And, Struts 2.5.12 uses log4j2 (log4j major version * 2 *). Please update your log4j configuration to log4j2 as described at Migrating from Log4j 1.x - Apache Log4j 2
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment - - edited

          Hi Yasser Zamani,
          All the properties you had asked for are on the image that I have uploaded, but now I have highlighted them. Please check. I will implement log4j2 and let you know.

          Thanks

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - - edited Hi Yasser Zamani , All the properties you had asked for are on the image that I have uploaded, but now I have highlighted them. Please check. I will implement log4j2 and let you know. Thanks
          Hide
          yasser.zamani Yasser Zamani added a comment -

          Thanks a lot. I feel I'm near to the solution Do you have any init-param for your Struts filter inside web.xml? e.g.

          <filter>
               <filter-name>struts2</filter-name>
               <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
               <init-param>
                   ...
               </init-param>
          </filter>
          
          Show
          yasser.zamani Yasser Zamani added a comment - Thanks a lot. I feel I'm near to the solution Do you have any init-param for your Struts filter inside web.xml? e.g. <filter> <filter-name> struts2 </filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> <init-param> ... </init-param> </filter>
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment - - edited

          Hi Yasser Zamani,
          'Closer to solution' feels great

          No, I do not have any 'init-param' specified for 'StrutsPrepareAndExecuteFilter'. I just have it as:

          <filter>
          	<filter-name>struts2</filter-name>
          	<filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
          </filter>
          

          Thanks.

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - - edited Hi Yasser Zamani , 'Closer to solution' feels great No, I do not have any 'init-param' specified for 'StrutsPrepareAndExecuteFilter'. I just have it as: <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> Thanks.
          Hide
          yasser.zamani Yasser Zamani added a comment - - edited

          I have no idea why Struts injects some of them and does not inject rest!

          The only hope I think is finding something in log4j2 output as I mentioned above.

          And could you see what happens if you add following as first child of struts tag of your struts.xml?

          <bean type="com.opensymphony.xwork2.TextProviderFactory" name="struts" class="com.opensymphony.xwork2.StrutsTextProviderFactory" scope="singleton" />
          
          Show
          yasser.zamani Yasser Zamani added a comment - - edited I have no idea why Struts injects some of them and does not inject rest! The only hope I think is finding something in log4j2 output as I mentioned above. And could you see what happens if you add following as first child of struts tag of your struts.xml? <bean type= "com.opensymphony.xwork2.TextProviderFactory" name= "struts" class= "com.opensymphony.xwork2.StrutsTextProviderFactory" scope= "singleton" />
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment -

          Hi Yasser Zamani,
          I have tried the same and see the error in logs as:

          Caused by: com.opensymphony.xwork2.config.ConfigurationException: Bean type interface com.opensymphony.xwork2.TextProviderFactory with the name struts has already been loaded by [unknown location]

          Thanks.

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - Hi Yasser Zamani , I have tried the same and see the error in logs as: Caused by: com.opensymphony.xwork2.config.ConfigurationException: Bean type interface com.opensymphony.xwork2.TextProviderFactory with the name struts has already been loaded by [unknown location] Thanks.
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment -

          Hi Yasser Zamani,
          I have configured log4j2 now for my project and I see the exception as in the attached log file struts2_error.log. Could you please check if this helps?

          Thanks,
          Prasann

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - Hi Yasser Zamani , I have configured log4j2 now for my project and I see the exception as in the attached log file struts2_error.log . Could you please check if this helps? Thanks, Prasann
          Hide
          yasser.zamani Yasser Zamani added a comment -

          Helped a lot The problem is with DTD of your app validation xml files. Please take a look at WW-4828 and WW-2781.

          Show
          yasser.zamani Yasser Zamani added a comment - Helped a lot The problem is with DTD of your app validation xml files. Please take a look at WW-4828 and WW-2781 .
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment -

          Hi Yasser Zamani,
          Thank you for your reply. A bit confused here.
          In My struts.xml, I already have:

          <!DOCTYPE struts PUBLIC
                  "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
                  "http://struts.apache.org/dtds/struts-2.5.dtd">
          

          I guess I don't need changes to this.. right?

          Also, in my 'validators.xml' and other action specific validation xml files I have DOCTYPE defined as:

          <!DOCTYPE validators PUBLIC
                  "-//OpenSymphony Group//XWork Validator Config 1.0//EN"
                  "http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd">
          

          Should I be changing it to:

          <!DOCTYPE validators PUBLIC
          	"-//Apache Struts//XWork Validator Config 1.0//EN"
              "http://struts.apache.org/dtds/xwork-validator-config-1.0.dtd">
          

          Thanks,
          Prasann

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - Hi Yasser Zamani , Thank you for your reply. A bit confused here. In My struts.xml, I already have: <!DOCTYPE struts PUBLIC "- //Apache Software Foundation//DTD Struts Configuration 2.5//EN" "http: //struts.apache.org/dtds/struts-2.5.dtd" > I guess I don't need changes to this.. right? Also, in my 'validators.xml' and other action specific validation xml files I have DOCTYPE defined as: <!DOCTYPE validators PUBLIC "- //OpenSymphony Group//XWork Validator Config 1.0//EN" "http: //www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd" > Should I be changing it to: <!DOCTYPE validators PUBLIC "- //Apache Struts//XWork Validator Config 1.0//EN" "http: //struts.apache.org/dtds/xwork-validator-config-1.0.dtd" > Thanks, Prasann
          Hide
          yasser.zamani Yasser Zamani added a comment - - edited

          What I see at Validation does not have the word Config and is:

          <!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
                  "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd">
          

          Also, Struts will try to use locally provided DTDs before fetching them over Internet but if it happens it means you should see such log message:

          Local DTD is missing for publicID: .... - defined mappings: ....

          and it means you are using wrong PublicID that doesn't match any of the Struts DTDs

          Show
          yasser.zamani Yasser Zamani added a comment - - edited What I see at Validation does not have the word Config and is: <!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.3.dtd" > Also, Struts will try to use locally provided DTDs before fetching them over Internet but if it happens it means you should see such log message: Local DTD is missing for publicID: .... - defined mappings: .... and it means you are using wrong PublicID that doesn't match any of the Struts DTDs
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment -

          Hi Yasser Zamani,
          Thank you very much for your help on this.
          I have modified it as per your suggestion and did some testing and it seems to be working now
          Will test it a few more times before I inform my manager
          Thanks again for your help on this.

          Prasann

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - Hi Yasser Zamani , Thank you very much for your help on this. I have modified it as per your suggestion and did some testing and it seems to be working now Will test it a few more times before I inform my manager Thanks again for your help on this. Prasann
          Hide
          yasser.zamani Yasser Zamani added a comment -

          You're welcome , happy that it works now just do not forget to set devMode to false when you deploy to production.

          Show
          yasser.zamani Yasser Zamani added a comment - You're welcome , happy that it works now just do not forget to set devMode to false when you deploy to production.
          Hide
          lukaszlenart Lukasz Lenart added a comment -

          Do I get this right and this can be marked a resolved?

          Show
          lukaszlenart Lukasz Lenart added a comment - Do I get this right and this can be marked a resolved?
          Hide
          yasser.zamani Yasser Zamani added a comment -

          Surely yes as not a problem.

          Show
          yasser.zamani Yasser Zamani added a comment - Surely yes as not a problem.
          Hide
          prasannkg@gmail.com Prasann Grampurohit added a comment -

          Hi Lukasz Lenart - Yes, this can now be marked as resolved. Yasser Zamani's fix worked fine.

          Thanks,
          Prasann

          Show
          prasannkg@gmail.com Prasann Grampurohit added a comment - Hi Lukasz Lenart - Yes, this can now be marked as resolved. Yasser Zamani 's fix worked fine. Thanks, Prasann
          Hide
          yasser.zamani Yasser Zamani added a comment -

          Prasann Grampurohit confirmed resolution at here later.

          Show
          yasser.zamani Yasser Zamani added a comment - Prasann Grampurohit confirmed resolution at here later.

            People

            • Assignee:
              Unassigned
              Reporter:
              prasannkg@gmail.com Prasann Grampurohit
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development