Package org.apache.tomee.catalina

Examples of org.apache.tomee.catalina.TomEERuntimeException


            try {
                fis = new FileInputStream(path);
                IO.copy(fis, baos);
                archive = baos.toByteArray();
            } catch (Exception e) {
                throw new TomEERuntimeException(e);
            } finally {
                IO.close(fis);
                IO.close(baos);
            }
        }
View Full Code Here


        if ((WEBSERVICE_OLDCONTEXT_ACTIVE || (refs != null && refs == 0)) && context != null) {
            try {
                context.stop();
                context.destroy();
            } catch (Exception e) {
                throw new TomEERuntimeException(e);
            }
            Host host = (Host) context.getParent();
            host.removeChild(context);
        } // else let tomcat manages its context
    }
View Full Code Here

                if (portValue instanceof Integer) {
                    port = (Integer) portValue;
                } else if (portValue instanceof String) {
                    port = Integer.parseInt((String) portValue);
                } else {
                    throw new TomEERuntimeException("port value should be an integer or a string");
                }
                if (port <= 0) {
                    port = NetworkUtil.getNextAvailablePort();
                }
                configuration.setHttpPort(port);
            }
            System.setProperty(TOMEE_EJBCONTAINER_HTTP_PORT, Integer.toString(configuration.getHttpPort()));
            tomEEContainer.container.setup(configuration);
            try {
                tomEEContainer.container.start();

                if (modules instanceof File) {
                    tomEEContainer.container.deploy(appId, ((File) modules), true);
                } else if (modules instanceof String) {
                    tomEEContainer.container.deploy(appId, new File((String) modules), true);
                } else if (modules instanceof String[]) {
                    for (String path : (String[]) modules) {
                        tomEEContainer.container.deploy(appId, new File(path), true);
                    }
                } else if (modules instanceof File[]) {
                    for (File file : (File[]) modules) {
                        tomEEContainer.container.deploy(appId, file, true);
                    }
                } else {
                    try {
                        tomEEContainer.close();
                    } catch (Exception e) {
                        // no-op
                    }
                    tomEEContainer = null;
                    throw Exceptions.newNoModulesFoundException();
                }

                return tomEEContainer;
            } catch (OpenEJBException e) {
                throw new EJBException(e);
            } catch (MalformedURLException e) {
                throw new EJBException(e);
            } catch (ValidationException ve) {
                throw ve;
            } catch (Exception e) {
                if (e instanceof EJBException) {
                    throw (EJBException) e;
                }
                throw new TomEERuntimeException("initialization exception", e);
            } finally {
                if (tomEEContainer == null) {
                    try {
                        tomEEContainer.close();
                    } catch (Exception e) {
View Full Code Here

            }

            return file.getAbsolutePath();

        } catch (IOException e) {
            throw new TomEERuntimeException("Failed to get or create base dir: " + file, e);
        }
    }
View Full Code Here

        if (WEBSERVICE_OLDCONTEXT_ACTIVE) {
            try {
                context.destroy();
                context.stop();
            } catch (Exception e) {
                throw new TomEERuntimeException(e);
            }
            Host host = (Host) context.getParent();
            host.removeChild(context);
        } // else let tomcat manages its context
    }
View Full Code Here

            final String dir = configuration.getDir();
            if (dir != null) return dir;
            final File file = File.createTempFile("apache-tomee", "-home");
            return file.getAbsolutePath();
        } catch (IOException e) {
            throw new TomEERuntimeException(e);
        }
    }
View Full Code Here

    mBeanServer = Registry.getRegistry(null, null).getMBeanServer();
  }

  @Override
    public String getUniqueFile() {
    throw new TomEERuntimeException("This method is not used");
  }
View Full Code Here

            final String dir = configuration.getDir();
            if (dir != null) return dir;
            final File file = File.createTempFile("apache-tomee", "-home");
            return file.getAbsolutePath();
        } catch (IOException e) {
            throw new TomEERuntimeException(e);
        }
    }
View Full Code Here

        if (WEBSERVICE_OLDCONTEXT_ACTIVE) {
            try {
                context.destroy();
                context.stop();
            } catch (Exception e) {
                throw new TomEERuntimeException(e);
            }
            Host host = (Host) context.getParent();
            host.removeChild(context);
        } // else let tomcat manages its context
    }
View Full Code Here

TOP

Related Classes of org.apache.tomee.catalina.TomEERuntimeException

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.