Index: src/main/java/com/sun/enterprise/admin/cli/optional/VerifyDomainXmlCommand.java =================================================================== --- src/main/java/com/sun/enterprise/admin/cli/optional/VerifyDomainXmlCommand.java (revision 33782) +++ src/main/java/com/sun/enterprise/admin/cli/optional/VerifyDomainXmlCommand.java (working copy) @@ -42,8 +42,16 @@ import com.sun.enterprise.admin.cli.*; import com.sun.enterprise.config.serverbeans.Domain; +import com.sun.enterprise.config.serverbeans.MonitoringService; import com.sun.enterprise.universal.i18n.LocalStringsImpl; +import com.sun.enterprise.v3.server.AppServerStartup; + +import com.sun.logging.LogDomains; +import java.beans.PropertyVetoException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.glassfish.api.embedded.EmbeddedFileSystem; import org.glassfish.api.embedded.Server; import org.jvnet.hk2.annotations.*; import org.jvnet.hk2.component.*; @@ -83,7 +91,7 @@ operandType = "STRING"; operandMin = 0; operandMax = 1; - + //processProgramOptions(); } @@ -92,12 +100,27 @@ @Override protected int executeCommand() throws CommandException, CommandValidationException { - + + Logger aslogger = LogDomains.getLogger(AppServerStartup.class, LogDomains.CORE_LOGGER); + aslogger.setLevel(Level.SEVERE); + + String serverName = "inplanted"; File domainXMLFile = getDomainXml(); logger.printDebugMessage("Domain XML file = " + domainXMLFile); try { - Server server = new Server.Builder("dummylaunch").build(); - server.start(); + Server server = Server.getServer(serverName); + if (server == null) { + EmbeddedFileSystem.Builder efsb = new EmbeddedFileSystem.Builder(); + String installRoot = System.getProperty("com.sun.aas.installRoot"); + File f = new File(installRoot); + efsb.installRoot(f, false); + Server.Builder builder = new Server.Builder(serverName); + // Turn logger off to avoid verbose CLI output that may confuse + builder.logger(false); + builder.embeddedFileSystem(efsb.build()); + server = builder.build(); + server.start(); + } Habitat habitat = server.getHabitat(); ConfigParser parser = new ConfigParser(habitat); URL domainURL = domainXMLFile.toURI().toURL(); @@ -105,7 +128,6 @@ Dom domDomain = doc.getRoot(); Domain domain = domDomain.createProxy(Domain.class); DomainXmlVerifier validator = new DomainXmlVerifier(domain); - validator.invokeConfigValidator(); } catch (Exception e) { throw new CommandException(e.getMessage());