在VDB部署期间处理Teiid引发的异常

时间:2019-11-12 07:37:25

标签: java teiid

我正在尝试捕获在部署VDB时引发的异常,但是无法捕获却登录到teiid logger。

    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时。如果所有参数都是正确的,那么很好,但是如果有任何参数错误,则期望对相应的错误参数(例如“未知主机”异常)进行适当的异常处理。

1 个答案:

答案 0 :(得分:0)

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