This post covers issue encountered during start-up of WebLogic Server by one of our Trainee from our Oracle Access Manager Training, where he reported error ‘Unable to Start Server because on Lock Files‘.
You can use this post to troubleshooting WebLogic startup issue for any standalone Java Application or Fusion Middleware Application like SOA, OBIEE, Webcenter, OIM, ODI etc and some tips on WebLogic Server.
On Startup of WebLogic Server for OAM, error reported on screen “Unable to get File Lock will Retry” before I tell about root cause and fix at bottom of this post let me cover first few things good to understand related to Oracle WebLogic Server.
Things Good to Know
- WebLogic Server is Application Server from Oracle, that hosts OAM, SOA, OBIEE and other Fusion Middleware Products
- WebLogic has two type of Servers, Admin Server & Managed Server where Admin Server is for Administration purpose whereas Managed Server hosts business application like OAM or SOA-INFRA etc . More on WebLogic Domain, Admin & Manager Server here
- When WebLogic Server (Admin & Managed Server) Starts, it creates lock file with .lok extension under $DOMAIN_HOME/server/<Server_Name>/tmp (Note: In ERS R12.2, $DOMAIN_HOME is under $FMW_HOME)
- When WebLogic Server (Admin & Managed Server) Stops, it cleans lock file with .lok extension
- At times, abnormal server or O.S. reboot or because of restore from backup, you may see this file and before starting WebLogic service, remove this lock file
- Never remove lock file when Admin or Managed Server is running
Whenever you start any server, it creates lock files under $DOMAIN_HOME/servers/<server_name>/tmp with .lok extension and when you stop the server, it deletes these files automatically. So as shown in the message, it is unable to get lock file because another process still holds the lock, may be due to incorrectly closed or server is already running.
Note: Make sure you check Port used by WebLogic Server is not listening and there is no runaway Java Process from WebLogic Server – Check netstat & ps commands given below
If WebLogic Server, fails to start due to unable to get file lock, then first check if the port configured for Admin or Managed Server is being used and if listening then you must check process using it.
- To check Admin & Managed Server Port, look at $DOMAIN_HOME/config/weblogic.xml
- To check if port is being used on Linux, ps -ef | grep <PORT_NO> | grep LISTEN
- To check which Process ID (PID) is using a Port on Linux check here
- To know more about this process ps -efww | grep <PID> and see if this is an existing WebLogic Process
lock files need to be removed manually before restart WLS or you can kill the port on which WebLogic Server is listening and then try the re-start.
Steps to delete lock file:
1. Navigate to $DOMAIN_HOME/servers/<server_name>/tmp.
2. Locate the .lok file in the tmp folder and delete it using below command.
rm -rf *.lok
3. Try restarting server now.
Steps to kill listening port:
1. Run below command to find out process ID of the listening port (using root user).
lsof -i :7005
2. Now kill the PID shown in the output of above command.
kill -9 :<PID>
3. Try restarting server now.
Have queries? Why wait, post in the comment section below?
If you are looking for commonly asked interview questions for Oracle Access Manager then just click below and get that in your inbox.