找不到配置文件 - JBoss7

时间:2015-01-01 01:34:16

标签: macos java-ee deployment jboss jboss7.x

我想部署一个简单的jsp应用程序:我创建了myApp.war文件并将其复制到$JBOSS_HOME/standalone/deployment文件夹。

JBoss创建了* .war.failed,

,而不是部署war文件

所以我想也许重新启动jboss以确定它是否会影响部署是个好主意。

在某些论坛中,建议通过以下方式重启JBoss:$JBOSS_HOME/bin/jboss-cli.sh 但是没有关机或重启命令。

当我尝试重启时,我运行了以下命令:

/usr/local/jboss7/bin/jboss-cli.sh -c ":shutdown(restart=true)"

JBoss停止了工作,但它没有重新开始。

现在,我想通过以下方式重新开始:

$JBOSS_HOME/bin/standalone.sh 

但它给了我以下例外:

=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /usr/local/jboss7

  JAVA: /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin/java

  JAVA_OPTS:  -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

=========================================================================

17:29:43,399 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA
17:29:43,536 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA
17:29:43,567 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
17:29:43,876 ERROR [org.jboss.as.server] JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.ServerService.boot(ServerService.java:266) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:155) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '*' (code 42) (expected a name start character)
 at [row,col {unknown-source}]: [190,160]
    at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:639)
    at com.ctc.wstx.sr.StreamScanner.parseLocalName(StreamScanner.java:1798)
    at com.ctc.wstx.sr.BasicStreamReader.handleNsAttrs(BasicStreamReader.java:2975)
    at com.ctc.wstx.sr.BasicStreamReader.handleStartElem(BasicStreamReader.java:2926)
    at com.ctc.wstx.sr.BasicStreamReader.nextFromTree(BasicStreamReader.java:2802)
    at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1050)
    at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1125)
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.nextTag(XMLExtendedStreamReaderImpl.java:152) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
    at org.jboss.as.server.deployment.scanner.DeploymentScannerParser_1_1.readElement(DeploymentScannerParser_1_1.java:85)
    at org.jboss.as.server.deployment.scanner.DeploymentScannerParser_1_1.readElement(DeploymentScannerParser_1_1.java:28)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
    at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:894) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_1(StandaloneXml.java:330) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:127) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:100) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final.jar:1.1.0.Final]
    at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:133) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
    ... 3 more

17:29:43,882 FATAL [org.jboss.as.server] JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
17:29:43,889 INFO  [org.jboss.as] JBAS015950: JBoss AS 7.1.1.Final "Brontes" stopped in 4ms

我搜索了问题的原因,我发现standalone.xml文件可能存在问题。

/usr/local/jboss7/standalone/configuration/standalone_xml_history中我有以下文件,但没有standalone.xml

2014xxxx-xxxxxxxx   
snapshot        
standalone.initial.xml
current         
standalone.boot.xml
standalone.last.xml

我想知道是否必须将这些文件重命名为standalone.xml? (实际上我尝试将standalone.boot.xml重命名为standalone.xml,但它也没有工作!)或下载一个新的?我可以在拥有新的standalone.xml后删除这些xml文件吗?

1 个答案:

答案 0 :(得分:1)

如果JBoss-7安装在$ JBOSSHOME中,则默认的独立配置文件是$ JBOSS_HOME / standalone / configuration / standalone.xml; $ JBOSSHOME / standalone / configuration是jboss.server.config.dir属性的默认值;并且在没有选项的情况下运行$ JBOSSHOME / bin / standalone.sh将在Linux / Unix系统上以独立模式启动JBoss。

为了使用不同的独立配置文件,可以将其重命名为standalone.xml,如果它不存在则放在jboss.server.config.dir中,并且standalone.sh运行时没有选项;或者将其文件名作为-c选项的参数提供给jboss.server.config.dir后的参数,例如:

$JBoss_home/bin/standalone.sh -c standalone-full.xml

RedHat文档位于https://docs.jboss.org/author/display/AS71/Command+line+parameters

我在standalone / configuration / standalone-full.xml上取得了最大的成功,因为它具有完整的配置。它随JBoss-7一起提供。如果你没有它,你可以下载发行版的新副本来获得它。我一直在做的是存档发行版的拉链以便在工作副本中出现损坏或丢失的情况下进行恢复。