Package com.sun.enterprise.admin.servermgmt

Examples of com.sun.enterprise.admin.servermgmt.DomainException


                layout.getNSSCertDBFile().getParentFile().getAbsolutePath(),
                false, DEFAULT_MASTER_PASSWORD);           
            store.changePassword(DEFAULT_MASTER_PASSWORD, masterPassword)
            NssStore.closeInstance();
        } catch (Exception e) {
            throw new DomainException(
                _strMgr.getString("certDBInitializationFailed", layout.getConfigRoot()),
                    e);
        }      
    }      
View Full Code Here


            addToAsadminTrustStore(config, certFile);
           
            certFile.delete();
            certFile = null;           
        } catch (RepositoryException ex) {                       
            throw new DomainException(_strMgr.getString("certDBInitializationFailed", configDir),
                ex);
        } finally {
            if (certFile != null) {               
                try {
                    certFile.delete();
View Full Code Here

            // SE/EE server instances need to synchronize, which take more time to start, so new timeouts
            // where needed, which makes the asadmin command wait a long time if a startup error occurs
            // like a bad jvm option is entered
            super.getInstancesManager(domainConfig).startInstance(options, (String[])null, getEnvProps(domainConfig));           
        } catch (Exception e) {
            throw new DomainException(e);
        }
    }
View Full Code Here

                NssStore store = NssStore.getInstance(dbdir, false, oldPassword);     
                store.changePassword(oldPassword, newPassword);
                NssStore.closeInstance();
            }
        } catch (Exception ex) {
            throw new DomainException(_strMgr.getString("masterPasswordNotChanged"), ex);
        }
    }
View Full Code Here

                layout.getNSSCertDBFile().getParentFile().getAbsolutePath(),
                false, getMasterPasswordClear(config));
            String[] result = nssStore.getTokenNamesAsArray();                     
            return result;
         } catch (Exception ex) {
             throw new DomainException(ex);
         }
     }       
View Full Code Here

        public void execute(String keystoreErrorMsg, File keystoreName) throws DomainException
        {
            try {
                super.execute();                   
                if (getProcessExitValue() != 0) {
                    throw new DomainException(_strMgr.getString(keystoreErrorMsg, keystoreName) +
                        getLastExecutionError() + " " +  getLastExecutionOutput());
                }
            } catch (ExecException ex) {                       
                throw new DomainException(_strMgr.getString(keystoreErrorMsg,
                    keystoreName) + getLastExecutionError() + " " +  getLastExecutionOutput(), ex);
            }              
        }
View Full Code Here

                    adminPortInt, instancePortInt, jmsPort, orbPort, httpSSLPort,
                    jmsPort, orbPort, httpSSLPort, iiopSSLPort,
                    iiopMutualAuthPort, jmxPort, osgiShellTelnetPort, javaDebuggerPort
            });
        } catch (Exception ex) {
            throw new DomainException(ex);
        }
    }
View Full Code Here

            throws DomainException {
        try {
            return Integer.parseInt(port);
        }
        catch (Exception e) {
            throw new DomainException(
                    _strings.get("InvalidPortNumber", port));
        }
    }
View Full Code Here

    private void initialize() throws DomainException {
        String templateJarPath = (String)_domainConfig.get(DomainConfig.K_TEMPLATE_NAME);
        if (templateJarPath == null || templateJarPath.isEmpty()) {
            String defaultTemplateName = Version.getDefaultDomainTemplate();
            if (defaultTemplateName == null || defaultTemplateName.isEmpty()) {
                throw new DomainException(_strings.get("missingDefaultTemplateName"));
            }
            Map<String, String> envProperties = new ASenvPropertyReader().getProps();
            templateJarPath = envProperties.get(SystemPropertyConstants.INSTALL_ROOT_PROPERTY) + File.separator
                    + DEFUALT_TEMPLATE_RELATIVE_PATH + File.separator + defaultTemplateName;
        }
        File template = new File(templateJarPath);
        if (!template.exists() || !template.getName().endsWith(".jar")) {
            throw new DomainException(_strings.get("invalidTemplateJar", template.getAbsolutePath()));
        }
        try {
            _templateJar = new JarFile(new File(templateJarPath));
            JarEntry je = _templateJar.getJarEntry("config/" + DomainConstants.DOMAIN_XML_FILE);
            if (je == null) {
                throw new DomainException(_strings.get("missingMandatoryFile", DomainConstants.DOMAIN_XML_FILE));
            }
            // Loads template-info.xml
            je = _templateJar.getJarEntry(TEMPLATE_INFO_XML);
            if (je == null) {
                throw new DomainException(_strings.get("missingMandatoryFile", TEMPLATE_INFO_XML));
            }
            TemplateInfoHolder templateInfoHolder = new TemplateInfoHolder(_templateJar.getInputStream(je), templateJarPath);
            _extractedEntries.add(TEMPLATE_INFO_XML);

            // Loads string substitution XML.
            je = _templateJar.getJarEntry(STRINGSUBS_FILE);
            StringSubstitutor stringSubstitutor = null;
            if (je != null) {
                stringSubstitutor = StringSubstitutionFactory.createStringSubstitutor(_templateJar.getInputStream(je));
                List<Property> defaultStringSubsProps = stringSubstitutor.getDefaultProperties(PropertyType.PORT);
                for (Property prop : defaultStringSubsProps) {
                    _defaultPortValues.setProperty(prop.getKey(), prop.getValue());
                }
                _extractedEntries.add(je.getName());
            } else {
                _logger.log(Level.WARNING, _strings.get("missingFile", STRINGSUBS_FILE));
            }
            _domainTempalte = new DomainTemplate(templateInfoHolder, stringSubstitutor, templateJarPath);

            // Loads default self signed certificate.
            je = _templateJar.getJarEntry("config/" + DomainConstants.KEYSTORE_FILE);
            if (je != null) {
                _keystoreBytes = new byte[(int)je.getSize()];
                InputStream in = null;
                int count = 0;
                try {
                    in = _templateJar.getInputStream(je);
                    count = in.read(_keystoreBytes);
                    if (count < _keystoreBytes.length) {
                        throw new DomainException(_strings.get("loadingFailure", je.getName()));
                    }
                } finally {
                    if (in != null) {
                        in.close();
                    }
                }
                _extractedEntries.add(je.getName());
            }
            File parentDomainDir = FileUtils.safeGetCanonicalFile(new File(_domainConfig.getRepositoryRoot()));
            createDirectory(parentDomainDir);
        } catch (Exception e) {
            throw new DomainException(e);
        }
    };
View Full Code Here

            // Validate other domain config parameters.
            new PEDomainConfigValidator().validate(_domainConfig);

        } catch (Exception ex) {
            throw new DomainException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.admin.servermgmt.DomainException

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.