Monday, August 15, 2011

Resetting the WebLogic Server Admin Password in Windows

Hello There,

Sometimes you will find that you have forgot the WebLogic Server Admin User password, however its simple task if you want to reset it, You just need to have access to the box where the WebLogic Server is Installed.
Follow the below steps to  reset the Admin User Password for WebLogic in Windows environment.

Step 1: Navigate to Domain

cd D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain

Step 2 : Set the Domain Environment

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain>cd bin
D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\bin>setDomainEnv.cmd

Step 3: Navigate to Security Directory

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain>cd security
D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\security>dir
Volume in drive D is Data
Volume Serial Number is A4F2-F499

Directory of D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\security

06/30/2011  08:14 PM    <DIR>          .
06/30/2011  08:14 PM    <DIR>          ..
06/30/2011  08:14 PM             4,114 DefaultAuthenticatorInit.ldift
06/30/2011  08:14 PM             2,398 DefaultRoleMapperInit.ldift
06/30/2011  08:14 PM                64 SerializedSystemIni.dat
06/30/2011  08:14 PM            22,666 XACMLRoleMapperInit.ldift
             4 File(s)         29,242 bytes
             2 Dir(s)  78,963,396,608 bytes free

Step 4: Rename the DefaultAuthenticatorInit.ldift as below.

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\security>rename DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit_old.ldift

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\security>dir
Volume in drive D is Data
Volume Serial Number is A4F2-F499

Directory of D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\security

08/13/2011  01:03 AM    <DIR>          .
08/13/2011  01:03 AM    <DIR>          ..
06/30/2011  08:14 PM             4,114 DefaultAuthenticatorInit_old.ldift
06/30/2011  08:14 PM             2,398 DefaultRoleMapperInit.ldift
06/30/2011  08:14 PM                64 SerializedSystemIni.dat
06/30/2011  08:14 PM            22,666 XACMLRoleMapperInit.ldift
             5 File(s)         32,632 bytes
             2 Dir(s)  78,963,392,512 bytes free

Step 5 : Execute the below command :

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\security>java weblogic.security.utils.AdminAccount weblogic sparkle123 .

Notice that there is a DOT (.) at the end of the command, that notifies that it will reset the password in current directory, the above command will create the file DefaultAuthenticatorInit.ldift as below.

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\security>dir
Volume in drive D is Data
Volume Serial Number is A4F2-F499

Directory of D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\security

08/13/2011  01:03 AM    <DIR>          .
08/13/2011  01:03 AM    <DIR>          ..
08/13/2011  01:03 AM             3,390 DefaultAuthenticatorInit.ldift
06/30/2011  08:14 PM             4,114 DefaultAuthenticatorInit_old.ldift
06/30/2011  08:14 PM             2,398 DefaultRoleMapperInit.ldift
06/30/2011  08:14 PM                64 SerializedSystemIni.dat
06/30/2011  08:14 PM            22,666 XACMLRoleMapperInit.ldift
             5 File(s)         32,632 bytes
             2 Dir(s)  78,963,392,512 bytes free

Step 6 :  Go to Security Folder of Admin Server

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\servers\AdminServer\security>dir
Volume in drive D is Data
Volume Serial Number is A4F2-F499

Directory of D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\servers\AdminServer\security

06/30/2011  08:15 PM    <DIR>          .
06/30/2011  08:15 PM    <DIR>          ..
06/30/2011  08:15 PM               189 boot.properties
             1 File(s)            189 bytes
             2 Dir(s)  78,963,376,128 bytes free

Edit the boot.properties file as below and save it.

password=sparkle123
username=weblogic

Step 7. Navigate to following Directory

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\servers\AdminServer\data>dir
Volume in drive D is Data
Volume Serial Number is A4F2-F499

Directory of D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\servers\AdminServer\data

06/30/2011  08:17 PM    <DIR>          .
06/30/2011  08:17 PM    <DIR>          ..
06/30/2011  08:17 PM    <DIR>          console
06/30/2011  08:15 PM    <DIR>          ldap
06/30/2011  08:15 PM    <DIR>          store
             0 File(s)              0 bytes
             5 Dir(s)  78,963,376,128 bytes free

Step 8 : Rename LDAP Directory as below, it will be recreated During WebLogic Server start-up.

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\servers\AdminServer\data>rename ldap ldap_old

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\servers\AdminServer\data>dir
Volume in drive D is Data
Volume Serial Number is A4F2-F499

Directory of D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\servers\AdminServer\data

08/13/2011  01:07 AM    <DIR>          .
08/13/2011  01:07 AM    <DIR>          ..
06/30/2011  08:17 PM    <DIR>          console
06/30/2011  08:15 PM    <DIR>          ldap_old
06/30/2011  08:15 PM    <DIR>          store
             0 File(s)              0 bytes
             5 Dir(s)  78,963,376,128 bytes free

Step 9 :Restart the Server as below.

D:\Oracle\Middleware\WebLogic\10.3.4.0\user_projects\domains\CustImageTestDomain\bin>startWebLogic.cmd
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m  -XX:MaxPermSize=128m
.
WLS Start Mode=Development
.
CLASSPATH=D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\patch_wls1034\profiles\default\sys_manifest_classpath\weblogic_patch.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\patch_ocp360\profiles\default\sys_manifest_
classpath\weblogic_patch.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\JDK160~1\lib\tools.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\WLSERV~1.3\server\lib\weblogic_sp.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0
\WLSERV~1.3\server\lib\weblogic.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\modules\features\weblogic.server.modules_10.3.4.0.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\WLSERV~1.3\server\lib\webservices.ja
r;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\modules\ORGAPA~1.1/lib/ant-all.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\modules\NETSFA~1.0_1/lib/ant-contrib.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\WLSERV~1.3\
common\derby\lib\derbyclient.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\WLSERV~1.3\server\lib\xqrl.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\WLSERV~1.3\common\derby\lib\derbyclient.jar;D:\Oracle\MIDDLE~1
\WebLogic\1034~1.0\WLSERV~1.3\server\lib\xqrl.jar;D:\Oracle\MIDDLE~1\WebLogic\1034~1.0\patch_wls1034

:
:
<Aug 13, 2011 1:10:17 AM IST> <Warning> <Server> <BEA-002611> <Hostname "sdyade-lap.idc.oracle.com", maps to multiple IP addresses: 192.168.1.140, 10.177.62.215, 192.168.1.141>
<Aug 13, 2011 1:10:17 AM IST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 10.177.62.215:7001 for protocols iiop, t3, ldap, snmp, http.>
<Aug 13, 2011 1:10:17 AM IST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 192.168.1.141:7001 for protocols iiop, t3, ldap, snmp, http.>
<Aug 13, 2011 1:10:17 AM IST> <Notice> <Server> <BEA-002613> <Channel "Default[3]" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<Aug 13, 2011 1:10:17 AM IST> <Notice> <WebLogicServer> <BEA-000331> <Started WebLogic Admin Server "AdminServer" for domain "CustImageTestDomain" running in Development Mode>
<Aug 13, 2011 1:10:17 AM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<Aug 13, 2011 1:10:17 AM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

Step 10 : Login to the WebLogic Server Console with New Password. 

You are Done..!!
Please let me know if you face any difficulty in changing the username or password for the WebLogic Server in case if you forget.

Thanks
Shailesh Dyade.