src/java/m/oms/ages/V1_0.java
@@ -45,6 +45,7 @@ |
@Description("OMS based AGES model service") |
@VersionInfo("1.0") |
@Path("m/ages/0.3.0") |
+@Polling(first = 5000, next = 4000) |
@Resource(file = "/bin/ages/ages.jar", type = JAR, id = Utils.ID_AGES_JAR) |
@Resource(file = "/bin/ages/ages-lib.zip", type = ARCHIVE) |
@Resource(file = "/bin/ages/ages-static.zip", type = ARCHIVE) |
src/java/oms/utils/Utils.java
@@ -317,16 +317,13 @@ |
// Create/execute a Ages. |
Executable p = createProcess(dsl, ws, param, res, LOG); |
int result = p.exec(); |
- if (result != 0) { |
- FilenameFilter ff = new WildcardFileFilter("java*stderr.txt", IOCase.INSENSITIVE); |
- File[] f = ws.listFiles(ff); |
- if (f != null && f.length > 0) { |
- String err = FileUtils.readFileToString(f[0]); |
- LOG.info("Ages execution error. " + f[0] + ":\n" + err); |
- throw new ServiceException("Ages execution error. " + f[0] + ":\n" + err); |
- } |
- throw new ServiceException("Ages execution error." + result); |
+ File f = p.stderr(); |
+ if (f.exists() && f.length() > 0) { |
+ String err = FileUtils.readFileToString(f, "UTF-8"); |
+ LOG.info("Ages execution error. " + f + ":\n" + err); |
+ throw new ServiceException("Ages execution error. " + f + ":\n" + err); |
} |
+ throw new ServiceException("Ages execution error." + result); |
} |
|
/** |