Package org.apache.openejb

Examples of org.apache.openejb.OpenEJBRuntimeException


        if (LocalMBeanServer.isJMXActive()) {
            final Class<?> clazz;
            try {
                clazz = cl.loadClass(mbeanClass);
            } catch (final ClassNotFoundException e) {
                throw new OpenEJBRuntimeException(e);
            }

            // cdi can be off so init with null bean in this case
            final Bean<?> bean;
            final BeanManager bm;
View Full Code Here


            logger.getChildLogger("service").info("createResource.createConnectionManager", serviceInfo.id, service.getClass().getName());

            // create the connection manager
            final ConnectionManager connectionManager = (ConnectionManager) connectionManagerRecipe.create();
            if (connectionManager == null) {
                throw new OpenEJBRuntimeException(messages.format("assembler.invalidConnectionManager", serviceInfo.id));
            }

            final Map<String, Object> unsetA = serviceRecipe.getUnsetProperties();
            final Map<String, Object> unsetB = connectionManagerRecipe.getUnsetProperties();
            final Map<String, Object> unset = new HashMap<String, Object>();
View Full Code Here

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

                        p.waitFor();
                    }
                }

            } catch (final Exception e) {
                throw (RuntimeException) new OpenEJBRuntimeException("Cannot start the server.  Exception: " + e.getClass().getName() + ": " + e.getMessage()).initCause(e);
            }
            if (checkPortAvailable) {
                if (debug) {

                    if (!connect(port, Integer.MAX_VALUE)) {
                        throw new OpenEJBRuntimeException("Could not connect to server");
                    }
                } else {
                    if (!connect(port, tries)) {
                        throw new OpenEJBRuntimeException("Could not connect to server");
                    }
                }
            }
        } else {
            if (verbose) {
View Full Code Here

                } catch (final Throwable t1) {
                    try {
                        tmp = Class.forName("org.apache.openejb.resource.activemq.ActiveMQ4Factory");
                        brokerPrefix = "amq4factory:";
                    } catch (final Throwable t2) {
                        throw new OpenEJBRuntimeException("Unable to load ActiveMQFactory: Check ActiveMQ jar files are on classpath", t1);
                    }
                }

                final Class clazz = tmp;

                try {
                    instance = clazz.newInstance();
                } catch (final InstantiationException e) {
                    throw new OpenEJBRuntimeException("Unable to create ActiveMQFactory instance", e);
                } catch (final IllegalAccessException e) {
                    throw new OpenEJBRuntimeException("Unable to access ActiveMQFactory instance", e);
                }

                try {
                    setThreadProperties = clazz.getDeclaredMethod("setThreadProperties", new Class[]{Properties.class});
                } catch (final NoSuchMethodException e) {
                    throw new OpenEJBRuntimeException("Unable to create ActiveMQFactory setThreadProperties method", e);
                }

                try {
                    createBroker = clazz.getDeclaredMethod("createBroker", new Class[]{URI.class});
                } catch (final NoSuchMethodException e) {
                    throw new OpenEJBRuntimeException("Unable to create ActiveMQFactory createBroker method", e);
                }

                try {
                    getBrokers = clazz.getDeclaredMethod("getBrokers", (Class[]) null);
                } catch (final NoSuchMethodException e) {
                    throw new OpenEJBRuntimeException("Unable to create ActiveMQFactory createBroker method", e);
                }
            }
        }
    }
View Full Code Here

        ActiveMQFactory.init();

        try {
            setThreadProperties.invoke(instance, p);
        } catch (final IllegalAccessException e) {
            throw new OpenEJBRuntimeException("ActiveMQFactory.setThreadProperties.IllegalAccessException", e);
        } catch (final IllegalArgumentException e) {
            throw new OpenEJBRuntimeException("ActiveMQFactory.setThreadProperties.IllegalArgumentException", e);
        } catch (final InvocationTargetException e) {
            throw new OpenEJBRuntimeException("ActiveMQFactory.setThreadProperties.InvocationTargetException", e);
        }
    }
View Full Code Here

        // something is really messed up with this entry, try to cleanup before throwing an exception
        final Entry entry = cache.remove(key);
        if (entry != null) {
            lru.remove(entry);
        }
        throw new OpenEJBRuntimeException("Cache is corrupted: the entry " + key + " in the Map 'cache' is in state PASSIVATED");
    }
View Full Code Here

        final ServletListener listener;
        try {
            listener = new ServletListener((Servlet) wc.newInstance(wc.getClassLoader().loadClass(classname)), wc.getContextRoot());
            listener.getDelegate().init(null);
        } catch (final Exception e) {
            throw new OpenEJBRuntimeException(e);
        }

        registry.addHttpListener(listener, pattern(wc.getContextRoot(), mapping));
        return true;
    }
View Full Code Here

        final FilterListener listener;
        try {
            listener = new FilterListener((Filter) wc.newInstance(wc.getClassLoader().loadClass(classname)), wc.getContextRoot());
            listener.getDelegate().init(config);
        } catch (final Exception e) {
            throw new OpenEJBRuntimeException(e);
        }

        registry.addHttpFilter(listener, pattern(wc.getContextRoot(), mapping));
        return true;
    }
View Full Code Here

            }

            // perform custom injections
            performInjections(testObj);
        } catch (final IOException e) {
            throw new OpenEJBRuntimeException("Failed to load configuration.", e);
        } catch (final NamingException e) {
            throw new OpenEJBRuntimeException("Failed to configure object.", e);
        } catch (final Exception e) {
            throw new OpenEJBRuntimeException("Unknown error trying to configure object.", e);
        }
    }
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.