Package javax.naming

Examples of javax.naming.NamingException.initCause()


                    infosClassLoader.put(Thread.currentThread().getContextClassLoader(), info);
                }

            } catch (Exception e) {
                NamingException ne = new NamingException("Cannot get a remote ClassLoader");
                ne.initCause(e);
                throw ne;
            }
        }

        return info;
View Full Code Here


        if (urlString != null) {
            try {
                url = new URL(urlString);
            } catch (MalformedURLException e) {
                NamingException ne = new NamingException("Cannot build an URL with the given string '" + urlString + "'");
                ne.initCause(e);
                throw ne;
            }
        } else {
            throw new NamingException("Can not build an object as no URL was given.");
        }
View Full Code Here

        if (refAddr != null) {
            try {
                obj = (T) Serialization.loadObject((byte[]) refAddr.getContent());
            } catch (IOException e) {
                NamingException ne = new NamingException("Cannot load mail session properties object");
                ne.initCause(e);
                throw ne;
            } catch (ClassNotFoundException e) {
                NamingException ne = new NamingException("Cannot load mail session properties object");
                ne.initCause(e);
                throw ne;
View Full Code Here

                NamingException ne = new NamingException("Cannot load mail session properties object");
                ne.initCause(e);
                throw ne;
            } catch (ClassNotFoundException e) {
                NamingException ne = new NamingException("Cannot load mail session properties object");
                ne.initCause(e);
                throw ne;
            }
        }
        return obj;
    }
View Full Code Here

    public void putObject(final Reference reference, final String propertyName, final Serializable o) throws NamingException {
        try {
            reference.add(new BinaryRefAddr(propertyName, Serialization.storeObject(o)));
        } catch (IOException e) {
            NamingException ne = new NamingException("Cannot get bytes from the to recipients object");
            ne.initCause(e);
            throw ne;
        }
    }

    /**
 
View Full Code Here

      return _proxyFactory.create(url);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      NamingException exn = new NamingException(e.toString());
      exn.initCause(e);
      throw exn;
    }
  }
}
View Full Code Here

      return _proxyFactory.create(name);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      NamingException exn = new NamingException(e.toString());
      exn.initCause(e);
      throw exn;
    }
  }

  /**
 
View Full Code Here

    try {
      return Jmx.find(Jmx.getObjectName(name));
    } catch (MalformedObjectNameException e) {
      NamingException ne = new NamingException(e.getMessage());
      ne.initCause(e);
      throw ne;
    }
  }

  /**
 
View Full Code Here

            if (services != null) {
                ref = services[0];
            }
        } catch (InvalidSyntaxException e1) {
            NamingException e = new NamingException("Argh this should never happen :)");
            e.initCause(e1);
            throw e;
        }

        Context ctx = null;
       
View Full Code Here

            ObjectFactory factory = (ObjectFactory) context.getService(ref);
            try {
                return (Context) factory.getObjectInstance(null, null, null, env);
            } catch (Exception e) {
                NamingException e2 = new NamingException();
                e2.initCause(e);
                throw e2;
            } finally {
                if (ref != null) {
                    context.ungetService(ref);
                }
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.