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

Yasser Zamani edited comment on WW-4841 at 8/10/17 6:44 PM:
------------------------------------------------------------

:( strange! I have no idea now but could you please try this one:
{code:title=<yourActionClass>.java|borderStyle=solid}
...
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;
}
{code}
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?
{noformat}
        validatorFactory
        validatorFileParser
        fileManager
        reloadingConfigs
        textProviderFactory
{noformat}

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}}.


was (Author: yasser.zamani):
:( strange! I have no idea now but could you please try this one:
{code:title=<yourActionClass>.java|borderStyle=solid}
...
import com.opensymphony.xwork2.validator.ActionValidatorManager;
import com.opensymphony.xwork2.inject.Inject;
...
    private ActionValidatorManager actionValidatorManager;
    @Inject
    public void setAnnotationActionValidatorManager(ActionValidatorManager 
actionValidatorManager) {
        this.actionValidatorManager = actionValidatorManager;
    }
...
@Override
public String input() {
        System.out.println("WW-4841: " + this.actionValidatorManager);
    return INPUT;
}
{code}
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?
{noformat}
        validatorFactory
        validatorFileParser
        fileManager
        reloadingConfigs
        textProviderFactory
{noformat}

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}}.

> 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