Code example for CacheException

0
                config = ConfigLoader.load(configResourcePath);
            } catch (IOException e) {
                LOGGER.warning("IOException: " + e.getMessage());
            } 
            if (config == null) {
                throw new CacheException("Could not find configuration file: " + configResourcePath);
            } 
        } 
        if (instanceName != null) {
            instance = Hazelcast.getHazelcastInstanceByName(instanceName);
            if (instance == null) {
                try { 
                    createOrGetInstance(); 
                } catch (DuplicateInstanceNameException ignored) {
                    instance = Hazelcast.getHazelcastInstanceByName(instanceName);
                } 
            } 
        } else { 
            createOrGetInstance(); 
        } 
Contextual code suggestions in your IDE  Get Codota for Java