Java Code Examples for javax.naming.ConfigurationException#printStackTrace()

The following examples show how to use javax.naming.ConfigurationException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NetscalerElement.java    From cloudstack with Apache License 2.0 6 votes vote down vote up
@Override
public boolean shutdown(Network guestConfig, ReservationContext context, boolean cleanup)
        throws ResourceUnavailableException, ConcurrentOperationException {
    if (!canHandle(guestConfig, Service.Lb)) {
        return false;
    }

    try {

        NetworkOffering networkOffering = _networkOfferingDao.findById(guestConfig.getNetworkOfferingId());
        if (networkOffering.getServicePackage() == null) {
            return manageGuestNetworkWithExternalLoadBalancer(true, guestConfig);
        } else {
            // if the network offering has service package implement it with Netscaler Control Center
            return manageGuestNetworkWithNetscalerControlCenter(false, guestConfig, networkOffering);
        }
    } catch (InsufficientCapacityException capacityException) {
        // TODO: handle out of capacity exception gracefully in case of
        // multple providers available
        return false;
    } catch (ConfigurationException e) {
        e.printStackTrace();
    }
    return false;
}
 
Example 2
Source File: ResourceMetaDataManagerTest.java    From cosmic with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    MockitoAnnotations.initMocks(this);

    try {
        _resourceMetaDataMgr.configure(null, null);
    } catch (final ConfigurationException e) {
        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
    }
    _resourceMetaDataMgr._volumeDetailDao = _volumeDetailDao;
    _resourceMetaDataMgr._taggedResourceMgr = _taggedResourceMgr;
    _resourceMetaDataMgr._nicDetailDao = _nicDetailDao;
}
 
Example 3
Source File: MockLocalNfsSecondaryStorageResource.java    From cloudstack with Apache License 2.0 5 votes vote down vote up
public MockLocalNfsSecondaryStorageResource() {
    _dlMgr = new DownloadManagerImpl();
    _storage = new JavaStorageLayer();
    HashMap<String, Object> params = new HashMap<String, Object>();
    params.put(StorageLayer.InstanceConfigKey, _storage);
    try {
        _dlMgr.configure("downloadMgr", params);
    } catch (ConfigurationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    createTemplateFromSnapshotXenScript = Script.findScript(getDefaultScriptsDir(), "create_privatetemplate_from_snapshot_xen.sh");

}
 
Example 4
Source File: ResourceMetaDataManagerTest.java    From cloudstack with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    MockitoAnnotations.initMocks(this);

    try {
        _resourceMetaDataMgr.configure(null, null);
    } catch (ConfigurationException e) {
        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
    }
    _resourceMetaDataMgr._volumeDetailDao = _volumeDetailDao;
    _resourceMetaDataMgr._taggedResourceMgr = _taggedResourceMgr;
    _resourceMetaDataMgr._nicDetailDao = _nicDetailDao;

}
 
Example 5
Source File: VirtualRoutingResourceTest.java    From cloudstack with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {
    _resource = new VirtualRoutingResource(this);
    try {
        _resource.configure("VRResource", new HashMap<String, Object>());
    } catch (final ConfigurationException e) {
        e.printStackTrace();
    }
}