if ( ActionContext.getContext() == null )
{
// This fix allow initialization of ActionContext.getContext() to avoid NPE
ConfigurationManager configurationManager = new ConfigurationManager();
configurationManager.addContainerProvider( new XWorkConfigurationProvider() );
com.opensymphony.xwork2.config.Configuration config = configurationManager.getConfiguration();
Container container = config.getContainer();
ValueStack stack = container.getInstance( ValueStackFactory.class ).createValueStack();
stack.getContext().put( ActionContext.CONTAINER, container );