Package javax.naming

Examples of javax.naming.NameNotFoundException


         rEntry.getWorkspaceEntries().get(0).getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);

      final DataSource ds = (DataSource)new InitialContext().lookup(dsName);
      if (ds == null)
      {
         throw new NameNotFoundException("Data source " + dsName + " not found");
      }

      Connection jdbcConn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
      {
         public Connection run() throws Exception
View Full Code Here


            }
         }
      }
      else if (obj == null)
      {
         throw new NameNotFoundException("No object has been binded with the name '" + name + "'");
      }
      return obj;
   }
View Full Code Here

      synchronized (getMutex())
      {
         Map<String, Object> tmpObjects = new HashMap<String, Object>(getBindings());
         if (tmpObjects.remove(name) == null)
         {
            throw new NameNotFoundException("No object has been binded with the name '" + name + "'");
         }
         setBindings(tmpObjects);
      }
   }
View Full Code Here

         {
            throw new NameAlreadyBoundException("An object has already been binded with the name '" + name2 + "'");
         }
         else if ((value = tmpObjects.remove(name1)) == null)
         {
            throw new NameNotFoundException("No object has been binded with the name '" + name1 + "'");
         }
         tmpObjects.put(name2, value);
         setBindings(tmpObjects);
      }
   }
View Full Code Here

            }
         }
      }
      else if (obj == null)
      {
         throw new NameNotFoundException("No object has been binded with the name '" + name + "'");
      }
      return obj;
   }
View Full Code Here

      synchronized (getMutex())
      {
         Map<String, Object> tmpObjects = new HashMap<String, Object>(getBindings());
         if (tmpObjects.remove(name) == null)
         {
            throw new NameNotFoundException("No object has been binded with the name '" + name + "'");
         }
         setBindings(tmpObjects);
      }
   }
View Full Code Here

         {
            throw new NameAlreadyBoundException("An object has already been binded with the name '" + name2 + "'");
         }
         else if ((value = tmpObjects.remove(name1)) == null)
         {
            throw new NameNotFoundException("No object has been binded with the name '" + name1 + "'");
         }
         tmpObjects.put(name2, value);
         setBindings(tmpObjects);
      }
   }
View Full Code Here

        if (e instanceof NotFound) {
            if (ctx.federation) {
                return tryFed((NotFound) e, ctx, inputName);

            } else {
                ne = new NameNotFoundException();
            }

        } else if (e instanceof CannotProceed) {

            ne = new CannotProceedException();
View Full Code Here

                    rest[0].kind != null &&
                    rest[0].kind.equals(lastIn.kind)) {
                // Might be legit
            } else {
                // Due to 1.2/1.3 bug that always returns single-item 'rest'
                NamingException ne = new NameNotFoundException();
                ne.setRemainingName(org.jboss.as.jacorb.naming.jndi.CNNameParser.cosNameToName(rest));
                ne.setRootCause(e);
                throw ne;
            }
        }
        // Fixed in 1.4; perform calculations based on correct (1.4) behavior

        // Calculate the components of the name that has been resolved
        NameComponent[] resolvedName = null;
        int len = 0;
        if (inputName != null && (inputName.length >= rest.length)) {

            if (e.why == NotFoundReason.not_context) {
                // First component of rest is found but not a context; keep it
                // as part of resolved name
                len = inputName.length - (rest.length - 1);

                // Remove resolved component from rest
                if (rest.length == 1) {
                    // No more remaining
                    rest = null;
                } else {
                    NameComponent[] tmp = new NameComponent[rest.length - 1];
                    System.arraycopy(rest, 1, tmp, 0, tmp.length);
                    rest = tmp;
                }
            } else {
                len = inputName.length - rest.length;
            }

            if (len > 0) {
                resolvedName = new NameComponent[len];
                System.arraycopy(inputName, 0, resolvedName, 0, len);
            }
        }

        // Create CPE and set common fields
        CannotProceedException cpe = new CannotProceedException();
        cpe.setRootCause(e);
        if (rest != null && rest.length > 0) {
            cpe.setRemainingName(org.jboss.as.jacorb.naming.jndi.CNNameParser.cosNameToName(rest));
        }
        cpe.setEnvironment(ctx._env);

        // Lookup resolved name to get resolved object
        final java.lang.Object resolvedObj =
                (resolvedName != null) ? ctx.callResolve(resolvedName) : ctx;

        if (resolvedObj instanceof javax.naming.Context) {
            // obj is a context and child is not found
            // try getting its nns dynamically by constructing
            // a Reference containing obj.
            RefAddr addr = new RefAddr("nns") {
                public java.lang.Object getContent() {
                    return resolvedObj;
                }

                private static final long serialVersionUID =
                        669984699392133792L;
            };
            Reference ref = new Reference("java.lang.Object", addr);

            // Resolved name has trailing slash to indicate nns
            CompositeName cname = new CompositeName();
            cname.add(""); // add trailing slash

            cpe.setResolvedObj(ref);
            cpe.setAltName(cname);
            cpe.setAltNameCtx((javax.naming.Context) resolvedObj);

            return cpe;
        } else {
            // Not a context, use object factory to transform object.

            Name cname = org.jboss.as.jacorb.naming.jndi.CNNameParser.cosNameToName(resolvedName);
            java.lang.Object resolvedObj2;
            try {
                resolvedObj2 = NamingManager.getObjectInstance(resolvedObj,
                        cname, ctx, ctx._env);
            } catch (NamingException ge) {
                throw ge;
            } catch (Exception ge) {
                NamingException ne = JacORBMessages.MESSAGES.errorGeneratingObjectViaFactory();
                ne.setRootCause(ge);
                throw ne;
            }

            // If a context, continue operation with context
            if (resolvedObj2 instanceof javax.naming.Context) {
View Full Code Here

                  if (LOG.isDebugEnabled())
                  {
                     LOG.debug("Nothing to remove, group " + group + " is not found.");
                  }

                  throw new NameNotFoundException("Nothing to remove, group " + group + " is not found.");
               }

               SearchResult sr = results.next();
               // NameParser parser = ctx.getNameParser("");
               // Name entryName = parser.parse(new
View Full Code Here

TOP

Related Classes of javax.naming.NameNotFoundException

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.