Using the IDL export bridge to run some IDL methods from within a Java program. Been having problems with occasional bad data that crashes the IDL program (specifically a NAN for numeric values), giving the "execution halted" error, after which . I can run checks to sanitize the input but would like to have the more general solution of restarting my bridge session when this happens. I have a listener that catches the error output and tries to restart the bridge, code for initialization is below
public static java_IDL_connect getBridge() {
return getBridge("default_process" + Calendar.getInstance().getTimeInMillis());
}
public static java_IDL_connect getBridge(String name) {
java_IDL_connect connect = new java_IDL_connect();
connect.setProcessName(name);
JIDLProcessInitializer myinitializer = new JIDLProcessInitializer(JIDLProcessInitializer.LICENSING_RUNTIME);
connect.createObject(myinitializer);
String idlName = "idlName";
String procName = /*SDOConstants.ROOT_DIR*/ System.getenv("HOME") + "/" + "localidl/CoordinateTransform";
connect.setIDLVariable(idlName, new JIDLString(procName + ".sav"));
connect.addIDLOutputListener(new ErrorCatchListener());
connect.executeString("RESTORE, idlName");
return connect;
}
It hangs on the restart attempt at createObject(). The Calendar-time thing is to guarantee a different process name but has not helped. Anyone have ideas on how to get this to work?
|