title: Java Velocity engine initialization issue
body: <p>I have a written a library that has a mailbuilding part. This mailbuilding part employs the use of Velocity. The mailbuilder class is as follows --</p>
  
  <pre><code>public class mailBuilder {
   public void initialize() throws Exception
      {
              Properties props = new Properties();
  
              log.info("About to set the ClassPath for Velocity specific tasks");
              props.setProperty(VelocityEngine.RESOURCE_LOADER, "classpath");
              props.setProperty("classpath." + VelocityEngine.RESOURCE_LOADER + ".class", ClasspathResourceLoader.class.getName());
  
              try
              {
                  log.info("Just before");
                  Velocity.init(props);
                  log.info("Just after");
              }
              catch ( Exception e )
              {
                  log.error( "Caught Execption on velocityEngine init", e );
                  throw new Exception( "Caught Execption on velocityEngine init", e );
              }
              log.info("Completed initializing Velocity Engine");
  
      }
  
  public String returnMailstring() throws Exception {
  initialize();
  ....
  ....
  }
  
  }
  </code></pre>
  
  <p>Now when i run and test this library as is from eclipse, it the results are as expected and things seems fine.
  I have a web application that takes in a request from the UI, and uses ExecutorService (newSingleThreadExecutor) to service these user requests one by one silently in the background.</p>
  
  <p>I am noticing that my calls to the aforementioned library are getting hung at the mailbuilding part specifically at <code>Velocity.init(props)</code> There is no exception thrown but the thread seems to hang at the VelocityEngine initialization.
  I have looked up online and had no luck with what the issue may be. 
  Any help on how the issue would be immense.</p>
  
  <p>Thanks
  p1ng</p>