title: How do I keep CFEXECUTE from hanging after a PrintStackTrace
body: <p>I'm using ColdFusion MX7 to perform a CFEXECUTE on some Java 6 code.  </p>
  
  <p>Unfortunately, since CF7 does not work under JDK 6 I must do it this way.</p>
  
  <p>My problem is that when an exception happens in the Java code if I call a <code>printStackTrace</code> on the exception the CFEXECUTE command hangs.  ColdFusion eventually times out but the Java process continues to hang in the background.</p>
  
  <p>I'm guessing there is some blocking going on but I can't seem to figure out why.</p>
  
  <p>If I don't do a <code>printStackTrace</code> then everything works fine.</p>
  
  <p>The exceptions are WebService exceptions generated with JAXWS from the Oracle Information Rights Management wsdl.</p>
  
  <p><B>EDIT</B></p>
  
  <p>I noticed that I am able to call the <code>printStackTrace</code> with a file <code>PrintStream</code> as a parameter and it works fine.  So, it looks like the error stream is having troubles.</p>
  
  <p>Here is the Java Code:</p>
  
  <pre><code>public void Execute(){
      AdminUtils AU = AdminUtils.GetInstance();
  
      AccountServicesPort AA = AU.GetAccountServicesPort(); 
  
      LicenseServerRef LicSerRef = AU.GetLicenseServerRef();
  
      User UserToSave = new User();
      UserToSave.setUserName(UserName);
      UserToSave.setFirstName(FirstName);
      UserToSave.setLastName(LastName);
      UserToSave.setEmailAddress(EmailAddress);
      UserToSave.setServer(LicSerRef);
  
      try{
          AU.LogMessage("Change User: " + UserName + " " + FirstName + " " + LastName + " " + EmailAddress);
          AA.saveChangesToUser(UserToSave);
      }catch(Exception e){
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Here is the ColdFusion call:</p>
  
  <pre><code>&lt;!--- Update the IRM User. ---&gt;
  &lt;CFEXECUTE name="c:\Program Files\Java\jdk1.6.0_14\bin\javaw.exe"
             arguments="-cp C:\CFusionMX7\Externals\IRM.jar;C:\CFusionMX7\Externals\Config IRMWebServices.UpdateUser #LoginID# #NewFname# #NewLname#"
             timeout="15" 
             variable="OUTPUT"&gt;
  &lt;/CFEXECUTE&gt;
  </code></pre>