Package javax.ejb

Examples of javax.ejb.ObjectNotFoundException


                } else {
                    return proxies;
                }
            } else {
                if (results.size() != 1) {
                    throw new ObjectNotFoundException("A Enteprise bean with deployment_id = " + beanContext.getDeploymentID() + " and primarykey = " + args[0] + " Does not exist");
                }

                // create a new ProxyInfo based on the deployment info and primary key
                EntityBean bean = (EntityBean) results.get(0);
                if (bean == null) {
View Full Code Here


                return proxies;
            }

            // single valued query that returned no rows, is an exception
            if (proxies.isEmpty()) {
                throw new ObjectNotFoundException();
            }

            // return the single item.... multiple return values was handled in for loop above
            Object returnValue = proxies.iterator().next();
            return returnValue;
View Full Code Here

                if (isRevoked) {
                    throw new UserCertificateRevokedException(certs[0]);
                }
                username = certificateStoreSession.findUsernameByCertSerno(administrator, certs[0].getSerialNumber(), certs[0].getIssuerX500Principal().toString());
                if ( username==null || username.length()==0 ) {
                    throw new ObjectNotFoundException("Not possible to retrieve user name");
                }
            }
            log.debug("Got request for " + username + ".");
            debug.print("<h3>username: " + username + "</h3>");
           
            final UserDataVO data = userAdminSession.findUser(administrator, username);
            final X509Certificate notRevokedCerts[]; {
                Set<X509Certificate> set = new HashSet<X509Certificate>();
                for( Iterator<java.security.cert.Certificate> i = certificateStoreSession.findCertificatesByUsername(administrator, username).iterator(); i.hasNext(); ) {
                    Object o = i.next();
                    if ( o instanceof X509Certificate ) {
                        X509Certificate cert = (X509Certificate)o;
                        boolean isRevoked = certificateStoreSession.isRevoked(cert.getIssuerDN().getName(), cert.getSerialNumber());
                        if (!isRevoked) {
                            set.add(cert);
                        }
                    }
                }
                notRevokedCerts = (X509Certificate[])set.toArray(new X509Certificate[0]);
            }
            if (data == null) {
                throw new ObjectNotFoundException();
            }
            final String authReq = request.getParameter("authpkcs10");
            final String signReq = request.getParameter("signpkcs10");
           
            if ( authReq!=null && signReq!=null ) {
View Full Code Here

      usekeyrecovery = globalConfigurationSession.getCachedGlobalConfiguration(administrator).getEnableKeyRecovery();

      UserDataVO data = userAdminSession.findUser(administrator, username);

      if (data == null) {
        throw new ObjectNotFoundException();
      }

      boolean savekeys = data.getKeyRecoverable() && usekeyrecovery &&  (data.getStatus() != UserDataConstants.STATUS_KEYRECOVERY);
      boolean loadkeys = (data.getStatus() == UserDataConstants.STATUS_KEYRECOVERY) && usekeyrecovery;
View Full Code Here

      if (isrevoked) {
        request.setAttribute("errorMessage", "User certificate with serial number "+certificate.getSerialNumber() + " from issuer \'"+certificate.getIssuerX500Principal()+"\' is revoked.");
      } else {
        String username = certificateStoreSession.findUsernameByCertSerno(admin, certificate.getSerialNumber(), certificate.getIssuerX500Principal().toString());
        if (username==null || username.length()==0) {
          throw new ServletException(new ObjectNotFoundException("Not possible to retrieve user name"));
        }
        request.setAttribute("username", username);
        if(log.isDebugEnabled()) {
          log.debug("User authenticated as " + username + ".");
        }
View Full Code Here

          ps = con.prepareStatement("select id from " + "\""+"Ship"+"\""+ " where id = ?");
          ps.setInt(1, primaryKey.intValue());
          result = ps.executeQuery();
          // Does ship id exist in database?
          if (!result.next()) {
            throw new ObjectNotFoundException("Cannot find Ship with id = "+id);
          }
        } catch (SQLException se) {
            throw new EJBException(se);
        }
        finally {
View Full Code Here

            cleanUserCertDataSN(statusadmin, data.getUsername());
        } catch (FinderException e) {
            String msg = intres.getLocalizedMessage("authentication.usernotfound", data.getUsername());
            logSession.log(statusadmin, statusadmin.getCaId(), LogConstants.MODULE_CA, new Date(), data.getUsername(), null,
                    LogConstants.EVENT_INFO_USERAUTHENTICATION, msg);
            throw new ObjectNotFoundException(e.getMessage());
        } catch (AuthorizationDeniedException e) {
            // Should never happen
            log.error("AuthorizationDeniedException: ", e);
            throw new EJBException(e);
        } catch (ApprovalException e) {
View Full Code Here

      }
        try {
            // Find the user with username username, or throw FinderException
            final UserData data = UserData.findByUsername(entityManager, username);
            if (data == null) {
              throw new ObjectNotFoundException("Could not find username " + username);
            }
            // Decrease the remaining login attempts. When zero, the status is set to STATUS_GENERATED
             userAdminSession.decRemainingLoginAttempts(admin, username);
             final int status = data.getStatus();
            if ( (status == UserDataConstants.STATUS_NEW) || (status == UserDataConstants.STATUS_FAILED) || (status == UserDataConstants.STATUS_INPROCESS) || (status == UserDataConstants.STATUS_KEYRECOVERY)) {
View Full Code Here

        log.trace("<finishUser("+data.getUsername()+", hiddenpwd)");
      }
    } catch (FinderException e) {
      String msg = intres.getLocalizedMessage("authentication.usernotfound", data.getUsername());
      logSession.log(statusadmin, statusadmin.getCaId(), LogConstants.MODULE_CA, new java.util.Date(), data.getUsername(), null, LogConstants.EVENT_ERROR_USERAUTHENTICATION,msg);
      throw new ObjectNotFoundException(e.getMessage());
    } catch (AuthorizationDeniedException e) {
      // Should never happen
      log.error("AuthorizationDeniedException: ", e);
      throw new EJBException(e);
    } catch (ApprovalException e) {
View Full Code Here

      result = selectByPrimaryKey(primaryKey);
  } catch (SQLException ex) {
      throw new EJBException(ex);
  }
  if (!result) {
      throw new ObjectNotFoundException
    ("Row for id " + primaryKey + " not found.");
  }
  return primaryKey;
    }
View Full Code Here

TOP

Related Classes of javax.ejb.ObjectNotFoundException

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.