manager.validateDomain(config, false);
verifyPortBase();
}
catch (DomainException e) {
logger.fine(e.getLocalizedMessage());
throw new CommandException(
strings.get("CouldNotCreateDomain", domainName), e);
}
/*
* The admin user is specified with the --user program option. If not
* specified (because the user hit Enter at the prompt), we use the
* default, which allows unauthenticated login.
*/
adminUser = programOpts.getUser();
if (!ok(adminUser)) {
adminUser = SystemPropertyConstants.DEFAULT_ADMIN_USER;
adminPassword = SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
}
else if (noPassword) {
adminPassword = SystemPropertyConstants.DEFAULT_ADMIN_PASSWORD;
}
else {
adminPassword = getAdminPassword();
boolean haveAdminPwd = true;
}
if (saveMasterPassword)
useMasterPassword = true;
if (masterPassword == null)
masterPassword = DEFAULT_MASTER_PASSWORD;
try {
// verify admin port is valid if specified on command line
if (adminPort != null) {
verifyPortIsValid(adminPort);
}
// instance option is entered then verify instance port is valid
if (instancePort != null) {
verifyPortIsValid(instancePort);
}
// saving the login information happens inside this method
createTheDomain(domainDir, domainProperties);
}
catch (CommandException ce) {
logger.info(ce.getLocalizedMessage());
throw new CommandException(
strings.get("CouldNotCreateDomain", domainName), ce);
}
catch (Exception e) {
logger.fine(e.getLocalizedMessage());
throw new CommandException(
strings.get("CouldNotCreateDomain", domainName), e);
}
return 0;
}