3 Replies Latest reply: Feb 10, 2014 2:49 AM by René van Wijk RSS

    WLS 12.1.2.0.0 : Another user (admin2) already owns the lock.

    Jan Vervecken

      hi

       

      Please consider a WebLogic Server 12.1.2.0.0 that is NOT in Production Mode (so in Development Mode).

      When is a button like "Take Lock & Edit" (ever) to be expected?

      Or messages like :

      - "admin2 is currently making changes."

      - "Another user (admin2) already owns the lock. You will need to either wait for the lock to be released, or take the lock."

       

      If both users "admin1" and "admin2" are in the "Administrators" group,

      the following scenario (sc1) seems to be reproducible:

      - (sc1-a) start a first browser session and login on the WLS admin-server console using "admin1"

      - (sc1-b) start a second browser session and login on the WLS admin-server console using "admin2"

      - (sc1-c) in the second browser session, click Deployments

      - (sc1-d) in the first browser session, click Deployments and see the "Take Lock & Edit" button and messages

      -- "admin2 is currently making changes."

      -- "Another user (admin2) already owns the lock. You will need to either wait for the lock to be released, or take the lock."

       

      The scenario (sc1) is included in the screencast

      at http://screencast.com/t/Yw3k3EI1

       

      - (q1) Is the lock message in scenario (sc1) intended behavior?

       

      It could be that these "locks" are causing our Jenkins jobs (doing an Ant wldeploy task) to fail when someone is "browsing" using the WebLogic Server console, with

       

      weblogic.management.provider.EditWaitTimedOutException: Waited 0 milliseconds
          at weblogic.management.provider.internal.EditLockManager.getEditLock(EditLockManager.java:259)
          at weblogic.management.provider.internal.EditAccessImpl.acquireLock(EditAccessImpl.java:266)
          at weblogic.management.provider.internal.EditAccessImpl.startEdit(EditAccessImpl.java:297)
          at weblogic.deploy.internal.adminserver.EditAccessHelper.startEditSession(EditAccessHelper.java:72)
          at weblogic.deploy.internal.adminserver.operations.AbstractOperation.execute(AbstractOperation.java:236)
          at weblogic.management.deploy.internal.DeployerRuntimeImpl$2.run(DeployerRuntimeImpl.java:846)
          at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
          at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
          at weblogic.management.deploy.internal.DeployerRuntimeImpl.performDeployerActions(DeployerRuntimeImpl.java:840)
          at weblogic.management.deploy.internal.DeployerRuntimeImpl.deploy(DeployerRuntimeImpl.java:418)
      ...
      

       

      many thanks

      Jan Vervecken

        • 1. Re: WLS 12.1.2.0.0 : Another user (admin2) already owns the lock.
          Jan Vervecken

          fyi

           

           

          In the context of Oracle service request 3-8317539291 we received feedback that the behaviour in scenario (sc1) is intended behaviour.

           

           

          This is somewhat supported by the documentation section "Change Management in the Administration Console"

          at http://docs.oracle.com/middleware/1212/wls/DOMCF/changes.htm#i1122017

          where there is a note that says

          'The domain configuration locking feature is always enabled in production domains. It can be enabled or disabled in development domains. It is disabled by default when you create a new development domain. See "Enable and disable the domain configuration lock" in Oracle WebLogic Server Administration Console Online Help.'

           

           

          It is still not clear when/why we see this EditWaitTimedOutException from time to time.

           

           

          regards

          Jan Vervecken

          • 2. Re: WLS 12.1.2.0.0 : Another user (admin2) already owns the lock.
            Jan Vervecken

            fyi

             

            Some feedback we got in Oracle service request 3-8317539291 :

             

            ...

            A)

            > weblogic.management.provider.EditWaitTimedOutException: Waited 0 milliseconds

            >     at weblogic.management.provider.internal.EditLockManager.getEditLock(EditLockManager.java:259)

            >     at weblogic.management.provider.internal.EditAccessImpl.acquireLock(EditAccessImpl.java:266)

            >     at weblogic.management.provider.internal.EditAccessImpl.startEdit(EditAccessImpl.java:297)

            >     at weblogic.deploy.internal.adminserver.EditAccessHelper.startEditSession(EditAccessHelper.java:72)

            >     at weblogic.deploy.internal.adminserver.operations.AbstractOperation.execute(AbstractOperation.java:236)

            >     at weblogic.management.deploy.internal.DeployerRuntimeImpl$2.run(DeployerRuntimeImpl.java:846)

            >     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

            >     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

            >     at weblogic.management.deploy.internal.DeployerRuntimeImpl.performDeployerActions(DeployerRuntimeImpl.java:840)

            >     at weblogic.management.deploy.internal.DeployerRuntimeImpl.deploy(DeployerRuntimeImpl.java:418)

            ...

            B)

            > weblogic.management.ManagementException: [Deployer:149163]The domain edit lock is owned by another session in non-exclusive mode.

            >   This deployment operation requires exclusive access to the edit lock and therefore cannot proceed.

            >   If using "Automatically Aquire Lock and Activate Changes" in the Administration Console, then the lock will expire shortly, so retry this operation.

            >      at weblogic.deploy.internal.adminserver.operations.AbstractOperation.execute(AbstractOperation.java:224)

            >      at weblogic.management.deploy.internal.DeployerRuntimeImpl$2.run(DeployerRuntimeImpl.java:846)

            ...

            Exception A) is thrown when _another_ (different) admin user trying to get the Lock.

            For example admin1 owns the lock, and admin2 try to get the lock.

             

             

            Exception B) is thrown when the _same_ admin user, who owns currently a lock from another session (for example an console logon)

            try to run a second administrative task from another session (for example ant deploy on command line).

            ...

            regards

            Jan Vervecken

            • 3. Re: WLS 12.1.2.0.0 : Another user (admin2) already owns the lock.
              René van Wijk

              The answer to this "(q1) Is the lock message in scenario (sc1) intended behavior?" you already know. Just for good measure see the documentation on managing locks (5 Managing a Domain's Configuration with JMX). Note that in development mode the locking in the admin console is automatic, you can change this in Admin Console - click the preferences link, User Preferences tab, here you can change the 'Automatically Acquire Lock and Activate Changes' option.

               

              WebLogic provides a ConfigurationManagerMBean (http://docs.oracle.com/middleware/1212/wls/WLMBR/mbeans/EditServiceMBean.html?skipReload=true#ConfigurationManager) that provides methods for safely starting an edit session. You can use haveUnactivatedChanges (http://docs.oracle.com/middleware/1212/wls/WLMBR/mbeans/ConfigurationManagerMBean.html?skipReload=true#haveUnactivatedChanges) to check if there are any pending changes (this gives you an indication if someone that has taken a lock is doing some actual changes to the system, such that the ANT job can decide not to start an edit session). If there is an edit session going on and there are no pending changes you can call undoUnactivatedChanges (http://docs.oracle.com/middleware/1212/wls/WLMBR/mbeans/ConfigurationManagerMBean.html?skipReload=true#undoUnactivatedChanges) - now the ANT job can start a new edit session.

               

              The following example shows the use of the ConfigurationManager (in Java with JMX)

               

                                      Object[] unactivatedChanges = (Object[]) editConnection.getAttribute(configManager, "UnactivatedChanges");

                                      if (unactivatedChanges.length > 0) {

                                          System.out.println("ACTIVATING CHANGES");

                                          editConnection.invoke(configManager, "activate",

                                                  new Object[] { new Long(120000) }, new String[] { "java.lang.Long" });

                                      } else {

                                          System.out.println("CANCEL EDIT SESSION");

                                          editConnection.invoke(configManager, "cancelEdit", null, null);

                                      }

               

              More information can be found on using the EditService and ConfigurationManager can be found here: Middleware Snippets: Automatic Scaling an Application Using WebLogic (and the references therein).