4 Replies Latest reply on Aug 12, 2014 7:43 AM by Jess Holle

    Explicit deployments removed upon failure of auto-deployment?

    Jess Holle Newbie

      In standalone-full.xml I have:

       

      <deployments>
          <deployment name="MyWebApp.war" runtime-name="MyWebApp.war" enabled="true">
              <fs-exploded path="../../SomeDir/MyWebApp.war" relative-to="jboss.home.dir"/>
          </deployment>
      </deployments>

       

      and also:

       

      <subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
        <deployment-scanner name="1" path="../../../Applications" relative-to="jboss.server.base.dir" scan-interval="5000" auto-deploy-exploded="true"/>
      </subsystem>

       

      So far so good.  Everything seems to work great -- until one of the auto-deployed applications fails to deploy.  At this point Wildfly seems to remove the explicitly specified <deployments> element from standalone-full.xml, which seems quite wrong.

       

      Does anyone have an explanation for this?  Is this a clear bug that should be filed as such?

        • 1. Re: Explicit deployments removed upon failure of auto-deployment?
          jaikiran pai Master

          Are you manually editing those xml files to add the deployments (while server is running)? You shouldn't be doing that. Instead use the tools like admin console or the CLI to add the deployments so that the management API is aware of those deployments.

          • 2. Re: Explicit deployments removed upon failure of auto-deployment?
            Jess Holle Newbie

            We are editing that file (via XSLT) prior to ever starting the server, not while it is running.

            • 3. Re: Explicit deployments removed upon failure of auto-deployment?
              Wolf-Dieter Fink Master

              The deployments element is handled by the management actions, if you need to change it I recommend to use CLI or management console.

              If you add something by hand the server management might remove it if the deployment failed.

               

              The deployment-scanner is different as here you have so called unmanaged deployments and you can add remove it via filesystem and it's marker files

              • 4. Re: Explicit deployments removed upon failure of auto-deployment?
                Jess Holle Newbie

                I eventually figured out how to deploy an exploded war directory via the CLI.  It was far from obvious to me at least:

                 

                /deployment=MyWebApp.war/:add(runtime-name=MyWebApp.war,content=[{archive=false,path="../../SomeDir/MyWebApp.war",relative-to="jboss.home.dir"}])

                 

                That said, that doesn't help.

                 

                A deployment failure in an exploded application deployed via the deployment scanner causes the explicitly specified <deployment> elements in standalone-full.xml to be removed from the configuration.  This occurs irrespective of the value used for the auto-deploy-exploded attribute.  The deployment scanner tries to undeploy all applications upon the failure of one application and removes the <deployment> element entirely for explicit deployments of exploded applications.

                 

                Manually deploying everything via <deployment> elements seems to resolve the issue.  If approached this way, a failure in one application no longer makes any attempt to undeploy other applications -- which would seem to make far more sense.  Also, other automatic changes to the standalone-full.xml file (e.g. a change to a log level via JMX) do not remove the manually inserted <deployment> elements, so this errant behavior seems quite specific to the deployment scanner.

                 

                Overall this really seems like a bug in the deployment scanner behavior and I have filed WFLY-3726 accordingly.