[ 
https://issues.apache.org/jira/browse/WW-4841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16119669#comment-16119669
 ] 

Prasann Grampurohit edited comment on WW-4841 at 8/9/17 10:12 AM:
------------------------------------------------------------------

[~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:
{code:java}
@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;
}
{code}

and see the below printed in logs:

{code:java}
[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
{code}


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

Thanks


was (Author: prasan...@gmail.com):
[~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:
{code:java}
@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;
    }
{code}

and see the below printed in logs:

{code:java}
[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
{code}


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

Thanks

> Struts2.5.12 - NPE in DeligatingValidatorContext
> ------------------------------------------------
>
>                 Key: WW-4841
>                 URL: https://issues.apache.org/jira/browse/WW-4841
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.5.12
>            Reporter: Prasann Grampurohit
>              Labels: struts2.5.12
>
> 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:
> {code:java}
> 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)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to