WebLogic Startup fails with Unable to obtain lock on Server may already be running

When you try to start weblogic server and if this fails with error message that “Unable to obtain lock on *.lok Server may already be running

________
weblogic.management.ManagementException: Unable to obtain lock on /u01/oid_domain/servers/wls_ods1/tmp/wls_ods1.lok. Server may already be running at weblogic.management. internal.ServerLocks. getServerLock (ServerLocks.java:159)
________

This could be because of two reasons

1) WebLogic Server (which you are trying to start) is already running.
2) WebLogic Server (which you are trying to start) did not stop cleanly.

When weblogic server starts, it creates two lock files
a) $DOMAIN_HOME/servers/<server_name>/tmp/<servermame>.lok
b) $DOMAIN_HOME/servers/<server_name>/data/ldap/ldapfiles/EmbeddedLDAP.lok

When WebLogic server stops, it removes these two files.

If you hit problem, first identifty if server is running on port configured for WebLogic Server by using netstat.

netstat -an | grep <WebLogic_Server_Port>

If server is running then you should see output like

tcp        0      0 ::ffff:<IP>:<weblogic_port>      :::* LISTEN  

(Listen here identifies that it is listening)

Note: There could be other process using this port

How to identify which port is configured for weblogic server?
To identify port configured for weblogic server open weblogic configuration file
$DOMAIN_HOME/config/config.xml and serach for listen-port

You should see entry like
<listen-port>8001</listen-port>

Note: There is one listen-port for every weblogic server (Admin & Managed)

If server is not running then you can safely remove these lok files under WebLogic server.

Note: If this is weblogic managed server (not Admin Server) then you can safely remove entire managed server directory (including sub directories) $DOMAIN_HOME/servers/<serverName> . When you start managed server again, Admin Server will create these directories.

Hitting any problem in Oracle WebLogic Server or Fusion Middleware ? Put them under comments section for reply. 

Did you get a chance to download Free Interview Questions related to WebLogic? If not, download it here http://k21academy.com/weblogic-interview-question

web

Learn Oracle Weblogic Server Administration

If you want to learn Oracle WebLogic Server Administration with tons of additional features like Live Interactive Sessions, Life time access to membership portal, Free re-taking sessions for next one year, Dedicated Machine to practice, On Job Support and much more

Click here to know more

About the Author Atul Kumar

Oracle ACE, Author, Speaker and Founder of K21 Technologies & K21 Academy : Specialising in Design, Implement, and Trainings.

follow me on:

Leave a Comment:

25 comments
Anand krishna says August 16, 2011

Excellent article, the site is always a great learning place.

Reply
Ahmed Naguib says September 10, 2011

very thanks for this post

Reply
Shanthi says October 30, 2011

A SOA Admin installed WLS 10.3.4 and SOA 11.1.1.4 on linux and configured soa_domain. After a month or so (there were some O/s related work done on the servers like more memory, upgrade O/s to redhat 2.6 etc) the admin forgot the password. After a few attemots, we saw the error every 30 minutes in my AdminServer log files. I deleted the inventory, middleware folder after uninstalling SOA. Please note that I did not do anything on the DB.

I later installed WLS, SOA SUite and configured using the same DB schemas. When I started the server the first time, the system automaticllly created the boot.properties file but I still see the same error. Any ideas? Do I need to clean out the DB as well?

Reply
Atul Kumar says October 31, 2011

@ Shanthi

What error message you are getting ?

Reply
Shanthi says October 31, 2011

I am sorry, I should have mentioned this in the earlier post.

The error message is “BEA-090078:User weblogic in security realm myrealm has had 5 invalid login attempts, locking account for 30 minutes”. I see this message every 30 minutes in AdminServer.log

Reply
Atul Kumar says October 31, 2011

@ Shanthi,
Is this happening regularly ? If this is the case then there is client which is configured to connect to Admin Server and weblogic password at client side is wrong. Monitor network to find client connecting to Admin Server

Reply
Shanthi says October 31, 2011

I start the AdminServer, it goes to running mode and within a few seconds, I start seeing the above message every 30 minutes. I cannot even logon to the console – Access Denied error. There is no client at this point – I have installed WLS 10.3.4 + SOA Suite 11.1.1.4 and configured the soadomain. That is all. I have not logged into console even once.

What perplexes me is even if I cleanout the entire middleware directory and resinstalled the above, I still see the same error. The onle thing I did not redo is the DB cleanup and the RCU before the reinstall. Is it possible that WLS stores something in the DB that it is locking despite the reinstall?

Reply
Atul Kumar says November 3, 2011

@ Shanthi,
Do you still see this problem when you install middleware in different directory and configure domain in different directory ?

Reply
Shanthi says November 3, 2011

Unfortunately I cannot install in a different directory. I need to have the same directory structure in this environment as my other SOA environments since we have a lot of scripts that we use to automate the maintenance. I have opened a SR for this issue. I will update this post when I get a resolution. Thanks for the follow up.

