Package org.mc4j.ems.connection

Examples of org.mc4j.ems.connection.ConnectionException


            return context;
        } catch(NoInitialContextException e) {
            // Try to be more helpful, indicating the reason we couldn't make the connection in this
            // common case of missing libraries.
            if (e.getCause() instanceof ClassNotFoundException) {
                throw new ConnectionException("Necessary classes not found for remote connection, check installation path configuration.",e.getCause());
            }
            throw e;
        }
    }
View Full Code Here


            return context;
        } catch(NoInitialContextException e) {
            // Try to be more helpful, indicating the reason we couldn't make the connection in this
            // common case of missing libraries.
            if (e.getCause() instanceof ClassNotFoundException) {
                throw new ConnectionException("Necessary classes not found for remote connection, check installation path configuration.",e.getCause());
            }
            throw e;
        }
    }
View Full Code Here

            return context;
        } catch(NoInitialContextException e) {
            // Try to be more helpful, indicating the reason we couldn't make the connection in this
            // common case of missing libraries.
            if (e.getCause() instanceof ClassNotFoundException) {
                throw new ConnectionException("Necessary classes not found for remote connection, check installation path configuration.",e.getCause());
            }
            throw e;
        }
    }
View Full Code Here

                    props.put(Context.INITIAL_CONTEXT_FACTORY, connectionSettings.getInitialContextName());
                    Class simplePrincipalClass = Class.forName("org.jboss.security.SimplePrincipal");
                    Principal p = (Principal) simplePrincipalClass.getConstructor(String.class).newInstance(connectionSettings.getPrincipal());
                    SetPrincipalInfoAction.setPrincipalInfo(p,connectionSettings.getCredentials());
                } catch (ClassNotFoundException e1) {
                    throw new ConnectionException("Secured connection not available with this version of JBoss " + e1.toString(),e1);
                } catch (Exception e1) {
                    throw new ConnectionException("Unable to make secured connection to JBoss due to missing or unexpected security classes",e1);
                }
            }

        } else {
            props.put(Context.INITIAL_CONTEXT_FACTORY, connectionSettings.getInitialContextName());
        }

        props.put(Context.PROVIDER_URL, connectionSettings.getServerUrl());

        try {
            InitialContext context = new InitialContext(props);
            return context;
        } catch(NoInitialContextException e) {
            // Try to be more helpful, indicating the reason we couldn't make the connection in this
            // common case of missing libraries
            if (e.getCause() instanceof ClassNotFoundException) {
                throw new ConnectionException("Necessary classes not found for remote connection, check installation path configuration.",e.getCause());
            }
            throw e;
        }
    }
View Full Code Here

                log.debug("JNDI Login Context Factory not available, directly utilizing SecurityAssociation");
                try {
                    props.put(Context.INITIAL_CONTEXT_FACTORY, connectionSettings.getInitialContextName());
                    resetPrincipalInfo();
                } catch (ClassNotFoundException e1) {
                    throw new ConnectionException("Secured connection not available with this version of JBoss " + e1.toString(),e1);
                } catch (Exception e1) {
                    throw new ConnectionException("Unable to make secured connection to JBoss due to missing or unexpected security classes",e1);
                }
            }

        } else {
            props.put(Context.INITIAL_CONTEXT_FACTORY, connectionSettings.getInitialContextName());
        }

        props.put(Context.PROVIDER_URL, connectionSettings.getServerUrl());

        try {
            InitialContext context = new InitialContext(props);
            return context;
        } catch(NoInitialContextException e) {
            // Try to be more helpful, indicating the reason we couldn't make the connection in this
            // common case of missing libraries
            if (e.getCause() instanceof ClassNotFoundException) {
                throw new ConnectionException("Necessary classes not found for remote connection, check installation path configuration.",e.getCause());
            }
            throw e;
        }
    }
View Full Code Here

TOP

Related Classes of org.mc4j.ems.connection.ConnectionException

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.