Examples of CreateException


Examples of javax.ejb.CreateException

    public void ejbCreate() throws CreateException{
        try {
            context = new InitialContext();
            context = (Context) context.lookup("java:comp/env");
        } catch (NamingException e) {
            throw (CreateException)new CreateException().initCause(e);
        }
    }
View Full Code Here

Examples of javax.ejb.CreateException

      ctx = new InitialContext();
      String recommenderClassName = (String) ctx.lookup("java:comp/env/recommender-class");
      if (recommenderClassName == null) {
        String recommenderJNDIName = (String) ctx.lookup("java:comp/env/recommender-jndi-name");
        if (recommenderJNDIName == null) {
          throw new CreateException("recommender-class and recommender-jndi-name env-entry not defined");
        }
        recommender = (Recommender) ctx.lookup("java:comp/env/" + recommenderJNDIName);
      } else {
        recommender = Class.forName(recommenderClassName).asSubclass(Recommender.class).newInstance();
      }
     
    } catch (NamingException ne) {
      throw new CreateException(ne.toString());
    } catch (ClassNotFoundException cnfe) {
      throw new CreateException(cnfe.toString());
    } catch (InstantiationException ie) {
      throw new CreateException(ie.toString());
    } catch (IllegalAccessException iae) {
      throw new CreateException(iae.toString());
    } finally {
      if (ctx != null) {
        try {
          ctx.close();
        } catch (NamingException ne) {
          throw new CreateException(ne.toString());
        }
      }
    }
  }
View Full Code Here

Examples of javax.ejb.CreateException

        try {
            setId(id);
            setName(name);
            setValue(value);
        } catch (Exception e) {
            throw new CreateException("Exception occurred: " + e);
        }
        return null;
    }
View Full Code Here

Examples of javax.ejb.CreateException

        try {
            setId(id);
            setName(name);
            setValue(value);
        } catch (Exception e) {
            throw new CreateException("Exception occurred: " + e);
        }
        return null;
    }
View Full Code Here

Examples of javax.ejb.CreateException

            Product p = ph.create();
        } catch (CreateException e) {
            throw e;
        } catch (Exception e) {
            e.printStackTrace();
            throw new CreateException("hosed");
        }
    }
View Full Code Here

Examples of javax.ejb.CreateException

            ProductLocal p = ph.create();
        } catch (CreateException e) {
            throw e;
        } catch (Exception e) {
            e.printStackTrace();
            throw new CreateException("hosed");
        }
    }
View Full Code Here

Examples of javax.ejb.CreateException

    public void ejbPostCreateWithOrderId(Long orderId) throws CreateException {
        try {
            getOrderHome().findByPrimaryKey(orderId).getLineItems().add(ctx.getEJBLocalObject());
        } catch (FinderException e) {
            throw new CreateException(e.getMessage());
        }
    }
View Full Code Here

Examples of javax.ejb.CreateException

        try {
            setId(id);
            setName(name);
            setValue(value);
        } catch (Exception e) {
            throw new CreateException("Exception occurred: " + e);
        }
        return null;
    }
View Full Code Here

Examples of javax.ejb.CreateException

                    c.add(b1);
                    break;
            }

        } catch (Exception e) {
            throw new CreateException("Exception occurred: " + e);
        }
    }
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
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.