Package javax.naming

Examples of javax.naming.NamingException.initCause()


                            return ((Context) factory.getObjectInstance(null, name, this, getEnvironment())).lookup(name);
                        }catch(NamingException e) {
                            throw e;
                        } catch (Exception e) {
                            NamingException n = new NamingException(e.getMessage());
                            n.initCause(e);
                            throw n;
                        }
                    }
                }
            }
View Full Code Here


     * @param cause the exception cause, or {@code null} for none
     * @return the exception
     */
    public static NamingException namingException(final String message, final Throwable cause) {
        final NamingException exception = new NamingException(message);
        if (cause != null) exception.initCause(cause);
        return exception;
    }

    /**
     * Return a general naming exception with a root cause and a remaining name field.
View Full Code Here

        if (object instanceof ManagedReferenceFactory) {
            try {
                return ManagedReferenceFactory.class.cast(object).getReference().getInstance();
            } catch (Exception e) {
                NamingException n = new NamingException(e.getMessage());
                n.initCause(e);
                throw n;
            }
        }
        return object;
    }
View Full Code Here

                is.close();
            }
        } catch (IOException e) {
            NamingException ne = new NamingException
                (sm.getString("resources.bindFailed", e));
            ne.initCause(e);
            throw ne;
        }

    }
View Full Code Here

                ctx.lookup(new CompositeName(entry.name));
            } catch (NamingException e) {
                throw e;
            } catch (Exception e) {
                NamingException ne = new NamingException(e.getMessage());
                ne.initCause(e);
                throw ne;
            }
        }
       
        return new Binding(entry.name, entry.value.getClass().getName(),
View Full Code Here

                is.close();
            }
        } catch (IOException e) {
            NamingException ne = new NamingException
                    (sm.getString("resources.bindFailed", e));
            ne.initCause(e);
            throw ne;
        }

    }
View Full Code Here

                    try {
                        factoryClass = tcl.loadClass(factoryClassName);
                    } catch(ClassNotFoundException e) {
                        NamingException ex = new NamingException
                            ("Could not load resource factory class");
                        ex.initCause(e);
                        throw ex;
                    }
                } else {
                    try {
                        factoryClass = Class.forName(factoryClassName);
View Full Code Here

                    try {
                        factoryClass = Class.forName(factoryClassName);
                    } catch(ClassNotFoundException e) {
                        NamingException ex = new NamingException
                            ("Could not load resource factory class");
                        ex.initCause(e);
                        throw ex;
                    }
                }
                if (factoryClass != null) {
                    try {
View Full Code Here

                    } catch (Throwable t) {
                        if (t instanceof NamingException)
                            throw (NamingException) t;
                        NamingException ex = new NamingException
                            ("Could not create resource factory instance");
                        ex.initCause(t);
                        throw ex;
                    }
                }
            } else {
                if (ref.getClassName().equals("javax.sql.DataSource")) {
View Full Code Here

                            Class.forName(javaxSqlDataSourceFactoryClassName)
                            .newInstance();
                    } catch (Throwable t) {
                        NamingException ex = new NamingException
                            ("Could not create resource factory instance");
                        ex.initCause(t);
                        throw ex;
                    }
                } else if (ref.getClassName().equals("javax.mail.Session")) {
                    String javaxMailSessionFactoryClassName =
                        System.getProperty("javax.mail.Session.Factory",
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.