Charan,
In weblogic 9.x and higher, there is a concept of locking and unlocking in weblogic admin console. i.e, you click on lock button in console to start deploying and make changes (I guess the button no top left corner goes green). When you are done with changes, you release that lock by clicking on "Apply changes" button. i.e same button.
Now, in one of your browser sessions you already have that locked it. And when you try to deploy through command prompt, it is trying to aquire the lock as well. Hence this exception.
Soln: Release the lock by clicking on the button in top left most corner (first button) by logging into admin console. Now, run this ant script from command line.