Posts

Showing posts from 2011

Weblogic Node Manager as a UNIX Startup Process

Configuring WebLogic Server (WLS) as a startup process was a common administrative process in the past. But after Node Manager (NM) was introduced as an agent to start, stop, restart and monitor WebLogic Server it is now recommended that you start WebLogic Server using NM. But NM has to configure as a startup process on the respective OS so that it is always running to manage the respective WLS instances on that machine. NM can either be Java based NM or Script based NM. Script based NM uses OS services like SSH or RSH to execute the NM script. But Java based NM is a Java process that should be started. So setting up NM as a service will ensure that NM is always running. There is a lot of information in the WebLogic Server documentation about setting up NM. But there is very less or no information about setting NM as a service on a non-Windows environment. For Windows environment there are pre-packged scripts that you can use. These scripts exist under WL_HOME/server/bin folder (insta...

Recover Weblogic Admin Password

If Weblogic admin password been forgotten, then no worries we can recover the password without reset / recreating the domain. BEA/Oracle WebLogic application server being an enterprise-ready piece of software treats security seriously. One of the symptoms of that is the fact that all sensitive pieces of information like logins, passwords etc. are kept in encrypted form. While browsing through config.xml or boot.properties files you can easily spot them since they are usually prefixed with ‘{3DES}’ / ‘{AES} string which obviously suggests the encryption algorithm used. WebLogicDecryptor.java import java.util.*; import java.io.*; import javax.xml.parsers.*; import javax.xml.xpath.*; import org.w3c.dom.*; import weblogic.security.internal.*; // requires weblogic.jar in the class path import weblogic.security.internal.encryption.*; public class WebLogicDecryptor {       private static final String PREFIX = "{AES}";       priv...

Python Script to Monitor Weblogic Servers thru WLST

Python Script: (monitor.py) def reportDomainHealth(usern, passw, url):     print ""     print "====================================================================="     connect(usern,passw,url)     domainRuntime()      print "Found Servers: "     serverList=ls('ServerRuntimes');     serverList=serverList.split()     print "%15s %15s %20s %15s %15s %40s" % ("Server","Threads","HoggingThreads","QueueLength","Heap_Free","HealthState ")     print "----------------------------------------------------------------------------------------------------------------"     for i in range(len(serverList)):         if serverList[i] != 'dr--':             server_st=get('ServerRuntimes/' + serverList[i] + '/HealthState')         ...

Weblogic Admin password

This procedure specifies how to reset the Weblogic Admin password: Where   MW_HOME - BEA HOME       1.     Shutdown your weblogic instance if its running, using the command: $ cd MW_HOME/user_projects/domains/base_domain/bin $ ./stopWebLogic.sh 2. Set your environment variables using setDomainEnv.sh: $ cd MW_HOME/user_projects/domains/base_domain/bin $ . ./setDomainEnv.sh 3.Run the following commands: $ cd MW_HOME/user_projects/domains/base_domain/security $ java weblogic.security.utils.AdminAccount adminuser1 welcome1 . 4. Delete file from "ldap" folder: $ cd MW_HOME/user_projects/domains/base_domain/servers/AdminServer/data/ldap $ rm DefaultAuthenticatormyrealmInit.initialized 5. Startup weblogic server using the newly created "adminuser1" account. $ cd /scratch/aime1/work1/mwps1/user_projects/domains/base_domain/bin $ ./startWebLogic.sh Enter username to boot WebLogic server: adminuser1 Enter password to boot ...