java – 如何从WildFly中取消部署所有工件?

我正在开发一个Web应用程序并使用IntelliJ部署到WildFly 10.1.我最近重命名了我的webapp模块,这导致我的war文件从foo.war重命名为bar.war.每次我启动时,都会收到此错误:

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

请注意,部署(和取消部署)重命名的战争工作正常.我无法取消部署旧战争的剩余部分.

如何从WildFly中取消部署所有工件以重新开始?

解决方法:

这里有多个选项:

>通过Maven:

>将wildfly插件参数matchPatternmatchPatternStrategy添加到< project>< build>< plugins>部分中的pom.xml中:

<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中设置等效的运行配置)

>通过WildFly命令行界面(CLI):

>运行jboss-cli -c controller = https-remoting:// XXX:9993 -u = XXX
>输入您的密码然后
>取消部署(通过按TAB发现工件)

>通过WildFly Web管理界面:

>访问,例如https://开头XXX:9993 /控制台/ App.html#独立的部署
>选择工件并从下拉菜单中选择“删除”

上一篇:错误“java.lang.NoSuchMethodError:org.jboss.logging.Logger.getMessageLogger”


下一篇:linux – 从官方jboss / wildfly图像创建自定义图像时,standalone-full.xml的’权限被拒绝’错误