2015-01-01 65 views
0

我想部署一個簡單的jsp應用程序:我創建並複製myApp.war文件到$JBOSS_HOME/standalone/deployment文件夾。找不到配置文件 - JBoss7

相反部署WAR文件時,JBoss創建的* .war.failed,

所以我想,也許這是重新啓動的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文件嗎?

+0

嘗試重新啓動您的機器... – ashokhein

+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不存在,則放入jboss.server.config.dir,standalone.sh不帶任何選項;或可賦予其文件名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一起發貨。如果你沒有它,你可以下載一個發行版的新副本來獲得它。我總是做的是將發行版的壓縮文件歸檔以便在工作副本中出現損壞或丟失的情況下進行恢復。