Package javax.ejb

Examples of javax.ejb.CreateException


                } catch(Exception pie) {
                    if (ejbInv.exception != null) {
                        _logger.log(Level.FINE, "Exception during SFSB startup postInvoke ", pie);
                    } else {
                        ejbInv.exception = pie;
                        CreateException creEx = new CreateException("Initialization failed for Stateful Session Bean " +
                                        ejbDescriptor.getName());
                        creEx.initCause(pie);
                        throw creEx;
                    }
                } finally {
                    context.setInLifeCycleCallback(false);
                }
View Full Code Here


     *
     */
    public EJBObjectImpl createEJBObjectImpl()
        throws CreateException, RemoteException
    {
        throw new CreateException("EJB 2.x Remote view not supported on Singletons");
    }
View Full Code Here

     * Called during client creation request through EJB LocalHome view.
     */
    public EJBLocalObjectImpl createEJBLocalObjectImpl()
        throws CreateException
   
        throw new CreateException("EJB 2.x Local view not supported on Singletons");
    }
View Full Code Here

        } catch ( Throwable th ) {
            if (ejbInv != null) {
                ejbInv.exception = th;
            }
            singletonInitializationFailed = true;
            CreateException creEx = new CreateException("Initialization failed for Singleton " +
                                    ejbDescriptor.getName());
            creEx.initCause(th);
            throw creEx;
        } finally {
            initializationInProgress = false;
            if (ejbInv != null) {
                try {
                    invocationManager.postInvoke(ejbInv);
                    if( initGotToPreInvokeTx ) {
                        postInvokeTx(ejbInv);
                    }
                } catch(Exception pie) {
                    if (ejbInv.exception != null) {
                        _logger.log(Level.WARNING, "Exception during Singleton startup postInvoke ", pie);
                    } else {
                        ejbInv.exception = pie;
                        singletonInitializationFailed = true;
                        CreateException creEx = new CreateException("Initialization failed for Singleton " +
                                        ejbDescriptor.getName());
                        creEx.initCause(pie);
                        throw creEx;
                    }
                }
            }
        }
View Full Code Here

      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

            // Set the state to POOLED after ejbCreate so that
            // EJBContext methods not allowed will throw exceptions
            context.setState(EJBContextImpl.BeanState.POOLED);
        } catch ( Throwable th ) {
            _logger.log(Level.SEVERE, "ejb.stateless_ejbcreate_exception", logParams);
            CreateException creEx = new CreateException("Could not create stateless EJB");
            creEx.initCause(th);
            throw creEx;
        } finally {
            if (ejbInv != null) {
                invocationManager.postInvoke(ejbInv);
            }
View Full Code Here

     *
     */
    public EJBObjectImpl createEJBObjectImpl()
        throws CreateException, RemoteException
    {
        throw new CreateException("EJB 2.x Remote view not supported on Singletons");
    }
View Full Code Here

     * Called during client creation request through EJB LocalHome view.
     */
    public EJBLocalObjectImpl createEJBLocalObjectImpl()
        throws CreateException
   
        throw new CreateException("EJB 2.x Local view not supported on Singletons");
    }
View Full Code Here

        } catch ( Throwable th ) {
            if (ejbInv != null) {
                ejbInv.exception = th;
            }
            singletonInitializationFailed = true;
            CreateException creEx = new CreateException("Initialization failed for Singleton " +
                                    ejbDescriptor.getName());
            creEx.initCause(th);
            throw creEx;
        } finally {
            initializationInProgress = false;
            if (ejbInv != null) {
                try {
                    invocationManager.postInvoke(ejbInv);
                    if( initGotToPreInvokeTx ) {
                        postInvokeTx(ejbInv);
                    }
                } catch(Exception pie) {
                    if (ejbInv.exception != null) {
                        _logger.log(Level.WARNING, "Exception during Singleton startup postInvoke ", pie);
                    } else {
                        ejbInv.exception = pie;
                        singletonInitializationFailed = true;
                        CreateException creEx = new CreateException("Initialization failed for Singleton " +
                                        ejbDescriptor.getName());
                        creEx.initCause(pie);
                        throw creEx;
                    }
                }
            }
        }
View Full Code Here

            if (t instanceof InvocationTargetException) {
                _logger.log(Level.SEVERE, t.getClass().getName(), t.getCause());
            }
            _logger.log(Level.SEVERE, t.getClass().getName(), t);

            CreateException ce = new CreateException(
                    "Could not create Message-Driven EJB");
            ce.initCause(t);
            throw ce;

        } finally {
            if (originalClassLoader != null) {
                Utility.setContextClassLoader(originalClassLoader);
View Full Code Here

TOP

Related Classes of javax.ejb.CreateException

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.