Old WAR version stuck and is being deployed in JBOSS Application Server
Followed by 2 people
I have JBOSS 14.0.11-Final (JBOSS 7.2) installed as an Application Server in Intellij Ultimate 2019.2.4. I checked out a branch from GitHub for Application-1.0-RELEASE.WAR version. I did a maven build, added the WAR artifact to JBOSS under Application Servers, started the server in Debug mode, and proceeded with my testing.
I then checked out a different branch for the same application, without shutting down JBOSS, for Application-1.1-RELEASE.WAR version, did a new maven build, and then restarted my JBOSS application server. However, on startup, the Application Server is giving me the below error stating that it cannot locate the OLD artifact even though it should be deploying the new artifact as per the application_war.xml file in the .idea directory.
11:50:02,596 MSC000001: Failed to start service jboss.deployment.unit."application-1.0-release.war".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."application-1.0-release.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "application-1.0-release.war"
at org.jboss.as.server@6.0.12.Final-redhat-00001//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:151)
at org.jboss.msc@1.4.5.Final-redhat-00001//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1738)
at org.jboss.msc@1.4.5.Final-redhat-00001//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1700)
at org.jboss.msc@1.4.5.Final-redhat-00001//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1558)
at org.jboss.threads@2.3.2.Final-redhat-1//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.2.Final-redhat-1//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads@2.3.2.Final-redhat-1//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads@2.3.2.Final-redhat-1//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0160: Failed to mount deployment content
at org.jboss.as.server@6.0.12.Final-redhat-00001//org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:95)
at org.jboss.as.server@6.0.12.Final-redhat-00001//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:144)
... 8 more
Caused by: java.io.FileNotFoundException: APPLICATION_DIRECTORY\target\application-1.0-release.war (The system cannot find the file specified)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
at org.jboss.vfs@3.2.14.Final-redhat-00001//org.jboss.vfs.spi.RootFileSystem.openInputStream(RootFileSystem.java:51)
at org.jboss.vfs@3.2.14.Final-redhat-00001//org.jboss.vfs.VirtualFile.openStream(VirtualFile.java:318)
at org.jboss.vfs@3.2.14.Final-redhat-00001//org.jboss.vfs.VFS.mountZipExpanded(VFS.java:533)
at org.jboss.as.server@6.0.12.Final-redhat-00001//org.jboss.as.server.deployment.DeploymentMountProvider$Factory$ServerDeploymentRepositoryImpl.mountDeploymentContent(DeploymentMountProvider.java:108)
at org.jboss.as.server@6.0.12.Final-redhat-00001//org.jboss.as.server.deployment.module.DeploymentRootMountProcessor.deploy(DeploymentRootMountProcessor.java:91)
... 9 more
JBOSS is still trying to deploy the previous WAR file version even though I have swiched branches to a different WAR file version of the same application. As a result, the below error occurs due to <context-root> conflict in the jboss-web.xml
WFLYCTL0186: Services which failed to start: service jboss.deployment.unit."application-1.1-release.war".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment "application-1.1-release.war"
I have done the following steps in my attempts to fix this issue:
- Removed all artifacts from the Application Server JBOSS and restarted JBOSS
- Invalidate caches / restart in Intellij
- Shutdown Intellij, deleted all TMP folders in JBOSS and ensured no files existed inside of standalone\deployments
- Switch back to previous Application-1.0-RELEASE.WAR branch, add the artifact to Application Server JBOSS, remove the artifact, and then restart JBOSS
None of the above has worked. JBOSS still seems to believe that Application-1.0-RELEASE.WAR has been added as a deployable artifact and continues to attempt to deploy that artifact version whenever JBOSS is started regardless if there are artifacts added to the JBOSS Application Server or not.
IntelliJ IDEA 2019.2.4 (Ultimate Edition)
Build #IU-192.7142.36, built on October 29, 2019
Runtime version: 11.0.4+10-b304.77 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1961M
Cores: 8
Registry:
Non-Bundled Plugins: net.vektah.codeglance, org.jboss.forge.plugin.idea, Pythonid
Please sign in to leave a comment.
Please try with the clean JBoss installation.
After more searching I finally stumbled across a solution. Thank you, Serge Baranov, for mentioning that JBoss itself may be the culprit; however, a complete JBoss installation was not an option I wanted to go down due to corporate red tape.
What I found to be the root of my problem was that the standalone.xml configuration file inside of jboss > standalone > configuration had a <deployments> entry that was still pointing to the older WAR version. Shutting down the JBoss server and deleting the <deployments> entry resolved my issue.
I am still rather new to doing development in Intellij and was unaware of the method in which artifacts were being deployed into JBoss. Other IDEs physically copy the WAR into the jboss > standalone > deployments directory. It seems Intellij takes a different route by updating the standalone.xml configuration.
You are right. IntelliJ IDEA instructs the app servers to perform the deployment directly from the configured artifact output directory. It save time copying the file to the deployment directory.