0

I am trying to catch the exception thrown at the time of VDB deployment but unable to catch but get logged in 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);
    }

As I am trying test the connection parameters by creating vdb and try to deploy the vdb. If all parameters is correct then its fine but if there any parameters are wrong then expecting proper exception handling for respective wrong parameters such as Unknown Host exception,.

ravi
  • 1
  • 2

1 Answers1

0

In WildFly the deployment process is async, so you can not catch the exception, however you can check for errors, by asking for VDB through Admin API and will show the errors.

Ramesh Reddy
  • 554
  • 1
  • 3
  • 8