7 Replies Latest reply on Dec 27, 2012 10:04 AM by Sham HC

    Issue with unbinding of configurations from old jars

    Ashish Saxena

      Hi,

       

      We have a setup where we deploy some of the business services and configurations (Java code) into CQ5 so that they can be managed through Apache console.

      We are facing a problem where if we deploy a new version of the jar, the configurations still continue to get binded with the old version of the jar and we need manually unbind and bind the configurations.

       

      We have tried the following but in vain:

      Deleting the old jars from /apps/<application name>/install folder.

      Deleting the bundles from the Apache console and deploying the new jars

       

      Please note that we do not have any custom activators for the bundles, but rather rely on OSGi dependency management to start up the services and configurations.

       

      What I wanted to check with the group is if someone has faced a similar issue and if you are aware of the resolution for the same.

       

      Ashish

        • 1. Re: Issue with unbinding of configurations from old jars
          Yogesh Upadhyay Level 4

          Ashish,

           

          Are these configuration are hard coded in java class or managed through osgiCofig. For me managing configuration through osgiConfig always works without any issue. Also some time jar binding that you see in config tab UI is misleading though it bind to correct jar.

           

          Yogesh

          www.wemblog.com

          • 2. Re: Issue with unbinding of configurations from old jars
            rush_pawan Level 4

            Hello Ashish,

             

            Ideally you should not require to do that. But some points as suggestion

             

            1. When you build the bundle does it says your deployment is successful because it may happen that it built but not deployed, for that just check your error.log also for each deployment console update corresponding log information in error.log only.

            2. also check the last modification time for your bundle deployed in felix console under "bundles" tab.

             

            As yogesh suggested managing service configuration through osgiConfig is better approach as it give you flexibility (no hot deployment for each changes) and helps you to manage services better.

             

            Thanks,

            Pawan

            • 3. Re: Issue with unbinding of configurations from old jars
              Ashish Saxena Level 1

              Hi Yogesh,

               

              These configurations are created as osgi:config and we use teh /apps/<app name>/runmodes/ folder to store these configurations.

              The problem is primarily when we do a new release of the application where the version is modified for teh jar and we get teh issue that it continues to remain binded with the old jars versions.

               

              Ashish

              • 4. Re: Issue with unbinding of configurations from old jars
                Ashish Saxena Level 1

                Hi,

                 

                Yes we see the bundles deployed and updated timestamp for the same. However whne we see teh configurations in the system/console, we still see old version tied to the configurations due to which it does not pick the new version of configurations.

                 

                Ashish

                • 5. Re: Issue with unbinding of configurations from old jars
                  rush_pawan Level 4

                  Hello Ashish,

                   

                  Pretty strange because felix handles the deployment based on jars timestamp and as you said timestamp is latest in bundle deployment information (in system/console).

                   

                  1. Can you also check the MANIFEST file "Bundle-Version" property where it uses the correct version of your jar (you can do that by unzipping the latest deployed jar)

                  2. Just delete the complete bundle from "system/console" and deploy it again using your standard way of deployment.

                   

                  Thanks,

                  Pawan

                  • 6. Re: Issue with unbinding of configurations from old jars
                    Ashish Saxena Level 1

                    Hi,

                     

                    Checked that the version is correctly placed in the manifest file

                    Even with removing the bundles from system/console am not able to remove the binding and after deployment if continues to remain binded with the old version.

                     

                    Also while deploying the bundle, I have seen the following error in the logs:

                    *ERROR* [FelixStartLevel] org.apache.felix.scr Cannot use configuration pid=<configuration> for bundle jcrinstall:/apps/<website>/install/<jar with new version>.jar because it belongs to bundle jcrinstall:/apps/<website>/install/<jar with old version>.jar

                    • 7. Re: Issue with unbinding of configurations from old jars
                      Sham HC Level 7

                      Hi Ashish,

                       

                         This is kind of strange & possibility might be file permission issue. Please file daycare.   As a temporary workaround shutdown the instance & delete/move OR modify your bundle specific configuration file  [1] & start the instance and verify.

                       

                      [1]   <cq_home>/crx-quickstart/launchpad/config/*/../*.config

                       

                      Thanks,

                      Sham