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.