Package javax.naming

Examples of javax.naming.NamingException


    VFSItem file = resolveFile(name);
    if (file != null) throw new NameAlreadyBoundException(smgr.getString("resources.alreadyBound", name));
   
    int lastSlash = name.lastIndexOf('/');
    if (lastSlash == -1) throw new NamingException();
    String parent = name.substring(0, lastSlash);
    VFSItem folder = resolveFile(parent);
    if (folder == null || (!(folder instanceof VFSContainer)))
      throw new NamingException(smgr.getString("resources.bindFailed", name));
    String newName = name.substring(lastSlash + 1);
    VFSItem childContainer = ((VFSContainer)folder).createChildContainer(newName);
    if (childContainer == null)
      throw new NamingException(smgr.getString("resources.bindFailed", name));
    return (DirContext)lookup(name);

  }
View Full Code Here


         }
         throw e;
      }
      catch (java.rmi.RemoteException e)
      {
         NamingException ne = new NamingException("unknown remote exception");
         ne.setRootCause(e);
         if( trace )
         {
            log.trace("lookupLocally failed, name=" + name, e);
         }
         throw ne;
View Full Code Here

                  }
               }
            }
         );
         if (clientName == null)
            throw new NamingException("Failed to find j2ee.clientName in jndi env");
      }

      Object result = null;

      if (nameCtx == null)
View Full Code Here

            if (name.size() == 2 && "ORB".equals(name.get(1)))
               return ORBFactory.getORB();
            else if (name.size() == 2 && "HandleDelegate".equals(name.get(1)))
               return HandleDelegateFactory.getHandleDelegateSingleton();
         }
         throw new NamingException("Name not found " + name);
      }
View Full Code Here

    public Object lookup(Name name) throws NamingException {
        if (name.isEmpty())
            return this;
        VirtualFile entry = treeLookup(name);
        if (entry == null)
            throw new NamingException(sm.getString("resources.notFound", name));

        if (entry.isDirectory()) {
            return new VFSDirContext(entry);
        } else {
            return new VFSResource(entry);
View Full Code Here

        if (name.isEmpty()) {
            return new NamingContextEnumeration(list(base).iterator());
        }
        VirtualFile entry = treeLookup(name);
        if (entry == null)
            throw new NamingException(sm.getString("resources.notFound", name));

        return new NamingContextEnumeration(list(entry).iterator());
    }
View Full Code Here

        if (name.isEmpty()) {
            return new NamingContextBindingsEnumeration(list(base).iterator(), this);
        }
        VirtualFile entry = treeLookup(name);
        if (entry == null)
            throw new NamingException(sm.getString("resources.notFound", name));

        return new NamingContextBindingsEnumeration(list(entry).iterator(), this);
    }
View Full Code Here

            entry = base;
        } else {
            entry = treeLookup(name);
        }
        if (entry == null)
            throw new NamingException(sm.getString("resources.notFound", name));

        ResourceAttributes attrs = new ResourceAttributes();
        attrs.setCreationDate(new Date(entry.getLastModified()));
        attrs.setName(entry.getName());
        if (entry.isFile())
View Full Code Here

   private void testEjbRefs(Context initCtx, Context myEnv) throws NamingException
   {
      //do lookup on bean specified without ejb-link
      Object ejb = initCtx.lookup("ejb/bean3");
      if ((ejb instanceof StatelessSessionHome) == false)
         throw new NamingException("ejb/bean3 is not a StatelessSessionHome");
      log.debug("ejb/bean3 = " + ejb);


      ejb = initCtx.lookup("java:comp/env/ejb/CtsBmp");
      if ((ejb instanceof EntityHome) == false)
         throw new NamingException("ejb/CtsBmp is not a EntityHome");

      //lookup of local-ejb-ref bean specified without ejb-link
      ejb = initCtx.lookup("java:comp/env/ejb/local/bean3");
      if ((ejb instanceof StatelessSessionLocalHome) == false)
         throw new NamingException("ejb/local/bean3 is not a StatelessSessionLocalHome");
      log.debug("ejb/local/bean3 = " + ejb);
   }
View Full Code Here

      URL home1 = (URL) myEnv.lookup("url/JBossHome");
      log.debug("url/JBossHome = " + home1);
      URL home2 = (URL) initCtx.lookup("java:comp/env/url/JBossHome");
      log.debug("url/JBossHome = " + home2);
      if( home1.equals(home2) == false )
         throw new NamingException("url/JBossHome != java:comp/env/url/JBossHome");
   }
View Full Code Here

TOP

Related Classes of javax.naming.NamingException

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.