Reply
sudhagar says July 26, 2012

Error Code–Unable to obtain a lock
for this we may the other step also,

just close the java task which is running in the command prompt …
By using TASKKILL /F /PID XXXX
XXXX- Process ID of java task…
and start the server..

Reply
Motaung says August 6, 2013

This is great, just had a similar situation and this solution, just did exactly what i wanted…thanks..

Reply
RBNSN says October 23, 2013

Hi I have followed your instructions. However I have hit a hurdle. I have two processes that seem to be listening on the port 7001, the listener port for my Weblogic. I do not know which one to end.
Process one is :-

TCP 10.24.7.159:7001 0.0.0.0:0 LISTENING 4492

Process two :-

TCP 127.0.0.1:7001 0.0.0.0:0 LISTENING 3456

I can’t make up my mind because when I look them up in the Windows task manager, one of them seems to belong to java.exe and another TmProxy.exe both of them seem to be some default system processes on my computer. Could you kindly advise? Please mention if I hv to provide more info. Thank you.

Reply
    Atul Kumar says October 23, 2013

    @ RBNSN,
    This means that in your weblogic server configuration you configured Admin server to run on all IPs on this host. There are two IPs on this host 10.24.7.159 (actual IP) and 127.0.0.1 (local IP) and WebLogic Admin Server is listening on both.

    If you are trying to access WebLogic Console from server then you can access it on either URL i.e. http:/10.24.7.159:7001/console or http://127.0.0.1:7001/console but if you try to access from other machines (outside server) then access it via http://10.24.7.159:7001/console

    Reply
Vishu says October 24, 2013

In 11g my application was running fine.
But yesterday I opened another application in the same JDev and the previous application is not running and throwing “java.lang.NullPointerException” .
Kindly help

Reply
skiran says December 19, 2013

ISSUE WITH SESSION TIMEOUT

Hi,

I have a war file deployed on a cluster. And from the past 3 days, few users are reporting that the session is getting timed out within 30 mins.

Actually the session timeout is set for 240 mins(4 hrs), this is defined in the web.xml file.

And the interesting thing is , this is not happening to everyone. Only few users are facing this session timeout. And the timeout is also happening intermittently, not everytime.

Any suggestions or such experiences!!!
Thanks in Advance

Reply
anu says December 26, 2013

Hi Atul,

Request your help as we are facing an issue in our preprod env.

We have OIm9.1.0.2 installed on weblogic 10.3.0.We just tired restarting the server as part of maintanace,But the managed server is not coming up nor throwing any errors meseges.Below are the error meseges given.After the last line GMS— It just not move to any line nor gives any error mesge.

java version “1.6.0_14”
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
BEA JRockit(R) (build R27.6.5-32_o-121899-1.6.0_14-20091001-2113-linux-x86_64, compiled mode)
Starting WLS with line:
/opt/oraidam/jrrt/bin/java -client -Xms256m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=256m -Dweblogic.security.SSL.trustedCAKeyStore=/opt/oraidam/product/fmw/wlserver_10.3/server/lib/cacerts -DXL.HomeDir=/opt/oraidam/product/fmw/oim/xellerate -Djava.security.auth.login.config=/opt/oraidam/product/fmw/oim/xellerate/config/authwl.conf -Dlog4j.configuration=file:/opt/oraidam/product/fmw/oim/xellerate/config/log.properties -Djava.awt.headless=true -Doracle.jdbc.mapDateToTimestamp=false -Xverify:none -da -Dplatform.home=/opt/oraidam/product/fmw/wlserver_10.3 -Dwls.home=/opt/oraidam/product/fmw/wlserver_10.3/server -Dweblogic.home=/opt/oraidam/product/fmw/wlserver_10.3/server -Dweblogic.management.discover=false -Dweblogic.management.server=http://xpol0605.dcsrv.xoserve.local:7101 -Dwlw.iterativeDev=false -Dwlw.testConsole=false -Dwlw.logErrorsToConsole= -Dweblogic.ext.dirs=/opt/oraidam/product/fmw/patch_wls1030/profiles/default/sysext_manifest_classpath:/opt/oraidam/product/fmw/patch_cie660/profiles/default/sysext_manifest_classpath -Dweblogic.Name=bpmsq_oim_ms1 -Djava.security.policy=/opt/oraidam/product/fmw/wlserver_10.3/server/lib/weblogic.policy weblogic.Server
[WARN ] -XX:PermSize=128m is not a valid VM option. Ignoring
[WARN ] -XX:MaxPermSize=256m is not a valid VM option. Ignoring

DEBUG,26 Dec 2013 07:13:41,112,[XELLERATE.ACCOUNTMANAGEMENT],Class/Method: XellerateAuthenticationProviderImpl/initialize entered.
DEBUG,26 Dec 2013 07:13:41,118,[XELLERATE.ACCOUNTMANAGEMENT],Class/Method: XellerateAuthenticationProviderImpl/initialize left.

