gpt4 book ai didi

java - jetty worker jboss7 war 提交。服务器启动以不可恢复的方式失败

转载 作者:IT老高 更新时间:2023-10-28 21:22:23 38 4
gpt4 key购买 nike

有没有办法将 .war 文件部署到在 docker 容器中运行的 Jboss-as7 中

因为我的 jboss 服务器在 docker 提交后似乎失败了。

Could not rename    /usr/local/share/jboss/standalone/configuration/standalone_xml_history/current to  /usr/local/share/jboss/standalone/configuration/standalone_xml_history/20140107-050049692

我试过了

chmod +w usr/local/share/jboss/standalone/configuration/standalone_xml_history

引用:

https://docs.jboss.org/author/display/AS7/Configuration+file+history

现在,如果我停止 docker 容器,我必须部署 war 文件,之后不要执行 docker 提交。

我正在使用在 vagrant 上运行的 ubuntu 12.04

我使用主管来运行 ssh 和 jboss7。

我的主管文件:

[supervisord]
nodaemon=true

[program:sshd]
command=/usr/sbin/sshd -D
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true

[program:jboss]

command=/usr/local/share/jboss/bin/./standalone.sh -Djboss.bind.address=0.0.0.0 -Djboss.bind.address.management=0.0.0.0
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true

接下来我的步骤:

vagrant up
[default] Forwarding ports...
[default] -- 10022 => 10022 (adapter 1)
[default] -- 8080 => 18080 (adapter 1)

Jboss-as7 日志:

05:00:49,135 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Listening on /0.0.0.0:4447
05:00:49,155 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /0.0.0.0:9999
05:00:49,253 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory /usr/local/share/jboss/standalone/deployments
05:00:49,646 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
05:00:49,695 ERROR [org.jboss.as.server] (Controller Boot Thread) JBAS015956: Caught exception during boot: java.lang.IllegalStateException: JBAS014647: Could not rename /usr/local/share/jboss/standalone/configuration/standalone_xml_history/current to /usr/local/share/jboss/standalone/configuration/standalone_xml_history/20140107-050049692
at org.jboss.as.controller.persistence.ConfigurationFile.createHistoryDirectory(ConfigurationFile.java:414) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.persistence.ConfigurationFile.successfulBoot(ConfigurationFile.java:273) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.persistence.BackupXmlConfigurationPersister.successfulBoot(BackupXmlConfigurationPersister.java:65) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.controller.AbstractControllerService.finishBoot(AbstractControllerService.java:195) [jboss-as-controller-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.ServerService.boot(ServerService.java:268) [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:679) [rt.jar:1.6.0_24]

05:00:49,719 FATAL [org.jboss.as.server] (Controller Boot Thread) JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
05:00:49,725 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015876: Starting deployment of "ROOT.war"
05:00:49,765 INFO [org.jboss.as.osgi] (MSC service thread 1-3) JBAS011942: Stopping OSGi Framework
05:00:49,777 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."ROOT.war": org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc- 1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.6.0_24]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_24]
at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_24]
Caused by: java.lang.IllegalStateException: Container is down
at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:508) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc- 1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.as.server.deployment.AbstractDeploymentUnitService.start(AbstractDeploymentUnitService.java:77) [jboss-as- server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc- 1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc- 1.0.2.GA.jar:1.0.2.GA]

感谢任何建议。谢谢


更新

我上传了一个 Dockerfile 和一个 ROOT.war 文件到 github 到空文件夹中

https://github.com/poseidonjm/docker-files/

Dockerfile

FROM mhamel/jboss7

RUN apt-get update

RUN apt-get install -y supervisor openssh-server

RUN mkdir -p /var/run/sshd
RUN mkdir -p /var/log/supervisor

ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf

RUN echo 'root:rhemubuntu' | chpasswd

RUN sed -i 's/enable-welcome-root="true"/enable-welcome-root="false"/' /usr/local/share/jboss/standalone/configuration/standalone.xml

CMD ["/usr/bin/supervisord"]

步骤:

构建 docker 镜像

docker build -t poseidonjm/empty .

运行容器

docker run -d -p 8080:8080 -p 10022:22 poseidonjm/empty

部署 .war 文件

ifconfig
scp -P 10022 ROOT.war root@172.17.42.1:/usr/local/share/jboss/standalone/deployments/ROOT.war
user:root
password:rhemubuntu

第一次测试

http://127.0.0.1:18080/
Hello empty project

OK

停止容器

alias dl='docker ps -l -q'
docker stop `dl`

提交更改

docker commit -run='{"Cmd": ["/usr/bin/supervisord"]}' `dl` poseidonjm/empty

再次运行

docker run -d -p 8080:8080 -p 10022:22 poseidonjm/empty

第二次测试

http://127.0.0.1:18080/
Fail

查看 jboss 日志

ssh root@172.17.42.1 -p 10022
vim /usr/local/share/jboss/standalone/log/server.log

最佳答案

我遇到了同样的问题并通过删除解决了它

/standalone/configuration/standalone_xml_history/current

尝试在你的 docker 文件中添加这一行

RUN rm -rf /usr/local/share/jboss/standalone/configuration/standalone_xml_history/current

关于java - jetty worker jboss7 war 提交。服务器启动以不可恢复的方式失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20965737/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com