问题描述
我正在开发一个Web应用程序并将(使用IntelliJ)部署到WildFly 10.1。我最近重命名了我的webapp模块,导致我的 war 文件从 foo.war
重命名为 bar.war
。每次我启动时,都会收到此错误:
I am developing a web application and deploying (with IntelliJ) to WildFly 10.1. I recently renamed my webapp module, which results in renaming my war file from foo.war
to bar.war
. Every time I start up, I get this error:
12:24:15,899 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."foo_war_exploded.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."foo_war_exploded.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "foo_war_exploded.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160: Failed to mount deployment content
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:95)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
Caused by: java.io.FileNotFoundException: /.../foo_war_exploded (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:51)
at org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:318)
at org.jboss.vfs.VFS.mountZipExpanded(VFS.java:533)
at org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:108)
at org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91)
... 6 more
...
[2017-04-23 12:24:18,957] Artifact bar:war exploded: Artifact is deployed successfully
请注意,部署(和取消部署)重命名的 war 可以正常工作。我无法取消部署旧战争的剩余部分。
Notice that deploying (and undeploying) the renamed war works fine. I just can't undeploy the leftover of the old war.
如何取消部署WildFly中的所有工件以重新制作开始?
推荐答案
这里有多个选项:
-
通过 Maven :
-
添加野生蝇插件参数和到
< project>< build>部分的
:pom.xml
< plugins>
add the wildfly plugin parameters
matchPattern
andmatchPatternStrategy
to yourpom.xml
in the section<project><build><plugins>
:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<!-- use regular expressions here -->
<matchPattern>(foo|bar).war</matchPattern>
<matchPatternStrategy>all</matchPatternStrategy>
</configuration>
</plugin>
(遗憾的是,没有预定义的相应CLI属性)
并从控制台运行
mvn wildfly:undeploy -Dwildfly.hostname = XXX -Dwildfly.port = 9993 -Dwildfly.username = XXX -Dwildfly.password = XXX -Dwildfly.protocol = https-remoting
(或在IDE中设置等效的运行配置
(or setup an equivalent run configuration in your IDE)
通过 WildFly命令行界面(CLI):
- 运行
jboss-cli -c controller = https- remoting:// XXX:9993 -u = XXX
- 输入您的密码然后
-
取消部署
(按发现工件)
- run
jboss-cli -c controller=https-remoting://XXX:9993 -u=XXX
- type in your password and then
undeploy
(discover artifacts by pressing )
通过 WildFly Web管理界面:
- 访问例如
https:// XXX:9993 / console / App.html#standalone-deployments
- 选择工件并从中选择删除下拉菜单
这篇关于如何从WildFly中取消部署所有工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!