weblogic.management.ManagementException: Unable to obtain lock AdminServer.lok during StartWebLogic.sh

Hi,

When you start Weblogic Server via StartWebLogic.sh, you can get ” weblogic.management.ManagementException: Unable to obtain lock on /home/oracle/Oracle/Middleware/Oracle_Home/user_projects/domains/PrimaveraP6EPPM/servers/AdminServer/tmp/AdminServer.lok. Server may already be running ” error.

 

weblogic.management.ManagementException

When i check AdminServer log, i saw following errors.

/usr/java/jdk1.8.0_181-amd64/bin/java -server -Xms256m -Xmx512m -cp /home/oracle/Oracle/Middleware/Oracle_Home/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/home/oracle/Oracle/Middleware/Oracle_Home/wlserver/server/lib/weblogic.policy -Dweblogic.ProductionModeEnabled=true -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader -javaagent:/home/oracle/Oracle/Middleware/Oracle_Home/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/home/oracle/Oracle/Middleware/Oracle_Home/wlserver/server -Dweblogic.home=/home/oracle/Oracle/Middleware/Oracle_Home/wlserver/server -Dweblogic.management.username=weblogic -Dweblogic.management.password=weblogic123 weblogic.Server
<Apr 30, 2019 2:49:11 AM EDT> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<Apr 30, 2019 2:49:11 AM EDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Apr 30, 2019 2:49:12 AM EDT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.181-b13 from Oracle Corporation.>
<Apr 30, 2019 2:49:13 AM EDT> <Info> <Management> <BEA-141297> <Could not get the server file lock. Ensure that another server is not running in the same directory. Retrying for another 60 seconds.>
<Apr 30, 2019 2:50:13 AM EDT> <Info> <Management> <BEA-141297> <Could not get the server file lock. Ensure that another server is not running in the same directory. Retrying for another 60 seconds.>
<Apr 30, 2019 2:51:13 AM EDT> <Info> <Management> <BEA-141297> <Could not get the server file lock. Ensure that another server is not running in the same directory. Retrying for another 60 seconds.>
<Apr 30, 2019 2:52:13 AM EDT> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:

There are 1 nested errors:

weblogic.management.ManagementException: Unable to obtain lock on /home/oracle/Oracle/Middleware/Oracle_Home/user_projects/domains/PrimaveraP6EPPM/servers/AdminServer/tmp/AdminServer.lok. Server may already be running

 

 

 

Unable to obtain lock AdminServer.lok

This error means, you have Weblogic server lock and more than one weblogic server running on same server.

 

Go to Weblogic server home and find DAT extension files

cd /home/oracle/Oracle/Middleware/Oracle_Home/user_projects/domains
find . -name "*.DAT"

 

 

Remove these DAT files

rm -rf ./PrimaveraP6EPPM/servers/AdminServer/data/store/diagnostics/WLS_DIAGNOSTICS000000.DAT
rm -rf ./PrimaveraP6EPPM/servers/AdminServer/data/store/default/_WLS_ADMINSERVER000000.DAT

 

Find .lok extension files and remove them.

find . -name EmbeddedLDAP.lok
rm -rf ./PrimaveraP6EPPM/servers/AdminServer/data/ldap/ldapfiles/EmbeddedLDAP.lok


find . -name EmbeddedLDAP.lok
rm -rf /home/oracle/Oracle/Middleware/Oracle_Home/user_projects/domains/PrimaveraP6EPPM/servers/AdminServer/tmp/AdminServer.lok

 

 

Check 7001 port or 7002 or which ports are using with netstat command

netstat -lntp
kill -9 PID

 

Kill this process and start Weblogic Server again with following script.

 

nohup sh /u01/app/user_projects/domains/PrimaveraP6EPPM/bin/startWebLogic.sh -Dweblogic.management.username=weblogic -Dweblogic.management.password=dev12345 &




Read the following post to learn how to install and configure Weblogic Server.

Oracle Weblogic 12c Step by Step Installation

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

Leave a Reply

Your email address will not be published. Required fields are marked *