I\'m using ColdFusion MX7 to perform a CFEXECUTE on some Java 6 code.
Unfortunately, since CF7 does not work under JDK 6 I must do it this way.
My problem
Yes, e.printStackTrace(); writes to stderr (standard error stream). Since cfexecute does not capture stderr, that is probably what is causing cfexecute to hang. There was a patch to fix this behavior in CF8.
Since you are using 7, try Ben Forta's tips about:
Using both /c and 2>&1 should get rid of the hanging problem.
Update: Added Example
ColdFusion Code:
Java Class:
public class TestStdErr {
public static void main(String[] args) {
try {
// cause a divide by zero exception
int a = 0;
int b = 2 /a;
}
catch(Exception e){
e.printStackTrace();
}
}
}