Examples of CreateException


Examples of javax.ejb.CreateException

      // Our bean has many customers, use the cmr set method here..
      Set customers = new HashSet();
      customers.add(custL);
      this.setCustomers(customers);
        } catch (RemoteException re) {
            throw new CreateException("Invalid Customer - Bad Remote Reference");
        } catch (FinderException fe) {
            throw new CreateException("Invalid Customer - Unable to Find Local Reference");
        } catch (NamingException ne) {
            throw new CreateException("Invalid Customer - Unable to find CustomerHomeLocal Reference");
        }
    }
View Full Code Here

Examples of javax.ejb.CreateException

        int capacity, double tonnage)
        throws CreateException {

    System.out.println("ejbCreate() pk="+id+" name="+name);
        if ((id.intValue() < 1) || (name == null))
           throw new CreateException("Invalid Parameters");
        this.id = id;
        this.name = name;
        this.capacity = capacity;
        this.tonnage = tonnage;
       
        Connection con = null;
        PreparedStatement ps = null;
        try {
          con = this.getConnection();
          System.out.println("Obtained Connection: Trying to create statement");

          ps = con.prepareStatement("insert into"+"\""+"Ship"+"\""+ " (id, name, capacity, tonnage) values (?,?,?,?)");
          ps.setInt(1, id.intValue());
          ps.setString(2, name);
          ps.setInt(3, capacity);
          ps.setDouble(4, tonnage);
          if (ps.executeUpdate() != 1) {
            throw new CreateException ("Failed to add Ship to database");
          }
           return id;
        }
        catch (SQLException se) {
            throw new EJBException (se);
View Full Code Here

Examples of javax.ejb.CreateException

      // Our bean has many customers, use the cmr set method here..
      Set customers = new HashSet();
      customers.add(custL);
      this.setCustomers(customers);
        } catch (RemoteException re) {
            throw new CreateException("Invalid Customer - Bad Remote Reference");
        } catch (FinderException fe) {
            throw new CreateException("Invalid Customer - Unable to Find Local Reference");
        } catch (NamingException ne) {
            throw new CreateException("Invalid Customer - Unable to find CustomerHomeLocal Reference");
        }
    }
View Full Code Here

Examples of javax.ejb.CreateException

            log.trace(">addQueueData(publisherId: " + publisherId + ")");
      }
      try {
          entityManager.persist(new org.ejbca.core.ejb.ca.publisher.PublisherQueueData(publisherId, publishType, fingerprint, queueData, publishStatus));
      } catch (Exception e) {
        throw new CreateException(e.getMessage());
      }
      log.trace("<addQueueData()");
    }
View Full Code Here

Examples of javax.ejb.CreateException

      final String issuerDN = data1.getIssuerDN();
        try {
          entityManager.persist(data1);
        } catch (Exception e) {
          // For backward compatibility. We should drop the throw entirely and rely on the return value.
          CreateException ce = new CreateException();
          ce.setStackTrace(e.getStackTrace());
          throw ce;
        }
        final String msg = intres.getLocalizedMessage("store.storecert");             
        logSession.log(admin, issuerDN.hashCode(), LogConstants.MODULE_CA, new Date(), username, incert, LogConstants.EVENT_INFO_STORECERTIFICATE, msg);
        log.trace("<storeCertificate()");
View Full Code Here

Examples of javax.ejb.CreateException

      ((ProcessDataStore)paProcessData).setMapId (processPk);
      ((ProcessDataStore)paProcessData).setNewMap ();
      return processPk;
  } catch (RemoteException ex) {
      logger.error (ex.getMessage(), ex);
      throw new CreateException(ex.getMessage());
  }
    }
View Full Code Here

Examples of javax.ejb.CreateException

      throw new EJBException(re);
  } catch (SQLException e) {
      throw new EJBException(e);
  } catch (IOException ioe) {
      logger.error (ioe.getMessage(), ioe);
      throw new CreateException (ioe.getMessage());
  }
    }
View Full Code Here

Examples of javax.ejb.CreateException

                  log.debug("Throwing MyAppException");
               throw new MyAppException(EntityExc.EXCEPTION_TEXT);
            case EntityExc.EXC_CREATEEXCEPTION:
               if (debug)
                  log.debug("Throwing CreateException");
               throw new CreateException(EntityExc.EXCEPTION_TEXT);
            case EntityExc.EXC_EJBEXCEPTION:
               if (debug)
                  log.debug("Throwing EJBException");
               wasDiscarded = true;
               throw new EJBException(EntityExc.EXCEPTION_TEXT);
View Full Code Here

Examples of javax.ejb.CreateException

      try
      {
         InitialContext ic = new InitialContext();
         Boolean failInEjbCreate = (Boolean) ic.lookup("java:comp/env/failInEjbCreate");
         if( failInEjbCreate.booleanValue() )
            throw new CreateException("Failed in ejbCreate as requested");
      }
      catch(NameNotFoundException ignore)
      {
         // Assume failInEjbCreate = false
      }
      catch(NamingException e)
      {
         throw new CreateException("Failed to access ENC, "+e.getMessage());
      }
   }
View Full Code Here

Examples of javax.ejb.CreateException

            c.close();
         }
      }
      catch (Exception e)
      {
         throw new CreateException("could not get DataSource or Connection" + e.getMessage());
      }
   }
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.