5

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

Notice that deploying (and undeploying) the renamed war works fine. I just can't undeploy the leftover of the old war.

How do I undeploy all artifacts from WildFly to make a fresh start?

Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120

2 Answers2

8

You have multiple options here:

  1. via Maven:

    • add the wildfly plugin parameters matchPattern and matchPatternStrategy to your pom.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>
      

      (unfortunately there are no predefined corresponding CLI properties)

    • and run from a console

      mvn wildfly:undeploy -Dwildfly.hostname=XXX -Dwildfly.port=9993 -Dwildfly.username=XXX -Dwildfly.password=XXX -Dwildfly.protocol=https-remoting

      (or setup an equivalent run configuration in your IDE)

  2. via WildFly Command Line Interface (CLI):

    • run jboss-cli -c controller=https-remoting://XXX:9993 -u=XXX
    • type in your password and then
    • undeploy (discover artifacts by pressing TAB)
  3. via WildFly Web Management Interface:

    • visit e.g. https://XXX:9993/console/App.html#standalone-deployments
    • select the artifact and choose 'Remove' from the dropdown menu
Jens Piegsa
  • 7,399
  • 5
  • 58
  • 106
  • Thanks. In my case the WildFly admin port is `9990` instead of `9993`. In case others are looking for it, the output when WildFly starts up mentions it as `Detected server admin port: 9990`. – Geoffrey De Smet Apr 23 '17 at 18:41
  • 1
    @GeoffreyDeSmet `9993` is the default https port and `9990` the default http. – Jens Piegsa Apr 23 '17 at 19:05
  • Ah, this warn during startup probably explains why there is no `https` service at `9993` for me: `WARN [org.jboss.as.domain.management.security] (MSC service thread 1-5) WFLYDM0111: Keystore /.../wildfly-10.1.0.Final/standalone/configuration/application.keystore not found, it will be auto generated on first use with a self signed certificate for host localhost` – Geoffrey De Smet Apr 24 '17 at 07:14
  • How does the `LGPLv2.1` license of the wildfly plugin impact the project's license? – Bionix1441 Sep 01 '20 at 08:47
0

I have logged in through wildfly web console panel (http://127.0.0.1:9990/console/index.html) and then removed old deployed SNAPSHOT from deployment tab, then Re-run my wildfly server from Intellij again and now it is works for me. When i re-run my wildfly server from intellij, it it deployed new SNAPSHOT to the server, so it is working fine and problem is solved for me.