Package org.apache.openejb

Examples of org.apache.openejb.OpenEJBRuntimeException


                    field.setAccessible(true);
                }

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


            final ByteArrayOutputStream out = new ByteArrayOutputStream();
            p.store(out, "");
            return new String(out.toByteArray());
        } catch (final IOException e) {
            throw new OpenEJBRuntimeException(String.format("Cannot canonicalize the @DataSourceDefinition %s as a properties string", d.getName()));
        }
    }
View Full Code Here

        public BoneCPDataSourceProvidedPool(final BoneCP pool) {
            try {
                POOL_FIELD.set(this, pool);
            } catch (final IllegalAccessException e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
View Full Code Here

            final String apiClassname = String.class.cast(environment.get(API));
            if (apiClassname != null) {
                try {
                    api = loader.loadClass(apiClassname);
                } catch (final ClassNotFoundException e) {
                    throw new OpenEJBRuntimeException(e);
                }
            } else {
                api = null;
            }

            try {
                factoryConstructor = loader.loadClass("com.caucho.hessian.client.HessianProxyFactory").getConstructor(ClassLoader.class);
                serializerConstructor = loader.loadClass("com.caucho.hessian.io.SerializerFactory").getConstructor(ClassLoader.class);
            } catch (final Exception e) {
                throw new OpenEJBRuntimeException(e);
            }
        }
View Full Code Here

                    return Reflections.invokeByReflection(clientFactory, "create", STRING_PARAM, new Object[]{completeUrl});
                } catch (final Exception e) {
                    throw new NamingException(e.getMessage());
                }
            } catch (final Exception e) {
                throw new OpenEJBRuntimeException(e);
            }


        }
View Full Code Here

                if (serializerFactory != null) {
                    try {
                        server.serializerFactory(classLoader.loadClass(serializerFactory).newInstance()).sendCollectionType(sendCollectionType);
                    } catch (final Exception e) {
                        throw new OpenEJBRuntimeException(e);
                    }
                } else {
                    server.sendCollectionType(sendCollectionType);
                }

                server.createSkeleton(ProxyEJB.simpleProxy(beanContext, new Class<?>[]{remoteItf}), remoteItf);

                try {
                    LOGGER.info("Hessian(url=" + registry.deploy(classLoader, server, virtualHost, appName(app, beanContext), authMethod, transportGuarantee, realmName, String.class.cast(beanContext.getDeploymentID())) + ", interface=" + remoteItf.getName() + ")");
                } catch (final URISyntaxException e) {
                    throw new OpenEJBRuntimeException(e);
                }
            } finally {
                Thread.currentThread().setContextClassLoader(old);
            }
        }
View Full Code Here

                logger.error(message, e);

                // Caller handles transaction rollback and discardInstance

                // [4] throw the java.rmi.RemoteException to the client
                throw new OpenEJBRuntimeException(message, e);
            } finally {
                ThreadContext.exit(oldCallContext);
            }
        }
View Full Code Here

                    // [3] Discard the instance
                    discardInstance(callContext.getPrimaryKey(), instance);

                    // [4] throw the java.rmi.RemoteException to the client
                    throw new OpenEJBRuntimeException(message, e);
                } finally {
                    ThreadContext.exit(oldCallContext);
                }
            }
        }
View Full Code Here

                    ThreadContext.exit(oldCallContext);
                }
            }

            if (firstException != null) {
                throw new OpenEJBRuntimeException("An unexpected system exception occured while invoking the afterCompletion method on the SessionSynchronization object", firstException);
            }
        }
View Full Code Here

            final String gripe = "Test class should have at least one @Module method";
            errors.add(new Exception(gripe));
        }

        if (!errors.isEmpty()) {
            throw new OpenEJBRuntimeException(errors.toString());
        }
    }
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.