Java 8 AccessException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AccessException class.

This code example shows how to use the following methods:printStackTrace
        } catch (AuthenticationException e) {
            // expected 
            e.printStackTrace(System.out);
        } catch (AccessException e) {
            // expected 
            e.printStackTrace(System.out);
        } 
    } 
         
    protected Hashtable getEnvironment() {
        Hashtable p = new Hashtable();
         
        p.put("java.naming.factory.initial", 
              "org.apache.openejb.client.RemoteInitialContextFactory"); 
        p.put("java.naming.provider.url", 
              "127.0.0.1:4201");   
         
        // XXXX: this should not be necessary 
        String realmName = getRealmName();
        if (realmName != null) {
4
CodeRank
This code example shows how to use the following methods:
This code example shows how to use the following methods:
    public void testRollbackRule2() throws Exception {
        testTx.addRollbackRule(RuntimeException.class);
        testTx.addRollbackRule(RemoteException.class);
        testTx.addCommitRule(Exception.class);
        try { 
            exBean.invoke(new AccessException(""));
            fail("1"); 
        } catch (Throwable expected) {
            System.out.println(expected);
        } 
        assertTrue(adapter.rollbackOnly);
    } 
 
    /** 
     * @throws Exception 
     */ 
    public void testRollbackRule3() throws Exception {
        testTx.addRollbackRule(RuntimeException.class);
        testTx.addRollbackRule(RemoteException.class);
        testTx.addCommitRule(Exception.class);
4
CodeRank
This code example shows how to use the following methods:
            return new EJBException(e.getMessage()).initCause(getCause(e));
        } 
 
        if (remote && e instanceof EJBAccessException) {
            if (e.getCause() instanceof Exception) {
                return new AccessException(e.getMessage(), (Exception) e.getCause());
            } else { 
                return new AccessException(e.getMessage());
            } 
        } 
        if (!remote && e instanceof EJBTransactionRolledbackException) {
            return new TransactionRolledbackLocalException(e.getMessage()).initCause(getCause(e));
        } 
        return e;
    } 
 
    protected static Throwable getCause(final Throwable e) {
        if (e != null && e.getCause() != null) {
            return e.getCause();
        } 
3
CodeRank
See Code Examples for Java 8 AccessException Methods: