Package org.apache.openejb

Examples of org.apache.openejb.OpenEJBRuntimeException


        } 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


                }

                System.out.println("Started server process on port: " + port);

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

            if (debug) {
                if (!connect(port, Integer.MAX_VALUE)) {
                    destroy();
                    throw new OpenEJBRuntimeException("Could not connect to server");
                }
            } else {
                if (!connect(port, tries)) {
                    destroy();
                    throw new OpenEJBRuntimeException("Could not connect to server");
                }
            }

        } else {
            if (verbose) {
View Full Code Here

        private EJBDSerializer instance() {
            try {
                return EJBDSerializer.class.cast(Thread.currentThread().getContextClassLoader().loadClass(classname).newInstance());
            } catch (final Exception e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
View Full Code Here

        String openejbUri = System.getProperty("openejb.server.uri");
        if (openejbUri == null) {
            try {
                openejbUri = new URI("ejbd", null, "localhost", 4201, null, null, null).toString();
            } catch (final URISyntaxException e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
        this.openejbUri = openejbUri;

    }
View Full Code Here

                p.put("java.naming.provider.url", openejbUri);

                final InitialContext ctx = new InitialContext(p);
                deployer = (Deployer) ctx.lookup(deployerJndi);
            } catch (final Exception e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
        return deployer;
    }
View Full Code Here

            // Encrypt data
            final byte[] cipherText = cipher.doFinal(plaintext);
            return new String(Base64.encodeBase64(cipherText)).toCharArray();

        } catch (final Exception e) {
            throw new OpenEJBRuntimeException(e);
        }
    }
View Full Code Here

            // Decrypt data
            return new String(cipher.doFinal(cipherText));

        } catch (final Exception e) {
            throw new OpenEJBRuntimeException(e);
        }
    }
View Full Code Here

            }

            return dir;

        } catch (final IOException e) {
            throw new OpenEJBRuntimeException(e);
        }
    }
View Full Code Here

                        break;
                    }
                }
            }
        } catch (final Exception e) {
            throw new OpenEJBRuntimeException(e);
        }
    }
View Full Code Here

            for (final Injection injection : context.getInjections()) {
                if (QueryProxy.class.equals(injection.getTarget())) {
                    try {
                        em = (EntityManager) context.getJndiEnc().lookup(injection.getJndiName());
                    } catch (final NamingException e) {
                        throw new OpenEJBRuntimeException("a dynamic bean should reference at least one correct PersistenceContext", e);
                    }
                }
            }
            if (em == null) {
                throw new OpenEJBRuntimeException("can't find the entity manager to use for the dynamic bean " + context.getEjbName());
            }
            QueryProxy.class.cast(invocationHandler).setEntityManager(em);
        }

        try {
            return ProxyManager.newProxyInstance(context.getBeanClass(), new Handler(invocationHandler));
        } catch (final IllegalAccessException e) {
            throw new OpenEJBRuntimeException("illegal access", 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.