title: How to execute a Struts 2 Action from inside a Quartz job. How to obtain the Container?
body: <p>I am trying to execute a Struts2 Action from inside a Quartz job -- generalizing, from any context which is not the processing of an HTTP request.</p>
  
  <p>I started here <a href="http://struts.apache.org/2.0.6/docs/how-can-we-schedule-quartz-jobs.html" rel="nofollow">http://struts.apache.org/2.0.6/docs/how-can-we-schedule-quartz-jobs.html</a> but the document seems to be pretty obsolete.</p>
  
  <p>I believe (but I may be wrong) I've boiled it down to the need to obtain a Container object:</p>
  
  <pre><code>import java.util.HashMap;
  import com.opensymphony.xwork2.ActionProxy;
  import com.opensymphony.xwork2.DefaultActionProxyFactory;
  
  ...
  
  HashMap ctx = new HashMap();
  DefaultActionProxyFactory factory= new DefaultActionProxyFactory();
  factory.setContainer(HOW DO I GET THE CONTAINER??);
  ActionProxy proxy = factory.createActionProxy("", "scheduled/myjob", ctx);
  </code></pre>
  
  <p>One solution would be to issue an http request (via TCP) against localhost. I would prefer to avoid that.</p>