Package javax.naming

Examples of javax.naming.ConfigurationException


        }

        private void check(){
            if (child == null){
                if (exception instanceof ConfigurationException) {
                    ConfigurationException e = (ConfigurationException) exception;
                    child = e.getRootCause();
                } else if (exception instanceof SQLException) {
                    SQLException e = (SQLException) exception;
                    child = e.getNextException();
                }
                if (child == null) {
                  child = exception.getCause();
                }
                if (child == exception) {
View Full Code Here


    assertEquals("problemproblemnull", ExceptionUtil.getLinkedMessages(e)); //$NON-NLS-1$
    }

    public void testConfigurationException() {
        NullPointerException npe = new NullPointerException("problem1"); //$NON-NLS-1$
        ConfigurationException configException = new ConfigurationException("problem2"); //$NON-NLS-1$
        configException.setRootCause(npe);
        TeiidException e = new TeiidException(configException, "problem3"); //$NON-NLS-1$
        assertEquals("TeiidException-problem3->ConfigurationException-problem2->NullPointerException-problem1", ExceptionUtil.getLinkedMessagesVerbose(e)); //$NON-NLS-1$
    assertEquals("problem3problem2problem1", ExceptionUtil.getLinkedMessages(e)); //$NON-NLS-1$
    }
View Full Code Here

        DirectoryService service = ( DirectoryService ) env.get( DirectoryService.JNDI_KEY );

        if ( service == null )
        {
            throw new ConfigurationException( I18n.err( I18n.ERR_477, env ) );
        }

        if ( ! service.isStarted() )
        {
            return new DeadContext();
View Full Code Here

        }
        catch (URLSyntaxException urlse)
        {
            _logger.warn("Unable to create factory:" + urlse);

            ConfigurationException ex = new ConfigurationException("Failed to parse entry: " + urlse + " due to : " +  urlse.getMessage());
            ex.initCause(urlse);
            throw ex;
        }
    }
View Full Code Here

        }
        catch (Exception e)
        {
            _logger.warn("Unable to create destination:" + e, e);

            ConfigurationException ex = new ConfigurationException("Failed to parse entry: " + str + " due to : " +  e.getMessage());
            ex.initCause(e);
            throw ex;
        }
    }
View Full Code Here

        DirectoryService service = ( DirectoryService ) env.get( DirectoryService.JNDI_KEY );

        if ( service == null )
        {
            throw new ConfigurationException( I18n.err( I18n.ERR_477, env ) );
        }

        if ( !service.isStarted() )
        {
            return new DeadContext();
View Full Code Here

        URI location;
        try {
            providerUrl = addMissingParts(providerUrl);
            location = new URI(providerUrl);
        } catch (URISyntaxException e) {
            throw (ConfigurationException) new ConfigurationException("Property value for " + Context.PROVIDER_URL + " invalid: " + providerUrl + " - " + e.getMessage()).initCause(e);
        }
        this.server = new ServerMetaData(location);
        //TODO:1: Either aggressively initiate authentication or wait for the
        //        server to send us an authentication challange.
        if (userID != null) {
View Full Code Here

        final URI location;
        try {
            providerUrl = addMissingParts(providerUrl);
            location = new URI(providerUrl);
        } catch (URISyntaxException e) {
            throw (ConfigurationException) new ConfigurationException("Property value for " + Context.PROVIDER_URL + " invalid: " + providerUrl + " - " + e.getMessage()).initCause(e);
        }
        this.server = new ServerMetaData(location);

        final Client.Context context = Client.getContext(this.server);
        context.getProperties().putAll(environment);
View Full Code Here

            stub = toStubMethod.invoke(null, new java.lang.Object[]{remoteObj});

        } catch (InvocationTargetException e) {
            Throwable realException = e.getTargetException();
            // realException.printStackTrace();
            ConfigurationException ce = JacORBMessages.MESSAGES.problemInvokingPortableRemoteObjectToStub();
            ce.setRootCause(realException);
            throw ce;
        } catch (IllegalAccessException e) {
            ConfigurationException ce = JacORBMessages.MESSAGES.cannotInvokePortableRemoteObjectToStub();
            ce.setRootCause(e);
            throw ce;
        }

// Next, make sure that the stub is javax.rmi.CORBA.Stub

        if (!corbaStubClass.isInstance(stub)) {
            return null// JRMP implementation or JRMP stub
        }

// Next, make sure that the stub is connected
        // Invoke stub.connect(orb)
        try {
            connectMethod.invoke(stub, new java.lang.Object[]{orb});

        } catch (InvocationTargetException e) {
            Throwable realException = e.getTargetException();
            // realException.printStackTrace();

            if (!(realException instanceof java.rmi.RemoteException)) {
                ConfigurationException ce = JacORBMessages.MESSAGES.problemInvokingStubConnect();
                ce.setRootCause(realException);
                throw ce;
            }
            // ignore RemoteException because stub might have already
            // been connected
        } catch (IllegalAccessException e) {
            ConfigurationException ce = JacORBMessages.MESSAGES.cannotInvokeStubConnect();
            ce.setRootCause(e);
            throw ce;
        }
// Finally, return stub
        return (org.omg.CORBA.Object) stub;
    }
View Full Code Here

                throw savedException;
            } else {
                throw JacORBMessages.MESSAGES.invalidURLOrIOR(url);
            }
        } catch (MalformedURLException e) {
            throw new ConfigurationException(e.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of javax.naming.ConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.