Example usage for java.lang.reflect UndeclaredThrowableException UndeclaredThrowableException

List of usage examples for java.lang.reflect UndeclaredThrowableException UndeclaredThrowableException

Introduction

In this page you can find the example usage for java.lang.reflect UndeclaredThrowableException UndeclaredThrowableException.

Prototype

public UndeclaredThrowableException(Throwable undeclaredThrowable) 

Source Link

Document

Constructs an UndeclaredThrowableException with the specified Throwable .

Usage

From source file:org.freebxml.omar.server.cache.AbstractCache.java

protected AbstractCache() {
    primeCacheEvent = RegistryProperties.getInstance().getProperty("omar.server.cache.primeCacheEvent",
            "onCacheInit");

    if (cacheMgr == null) {
        try {//from  w  w w  .j  av  a  2 s  .co m
            cacheMgr = CacheManager.getInstance();
        } catch (CacheException e) {
            throw new UndeclaredThrowableException(e);
        }
    }
}

From source file:org.forgerock.openidm.provisioner.Id.java

public Id(String systemName, String objectType) throws JsonResourceException {
    if (StringUtils.isBlank(systemName)) {
        throw new JsonResourceException(400, "System name can not be blank");
    }/*from  w w  w.  ja  v  a  2 s  . c o  m*/
    if (StringUtils.isBlank(objectType)) {
        throw new JsonResourceException(400, "Object type can not be blank");
    }
    try {
        this.baseURI = new URI("");
        this.systemName = URLDecoder.decode(systemName, CHARACTER_ENCODING_UTF_8);
        this.objectType = URLDecoder.decode(objectType, CHARACTER_ENCODING_UTF_8);
    } catch (URISyntaxException e) {
        // Should never happen.
        throw new UndeclaredThrowableException(e);
    } catch (UnsupportedEncodingException e) {
        // Should never happen.
        throw new UndeclaredThrowableException(e);
    }

}

From source file:org.apache.nifi.dbcp.hive.Hive3ConnectionPoolTest.java

@Before
public void setup() throws Exception {
    // have to initialize this system property before anything else
    System.setProperty("java.security.krb5.conf", krb5conf.getAbsolutePath());
    System.setProperty("java.security.krb5.realm", "nifi.com");
    System.setProperty("java.security.krb5.kdc", "nifi.kdc");

    userGroupInformation = mock(UserGroupInformation.class);
    basicDataSource = mock(BasicDataSource.class);
    componentLog = mock(ComponentLog.class);
    kerberosProperties = mock(KerberosProperties.class);

    when(userGroupInformation.doAs(isA(PrivilegedExceptionAction.class))).thenAnswer(invocation -> {
        try {/*  w  w w .j a  v a  2 s. co  m*/
            return ((PrivilegedExceptionAction) invocation.getArguments()[0]).run();
        } catch (IOException | Error | RuntimeException | InterruptedException e) {
            throw e;
        } catch (Throwable e) {
            throw new UndeclaredThrowableException(e);
        }
    });

    when(kerberosProperties.getKerberosKeytab()).thenReturn(new PropertyDescriptor.Builder()
            .name("Kerberos Principal").addValidator(StandardValidators.ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR)
            .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY).build());

    when(kerberosProperties.getKerberosPrincipal()).thenReturn(new PropertyDescriptor.Builder()
            .name("Kerberos Keytab").addValidator(StandardValidators.ATTRIBUTE_EXPRESSION_LANGUAGE_VALIDATOR)
            .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY).build());

    initPool();
}

From source file:org.openeos.services.ui.internal.UIDAOServiceImpl.java

@Override
public UIBean create(Class<?> persistentClass, UIContext context) {
    try {//  www. j  a v a  2  s.c o m
        Object newObject = persistentClass.newInstance();
        establishDefaultValues(newObject, context, dictionaryService.getClassDefinition(persistentClass));
        return new UIBeanImpl(newObject, dictionaryService.getClassDefinition(persistentClass));
    } catch (InstantiationException e) {
        //TODO Change to UIException
        throw new UndeclaredThrowableException(e);
    } catch (IllegalAccessException e) {
        //TODO Change to UIException
        throw new UndeclaredThrowableException(e);
    }
}

