Package org.apache.openejb

Examples of org.apache.openejb.OpenEJBRuntimeException


            // perform custom injections
            performInjections(testObj);
        }
        catch (IOException e) {
            throw new OpenEJBRuntimeException("Failed to load configuration.", e);
        }
        catch (NamingException e) {
            throw new OpenEJBRuntimeException("Failed to configure object.", e);
        }
        catch (Exception e) {
            throw new OpenEJBRuntimeException("Unknown error trying to configure object.", e);
        }
    }
View Full Code Here


                }

                field.set(testObj, injectValue);
            }
            catch (Exception e) {
                throw new OpenEJBRuntimeException("Failed to inject on: " + clazz.getCanonicalName() + "." + field.getName(), e);
            }
        }
    }
View Full Code Here

            this.fail = fail;
        }

        public void configureTest(Object testObj) {
            if (fail) {
                throw new OpenEJBRuntimeException("Fail");
            }

            assertEquals(fakeTestObject, testObj);

            configuredInvoked = true;
View Full Code Here

            old = contextEntered(webBeansContext);
            setConfiguration(webBeansContext.getOpenWebBeansConfiguration());
            try {
                webBeansContext.getService(ContainerLifecycle.class).startApplication(startupObject);
            } catch (Exception e) {
                throw new OpenEJBRuntimeException("couldn't start owb context", e);
            }
        } finally {
            contextExited(old);
            Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
View Full Code Here

        } else if (args[0].equalsIgnoreCase("stop")) {
            RemoteServer remoteServer = new RemoteServer();
            remoteServer.serverHasAlreadyBeenStarted = false;
            remoteServer.stop();
        } else {
            throw new OpenEJBRuntimeException("valid arguments are 'start' or 'stop'");
        }
    }
View Full Code Here

                server = Runtime.getRuntime().exec(args);

                Pipe.pipe(server);

            } catch (Exception e) {
                throw (RuntimeException) new OpenEJBRuntimeException("Cannot start the server.  Exception: "+e.getClass().getName()+": "+e.getMessage()).initCause(e);
            }
            if (checkPortAvailable) {
                if (debug) {
                    if (!connect(Integer.MAX_VALUE)) throw new OpenEJBRuntimeException("Could not connect to server");
                } else {
                    if (!connect(tries)) throw new OpenEJBRuntimeException("Could not connect to server");
                }
            }
        } else {
            if (verbose) System.out.println("[] FOUND STARTED SERVER");
        }
View Full Code Here

                manager.addBean(new NewCdiEjbBean<Object>(bean));
            }

        } catch (Exception e1) {
            Assembler.logger.error("CDI Beans module deployment failed", e1);
            throw new OpenEJBRuntimeException(e1);
        }
        //Start actual starting on sub-classes
        afterStartApplication(startupObject);

        logger.info(OWBLogConst.INFO_0001, Long.toString(System.currentTimeMillis() - begin));
View Full Code Here

    @Override
    public ValidatorFactory getDefaultValidatorFactory() {
        try {
            return (ValidatorFactory) new InitialContext().lookup("java:comp/ValidatorFactory");
        } catch (NamingException e) {
            throw new OpenEJBRuntimeException(e);
        }
    }
View Full Code Here

    @Override
    public Validator getDefaultValidator() {
        try {
            return (Validator) new InitialContext().lookup("java:comp/Validator");
        } catch (NamingException e) {
            throw new OpenEJBRuntimeException(e);
        }
    }
View Full Code Here

    private static void deployMBean(final BeanManager bm, final ClassLoader cl, final String mbeanClass, final Properties appMbeans, final String id) {
        final Class<?> clazz;
        try {
            clazz = cl.loadClass(mbeanClass);
        } catch (ClassNotFoundException e) {
            throw new OpenEJBRuntimeException(e);
        }
        final Set<Bean<?>> beans = bm.getBeans(clazz);
        final Bean bean = bm.resolve(beans);
        final Object instance;
        if (bean == null) {
View Full Code Here

TOP

Related Classes of org.apache.openejb.OpenEJBRuntimeException

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.