2 Replies Latest reply on Jul 10, 2010 5:21 AM by Emanuel Muckenhuber

    MainDeployer#isDeployed() used with an URL

    Ondrej Zizka Master

                  Hi,

       

      I'm deploying various files via MainDeployer bean of EAP 5.1, using code such like this:

       

      return this.server.invoke(
        new ObjectName("jboss.system:service=MainDeployer"), 
        "deploy",
        new Object[] { url }, 
        new String[] { "java.net.URL" }
      );
      
      

       

      And then checking if it's deployed, using the same URL:

       

      return this.server.invoke(
        new ObjectName("jboss.system:service=MainDeployer"), 
        "isDeployed",
        new Object[] { url }, 
        new String[] { "java.net.URL" }
      );
      

       

      With some deployables, it works, even with other wars, but not with a particular one - a JSF app with jboss-web.xml with "default values" (as far as I was able to find defaults)  - isDeployed() still returns false.  undeploy() shows no errors, but the war is not undeployed.

       

      EAP log shows no errors and confirms deployment:

       

      02:27:53,727 INFO  [MainDeployer] deploy,  url=file:/home/ondra/work/perf-eap/JsfJpa2.war
      

       

      Any idea what can be wrong?

      Thanks, Ondra

        • 1. Re: MainDeployer#isDeployed() used with an URL
          Ondrej Zizka Master

          Solved: There was yet another war causing collisions.

           

          However, what is not clear to me, is why EAP did not show any errors every second try to deploy.

          • 2. Re: MainDeployer#isDeployed() used with an URL
            Emanuel Muckenhuber Master

            Ondrej Zizka wrote:

             

            However, what is not clear to me, is why EAP did not show any errors every second try to deploy.

            The deployer you are using is the legacy JMX deployer org.jboss.deployment.MainDeployer and just delegates everything to the VDF. The deploy() method should tell you why it won't fail on subsequent calls:

             

             

               public void deploy(URL url) throws DeploymentException
               {
                  log.info("deploy, url="+url);
                  String deploymentName = contextMap.get(url);
                  // if it does not exist create a new deployment
                  if (deploymentName == null)
                  {
                     try
                     {
                        ....
                        VFSDeployment deployment = deploymentFactory.createVFSDeployment(file);
                        delegate.addDeployment(deployment);
                        deploymentName = deployment.getName();
                        delegate.process();
                        contextMap.put(url, deploymentName);
                        delegate.checkComplete(deployment);
                     }
                     catch(Exception e)
                     {
                         ...
                     }
                  }
               }