Upgrade Tomcat

Version 1
    Share:|

    Hi Team,

     

    I have seen couple question lies around upgrading tomcat from older to new version, So I made this document to make this task easy.

    I completed this installation from tomcat 7 to tomcat 8.5 with Midtier 9.1 and windows 2012 server.

     

    Below are the steps that i have followed

     

    >>> Stop tomcat 7.x services so this will free port which was in use.

     

    >>> Install tomcat 8.5 with port 8080 (if you want to change the port then you can change at the time of installation or from server.xml file)

     

    >>> Once it is successfully installed you need to copy files from old version to new version ie. from tomcat 7 to tomcat 8.

     

    >>> If you installed Midtier with AR installer then you need to copy arsys.xml  files from “<Drive>\Program Files\Apache Software Foundation\Tomcat7.x\conf\Catalina\localhost\” paste it to “<Drive>\Program Files\Apache Software Foundation\Tomcat8.5\conf\Catalina\localhost\” location.

     

    >>> If you deployed Midtier.war file in webapps folder then you can copy all files from “<Drive>\Program Files\Apache Software Foundation\Tomcat7.x\webapps\” paste it to

    “<Drive>\Program Files\Apache Software Foundation\Tomca8.5\webapps\” location.

     

    >>> If you want to use old tomcat configuration then  you need copy Server.xml ,context.xml and web.xml from tomcat7.x\conf folder and replace in tomcat 8.5\conf.

     

    >>> You can make Heap size configuration by double clicking on tomcat8w.exe on below location “<drive>\Program Files\Apache Software Foundation\Tomcat 8.5\bin\”


    You can increase heap size from 1024mb  to max 2048 mb (You can change as per your requirement and application available on tomcat ) please find below screenshot.

     

    Click apply and ok .

     

    >>> you can start services of tomcat 8.5 , if you find due to any reason services not starting then then you can check logs present in tomcat 8.5\logs\

     

      -> primarily you can check catalina,tomcat8-stderr and tomcat8-stdout logs

      -> If you found error like Address Bind then it is the issue of port ie. if your tomcat8.5     want to use port 8080 and it is already in use with tomcat 7 then this type of

    Issue occurred.

    -> If you found error like

    “ org.apache.catalina.startup.HostConfig.deployDirectories Error waiting for multi-thread deployment of directories to complete

    java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded

      at java.util.concurrent.FutureTask.report(Unknown Source)

      at java.util.concurrent.FutureTask.get(Unknown Source)

      …...

    Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded

      at java.util.Arrays.copyOf(Unknown Source)

      at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)

      at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source)

      at java.lang.AbstractStringBuilder.append(Unknown Source)

      at java.lang.StringBuilder.append(Unknown Source)

      at java.lang.StringBuilder.append(Unknown Source)

      at java.lang.Throwable.printStackTrace(Unknown Source)

      at java.lang.Throwable.printStackTrace(Unknown Source).....“

     

    Then it is garbage collection issue and for solution you need to increase  Heap Size and need to restart  services.

     

     

     

    This is how you can upgrade tomcat.

     

    NOTE: Before replacing any file or deleting any content make sure to take back up.

     

    This steps i have done on my machine recommended to follow this steps on Dev or test server first.

     

    Hope you get knowledge from this document if you feel any information is missing or required to add more information feel free to comment.

     

     

    Regards,

    Harish Saitwal