9 Replies Latest reply on Feb 26, 2006 10:52 AM by sushant248

    remote deployment

    sushant248

      I am new to JBoss and I've been asked to write alittle batch script to deploy application on Jboss server( assume all enviroment variables, classpaths etc are correct). Please tell me how can I remotely deploy my ear on JBoss server from command line. I know weblogic where I can use the foll command:
      java weblogic.Admin -url http://CO-Bank:8000 -username weblogic -password weblogic START COBANKManagedServer.
      Thanks in anticipation.

        • 1. Re: remote deployment

          This is the easy part with JBoss : you just have to drop the ear in the deploy dir ! Use FTP, NFS or whatever is avaible to copy a file on a remote host

          • 2. Re: remote deployment
            sushant248

            cheers mate. Didn't realise it was that easy and hot deployment was supported. I might need to bring down the server to rename (keep a copy of) deployed ear before I copy my ear.
            Weblogic.Admin and Wsadmin (of Websphere) start/stop remote server from local console but the execution of command takes place on the remote server i.e logs etc are there on server. I'm sure with JBoss too, I can start/stop server from my local machine.
            Your help is greatly appreciated.

            • 3. Re: remote deployment
              sushant248

              Please tell me where should i put the authentication while doing the deployment on remote server? JBoss suppots hot deployment (i can see the deployment scanner logs in the console), but like weblogic where i provide the username / pswd while doing a deployment from local machine onto a server, where do i mention that for JBoss?
              Is there any command which i can run on DOS prompt where i can give authentication info as argument?

              • 4. Re: remote deployment

                You just have to drop the ear (or sar or whatever) and voila it is deployed. No authentification is required by JBoss to do that.
                If you want to secure this, you can either disable hot deployment or restrict write access to the deploy dir.

                • 5. Re: remote deployment
                  sushant248

                  Thanks. How do i disable hot deployment? in that case how do i remotely stop the server from command prompt?

                  • 6. Re: remote deployment

                    Edit jboss-service.xml under server/xxx/conf to disable hot deploy.
                    shutown.bat/shutdown.sh

                    You should read the docs ...

                    • 7. Hot deployment
                      sushant248

                      By replacing ear in the /deploy directory, i can see in the console that the scanner has read the change but when i see the changes on the browser, they are not reflected. If it's a simple war, then changes are reflected instantly but when this war inside an ear (and nothing else), i can't see the updated file.
                      If i remove it from
                      C:\jboss-4.0.3SP1\ server\default\work\jboss.web\localhost
                      and then replace this ear, the changes are reflected.

                      After making changes in the jboss-service.xml (uncommenting code for hot deployment), i got

                      Incomplete Deployment listing:

                      --- MBeans waiting for other MBeans ---
                      ObjectName: jboss.deployment:flavor=URL,type=DeploymentScanner
                      State: FAILED
                      Reason: org.jboss.deployment.DeploymentException: Exception setting attribute
                      javax.management.Attribute: name=Deployer value=jboss.deployment:type=Deployment
                      Cache on mbean jboss.deployment:flavor=URL,type=DeploymentScanner; - nested thro
                      wable: (java.lang.RuntimeException: Error creating MBeanProxy: jboss.deployment:
                      type=DeploymentCache)
                      I Depend On:
                      jboss.deployment:type=DeploymentCache

                      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                      ObjectName: jboss.deployment:type=DeploymentCache
                      State: NOTYETINSTALLED
                      Depends On Me:
                      jboss.deployment:flavor=URL,type=DeploymentScanner


                      Please help. Thanks in advance

                      • 8. Re: remote deployment

                        You should NEVER touch files in the work dir, this is a JBoss. If you need to redeploy a war that's in an ear, you've got to redploy the whole ear.

                        To disable hot deploy

                        <!-- An mbean for hot deployment/undeployment of archives.
                        -->
                        <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner"
                        name="jboss.deployment:type=DeploymentScanner,flavor=URL">
                        ...
                        
                        <attribute name="ScanPeriod">5000</attribute>
                        <attribute name="ScanEnabled">False</attribute>
                        ...
                        </mbean>
                        


                        • 9. Re: remote deployment
                          sushant248

                          exactly. That is what i'm doing - redeploying my whole ear but it is not working. Scanner shows that new deployment has happened with the same ear name but it keeps showing the old jsps (as if it has cached them). If i go to the work directory n see the jsp there, it too doesn't have the changes of new ear. What else could be the reason that it doesn't get hot deployed? I haven't changed any of the jboss-service.xml etc files