Announcement Announcement Module
Collapse
No announcement yet.
How to deploy with tcsadmin Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to deploy with tcsadmin

    I am trying to deploy from a command line with tcsadmin, but am having difficulty. To deploy, my application needs both a war and <context>.xml file.

    I have tried putting the context file out in conf/Catalina/localhost first using tcsamdmin put-file, as well as putting the war out first with deploy-application, but neither seems to actually deploy the war and context file properly.

    Any tips on deploying a war that requires a context.xml file with tcsadmin? Currently, with plain tomcat, we simply copy out both the .xml and .war files, and it deploys. We would like to use tcsadmin, however, so we can deploy to groups more easily.

    Thanks!

  • #2
    The easiest would be to take the application context XML file, rename it to context.xml and put it into the WAR-file/META-INF directory
    This would be the same for Apache Tomcat as tcServer, then you only copy out the WAR file, and Tomcat reads the context.xml file from the war file and copies it out to the conf/Catalina/localhost directory
    Deploying first a WAR file, then an XML file, would be like deploying the same app twice on either container

    best
    Filip

    Comment


    • #3
      Unfortunately we can't embed the context.xml because we specify database connection information there and don't want the war to change between environments.

      We specify database there, instead of globally, so each application has specific max/min/etc.. definitions.

      Hmmm, maybe this isn't possible with tcsadmin?

      Comment


      • #4
        Originally posted by roadtripryan View Post
        I am trying to deploy from a command line with tcsadmin, but am having difficulty. To deploy, my application needs both a war and <context>.xml file.

        I have tried putting the context file out in conf/Catalina/localhost first using tcsamdmin put-file, as well as putting the war out first with deploy-application, but neither seems to actually deploy the war and context file properly.

        Any tips on deploying a war that requires a context.xml file with tcsadmin? Currently, with plain tomcat, we simply copy out both the .xml and .war files, and it deploys. We would like to use tcsadmin, however, so we can deploy to groups more easily.

        Thanks!
        Did you restart the tc Server tomcat after you used the put-file for the context.xml?

        -Jason

        Comment


        • #5
          Ryan, pardon me, I didn't correctly read your system.
          Right now you are doing
          1. deploy app
          2. put file

          when what you need to do is
          1. put file (war file to a dir outside of webapps)
          2. put file (your XML file to conf/Catalina/localhost) pointing to the war file

          deploy app doesn't retain the .war file itself, it explodes it into the webapps directory

          Comment


          • #6
            Originally posted by fhanik View Post
            Ryan, pardon me, I didn't correctly read your system.
            Right now you are doing
            1. deploy app
            2. put file

            when what you need to do is
            1. put file (war file to a dir outside of webapps)
            2. put file (your XML file to conf/Catalina/localhost) pointing to the war file

            deploy app doesn't retain the .war file itself, it explodes it into the webapps directory
            hi ryan, Jason corrected me. It does copy the WAR file over during deploy-app, however it doesn't wait for tomcat to deploy it in the back ground process, instead it is instantanous deployment. let me explain

            in Apache Tomcat right now, you are doing put-file, put-file
            so that is what you would want to do with tcsadmin too
            That would become this process
            1. copy out war file (tomcat doesn't detect it, background process hasn't ran yet)
            2. copy out XML file
            3. tomcat background process runs
            4. tomcat detects XML file, deploys XML which deploys the WAR file


            When you do deploy-app in tcServer, the deploy-app is a synchronous step in step 1 and the application attempts deployment in step 1, which may fail if you rely on info in the context.xml file

            However, for both Apache Tomcat and tcServer (since the Tomcat piece is the same) when you do put-file (or manual copy for Apache tomcat) the war file should not go into the webapps directory, as you risk it being auto deployed before the XML file makes its way out. (ie, you can't predict when tomcat's background process will run)

            Comment


            • #7
              Originally posted by fhanik View Post
              Ryan, pardon me, I didn't correctly read your system.
              Right now you are doing
              1. deploy app
              2. put file

              when what you need to do is
              1. put file (war file to a dir outside of webapps)
              2. put file (your XML file to conf/Catalina/localhost) pointing to the war file

              deploy app doesn't retain the .war file itself, it explodes it into the webapps directory
              Tried it both ways. What appears to be working now is put-file on the .xml file, then deploy-application on the war. The change, however, is to make the server.xml not autoDeploy. With that turned off, I seem to be getting deployments now.

              Comment


              • #8
                Originally posted by roadtripryan View Post
                Tried it both ways. What appears to be working now is put-file on the .xml file, then deploy-application on the war. The change, however, is to make the server.xml not autoDeploy. With that turned off, I seem to be getting deployments now.
                yes, that will work as long as autoDeploy is turned off.
                Same thing would have been
                put-file my.war /temp/my.war
                put-file my.xml conf/Catalina/localhost
                contents of my.xml
                <Context docBase=/temp/my.war" ....
                with autodeploy turned to true.
                Same effect.

                When you call deploy-app my.war, it tries to locate the my.xml file which you copied out in step 1. hence it worked.

                Comment


                • #9
                  Originally posted by fhanik View Post
                  yes, that will work as long as autoDeploy is turned off.
                  Same thing would have been
                  put-file my.war /temp/my.war
                  put-file my.xml conf/Catalina/localhost
                  contents of my.xml
                  <Context docBase=/temp/my.war" ....
                  with autodeploy turned to true.
                  Same effect.

                  When you call deploy-app my.war, it tries to locate the my.xml file which you copied out in step 1. hence it worked.
                  Thanks for the clarification. Trying to put the war with the tcsadmin put-file gave me an agent EOF error and killed the agent. The war is rather large, so I suspect file size may have been the issue.

                  Comment


                  • #10
                    Originally posted by roadtripryan View Post
                    Thanks for the clarification. Trying to put the war with the tcsadmin put-file gave me an agent EOF error and killed the agent. The war is rather large, so I suspect file size may have been the issue.
                    Ryan,

                    What size is "rather large" for your war file?

                    Which version of tc Server did you download? The agent EOF issue should have been resolved in the latest release "public beta"/tcserver-beta3.

                    Thanks,
                    Jason

                    Comment


                    • #11
                      I am using the public beta, downloaded and setup yesterday.

                      The war is 30MB.

                      Comment


                      • #12
                        Originally posted by roadtripryan View Post
                        I am using the public beta, downloaded and setup yesterday.

                        The war is 30MB.

                        Ryan,

                        Yeah, there is an issue with files that size. A ticket was opened against it. The only way to get around it right now, is to increase the max heap on your agent, by changing the agent.javaOpts in the agent.properties file. Or just continue with the way you have it working now, until the fix is in.

                        Jason

                        Comment

                        Working...
                        X