From source file:org.openrdf.repository.sparql.query.BackgroundGraphResult.java

public Map<String, String> getNamespaces() {
    try {//w  w  w  . j a va 2 s  .co m
        namespacesReady.await();
        return namespaces;
    } catch (InterruptedException e) {
        throw new UndeclaredThrowableException(e);
    }
}

From source file:com.bigdata.rdf.sail.webapp.client.BackgroundGraphResult.java

@Override
public Map<String, String> getNamespaces() {
    try {/*from ww  w. j av a 2s .  c  om*/
        namespacesReady.await();
        return namespaces;
    } catch (InterruptedException e) {
        throw new UndeclaredThrowableException(e);
    }
}

From source file:org.forgerock.openidm.provisioner.Id.java

public Id(String systemName, String objectType, String localId) throws JsonResourceException {
    if (StringUtils.isBlank(systemName)) {
        throw new JsonResourceException(400, "System name can not be blank");
    }/*from  w  ww. ja  v a2  s.  c  o  m*/
    if (StringUtils.isBlank(objectType)) {
        throw new JsonResourceException(400, "Object type can not be blank");
    }
    if (StringUtils.isBlank(localId)) {
        throw new JsonResourceException(400, "Object id can not be blank");
    }
    try {
        this.baseURI = new URI("");
        this.systemName = URLDecoder.decode(systemName, CHARACTER_ENCODING_UTF_8);
        this.objectType = URLDecoder.decode(objectType, CHARACTER_ENCODING_UTF_8);
        this.localId = URLDecoder.decode(localId, CHARACTER_ENCODING_UTF_8);
    } catch (URISyntaxException e) {
        // Should never happen.
        throw new UndeclaredThrowableException(e);
    } catch (UnsupportedEncodingException e) {
        // Should never happen.
        throw new UndeclaredThrowableException(e);
    }
}

From source file:it.cnr.icar.eric.server.cache.AbstractCache.java

protected AbstractCache() {
    primeCacheEvent = RegistryProperties.getInstance().getProperty("eric.server.cache.primeCacheEvent",
            "onCacheInit");

    if (cacheMgr == null) {
        try {/*  w  w  w.  j  av  a 2  s .c o  m*/
            cacheMgr = CacheManager.getInstance();
        } catch (CacheException e) {
            throw new UndeclaredThrowableException(e);
        }
    }
}

From source file:com.ibm.jaql.lang.expr.xml.XmlToJsonFn.java

@Override
public void startElement(String uri, String localName, String name, Attributes attrs) throws SAXException {
    try {/*from   w  w  w. j  a va  2 s .c o m*/
        SpilledJsonArray ca = new SpilledJsonArray();
        int n = attrs.getLength();
        for (int i = 0; i < n; i++) {
            name = "@" + attrs.getLocalName(i);
            uri = attrs.getURI(i);
            String v = attrs.getValue(i);
            BufferedJsonRecord r = new BufferedJsonRecord();
            if (uri != null && uri.length() > 0) {
                r.add(S_XMLNS, new JsonString(uri));
            }
            r.add(new JsonString(name), new JsonString(v));
            ca.addCopy(r);
        }
        stack.push(ca);
    } catch (IOException e) {
        throw new UndeclaredThrowableException(e);
    }
}

From source file:it.cnr.icar.eric.server.security.authorization.RegistryPolicyFinderModule.java

public RegistryPolicyFinderModule() {
    try {//from  www.  j a v  a 2 s  .  c o  m
        requestContext = new ServerRequestContext("RegistryPolicyFinderModule:findPolicy", null);
        requestContext.setUser(AuthenticationServiceImpl.getInstance().registryOperator);
    } catch (RegistryException e) {
        log.error(e, e);
        throw new UndeclaredThrowableException(e);
    }
}