I was able to resolve the issue by overriding the StrutsJunit4TestCase.getActionProxy(). My current action setup is trying to get access to the WebApplicationContext when the action is constructed, which is happening prior to the current getActionProxy() injecting the necessary objects into the ServletActionContext. Below is my override that resolved this issue

protected ActionProxy getActionProxy(String uri) {

    // the super.getActionProxy() already sets this, but does it at the end of the method.
    // the ActionProxy proxy = ... line is already expecting it to be present and produces a NPE

    return super.getActionProxy(uri);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top