0

我试图捕捉 VDB 部署时引发的异常,但无法捕捉但登录到 teiid 记录器。

    byte[] vdbBytes = vdbHelper.getVdbByteArray(theVDB);
    try {
    // Deployment name for vdb must end in '-vdb.xml'.
    String deploymentName = vdbName + Constants.DYNAMIC_VDB_SUFFIX;
    // Deploy the VDB
    clientAccessor.getClient().deploy(deploymentName, new ByteArrayInputStream(vdbBytes));

    // Wait for VDB to finish loading

    long timeSt = new Date().getTime();
    //logger.info("deployVdb(VDBMetaData theVDB, String vdbName, int deploymentTimeout) entering.. date  "+new Timestamp(new Date().getTime()));
    waitForVDBLoad(vdbName, 1, deploymentTimeout);
    long timeEnd = new Date().getTime();
    //logger.info("deployVdb(VDBMetaData theVDB, String vdbName, int deploymentTimeout) entering.. date  "+new Timestamp(new Date().getTime()) + "  time in long - " + ((timeEnd-timeSt)));
    //logger.info(METHOD_NAME + " Exiting.");
    }catch(Exception e) {
        System.err.println(e);
    }

当我尝试通过创建 vdb 来测试连接参数并尝试部署 vdb 时。如果所有参数都正确,则很好,但如果有任何参数错误,则期望对各个错误参数(例如未知主机异常)进行适当的异常处理。

4

1 回答 1

0

在 WildFly 中,部署过程是异步的,因此您无法捕获异常,但是您可以通过 Admin API 请求 VDB 来检查错误并显示错误。

于 2019-11-17T05:25:44.350 回答