—-
INFO,26 Dec 2013 07:15:46,273,[com.nexaweb.server.services.clustering.mgmt.ClusterManager],Clustering is OFF.
07:15:46DEBUG [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – BEGIN SessionManager.init
DEBUG,26 Dec 2013 07:15:46,277,[com.nexaweb.server.session.SessionManager],BEGIN SessionManager.init
07:15:46DEBUG [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – Initializing PushObjectManager
DEBUG,26 Dec 2013 07:15:46,277,[com.nexaweb.server.session.SessionManager],Initializing PushObjectManager
07:15:46DEBUG [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – END SessionManager.init
DEBUG,26 Dec 2013 07:15:46,278,[com.nexaweb.server.session.SessionManager],END SessionManager.init
07:15:46DEBUG [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – XulSessionHelper.getSharedStore: clustering is off. Returning LocalSharedStore
DEBUG,26 Dec 2013 07:15:46,299,[com.nexaweb.server.xul.XulSessionHelper],XulSessionHelper.getSharedStore: clustering is off. Returning LocalSharedStore
07:15:46DEBUG [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – app server: weblogic:weblogic server 10.3 fri jul 25 16:30:05 edt 2008 1137967
DEBUG,26 Dec 2013 07:15:46,301,[com.nexaweb.server.servlet.ConnectionFactory],app server: weblogic:weblogic server 10.3 fri jul 25 16:30:05 edt 2008 1137967
07:15:46 INFO [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – Servlet Engine: WebLogic Server 10.3 Fri Jul 25 16:30:05 EDT 2008 1137967
INFO,26 Dec 2013 07:15:46,306,[com.nexaweb.server],Servlet Engine: WebLogic Server 10.3 Fri Jul 25 16:30:05 EDT 2008 1137967
07:15:46 INFO [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – Servlet API Version: 2.5
INFO,26 Dec 2013 07:15:46,306,[com.nexaweb.server],Servlet API Version: 2.5
07:15:46 INFO [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – Nexaweb Server Info = Nexaweb Server 3.3.1072
INFO,26 Dec 2013 07:15:46,306,[com.nexaweb.server],Nexaweb Server Info = Nexaweb Server 3.3.1072
07:15:46 INFO [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – Nexaweb Server initialized successfully.

INFO,26 Dec 2013 07:15:46,306,[com.nexaweb.server],Nexaweb Server initialized successfully.

07:15:46DEBUG [[ACTIVE] ExecuteThread: ‘0’ for queue: ‘weblogic.kernel.Default (self-tuning)’] – END NexawebServer.init
DEBUG,26 Dec 2013 07:15:46,306,[com.nexaweb.server],END NexawebServer.init

——————————————————-
GMS: address is xpol0605:20768
——————————————————-

Reply
anu says December 26, 2013

We have waited for about 60-70 minutes but still it does not respond .

Reply
Atul Kumar says December 26, 2013

@ Anu,
Identify process ID of managed server and run truss command to see on what this process is waiting

http://www.gsp.com/cgi-bin/man.cgi?topic=truss

Reply
anu says January 7, 2014

Hi Atul,

Thanks for the response.The issue got resolved by following steps in this metalink id-Unable to Start OIM Managed Server in a WebLogic Cluster Environment (Doc ID 1282256.1)-

Its a bug in OIM 9.1.0.2 cluster

Reply
Arpit Patel says January 11, 2017

Unable to reserve the .lok file for Integrated WebLogic Server (IntegratedWebLogicServer). Typically this is because another instance of this server is already running in the WebLogic domain (C:\Users\Arpit\AppData\Roaming\JDeveloper\system11.1.2.4.39.64.36.1\DefaultDomain).

the upper message is the error i am getting while running my project.
Help me to resolve it if you can.
Thanks in advance.

Reply
EL ABBASI HAJAR says March 12, 2017

i tried what you said in this post and nothing works, when i start weblogic server i got this error unable to obtain lock file on adminserver.lok and when i search for the lock file in the directory i didn’t find it
please help me

Reply
Aniket Kumar says March 12, 2018

Exit code 3, message=weblogic.management.ManagementException: [Deployer:149164]The domain edit lock is owned by another session in exclusive mode. Therefore, this deployment operation cannot proceed.

Reply
ronal says March 22, 2019

set EXTRA_JAVA_PROPERTIES=-Duser.language=en -Duser.country=US %EXTRA_JAVA_PROPERTIES%
set JAVA_PROPERTIES=%JAVA_PROPERTIES% %EXTRA_JAVA_PROPERTIES%

EN este archivo .- C:\Users\cjimenez.DGSGIF\AppData\Roaming\JDeveloper\system12.2.1.3.42.170820.0914\DefaultDomain\bin
setDomainEnv.cmd

Reply
Add Your Reply

Not found