4 Replies Latest reply on Jan 18, 2018 3:18 PM by ssri RSS
    ssri Newbie

    Updated TW Extension not reflected without restart the server

    I have developed a ThingWorx Extension and deployed on cloud instance.

    After deleting the existing Extension from cloud instance, import updated Extension. But updated extension has not been reflected. It is reflecting the older extension version. Changes has been reflect on development environment, while restarting the server. But restart the server on cloud is not possible for me because there are other applications are also running on cloud instance. Any alternative without restart the cloud instance and my updated ThingWorx Extension will reflect. Please help me for the same.

      • Re: Updated TW Extension not reflected without restart the server
        carlesc Heavyweight Champ



        If it's a Server Side Extension ( aka Java extension ) you need to restart Tomcat, otherwise you won't see the updates.


        For now thats the only way.



          • Re: Updated TW Extension not reflected without restart the server
            ssri Newbie

            Thanks, Carles for quick reply.

            • Re: Updated TW Extension not reflected without restart the server
              stefanbod Apprentice

              For me it is quite interesting, that you can ADD extensions without restart but cannot REMOVE them without restart.


              Ok, normally you will not REMOVE an extension but UPDATE the existing one with a newer version. On really large instances of ThingWorx this can by a pain point at least in the future. I had the same with the MQTT extension extension where different versions where available. My first "think simple" try was to IMPORT the new version and hope the old one gets UPDATED. This is what users like me are expecting. At the end I go the long way with delete, import and restart...

                • Re: Updated TW Extension not reflected without restart the server
                  thearonh Apprentice

                  Stefan - this is a pain point that many before you have encountered.


                  The underlying reason for this restart requirement is that the JVM running the Extension code is the same JVM that is running the Thingworx instance. Adding new code to a running jvm is a simple matter of instantiating a new classloader for the jar because you can make a some assumptions. For example, there are no other dependencies on the code (because its new) and there aren't any objects that need to be de-instantiated or rebuilt because a dependency has been updated.

                  Those things all need to be managed manually on an UPDATE and are certainly not trivial.  The JVM simply cannot release resources that have any sort of dependency on the running environment, and as soon as an extension is loaded, dependencies get made in the JVM and the more complex the Extension, the more difficult it is to know and understand what needs to be managed upon UPDATE.


                  I know this doesn't help the issue, but I was hoping to give you a little more context into why things are the way they are currently and also let you know that we have spent considerable development effort attempting to remedy this for Extension developers.  This is an issue that we continue to re-address and have certainly not forgotten about.