Saturday, October 19, 2013

How To Recover Forgotten Weblogic Admin Password (Weblogic 9, 10 and 11)

Forgot the admin password to one of your domains?
Don't panic! There is a chance you may recover it from your domain's config.xml.
Administrator's password is encrypted using one-way SHA algorithm, and cannot be decrypted without enormous computational power. Luckily, when a domain is created, the nodemanager's default password is made equal to administrator's one. Nodemanager's password is encrypted with 3DES or AES, and can be decrypted.
Recover passwords for your domain
Upload the security/SerializedSystemIni.dat file from your domain along with config/config.xml. All passwords in config.xml file will be decrypted and shown to you in clear text. Nodemanager's password is likely matches your administrator's password (unless it was changed later).
You may also decrypt passwords for JDBC datasources, JMS bridge endpoints or in boot.properties file.
Security Note
No decrypted passwords are saved anywhere on this server! They are erased from memory the moment you get them.
Why I built this service?
My team has more than 20 domains in use, and forgotten passwords problem often infuriates me. First I wrote a simple command-line utility to do the recovery, and later, seeing a large number of requests online, made it a public service.

How do we find the time taken by a request from webserver/apache to weblogic servers? Do we have any parameters configured in apache to define the max time period to reach weblogic server?

you can use these params ConnectTimeoutSecs & ConnectRetrySecs

How to verify multicasting communication failures?

When you have servers in one cluster, the servers communicate with each other using multicast messaging mode. But a lot of times you see the messages in the log files of the servers like “Lost Multicast Messages”. This means there is something wrong in the servers communication. At this point of time it is necessary to test the network connection between the ip addresses where the clusters are running.

Syntax : java utils.MulticastTest -n name -a address [-p portnumber] [-t timeout] [-s send]

-N : Name of the server so that you can identify the communication.
-A : Multicast address on which the messages are sent and received.
-P : This is the multicast port number on which the servers communicate.
-T : This is the timeout value, if no multicase message is received within this time, warning is shown on the shell prompt.
-S : The duration in seconds between sending the messages.

Below is how you do it:

Test : Start the command prompts on machines where you have your managed servers. (can be 1 or more)
Ensure that the servers in the cluster are not running, this test is for checking the network connectivity.

Set the java environment on both the shells. Then enter the below syntax:
System 1 : java utils.MulticastTest -N Server1 -A 237.0.0.1 -P 7008 -T 10 -S 2
System 2 : java utils.MulticastTest -N Server2 -A 237.0.0.1 -P 7008 -T 10 -S 2

Both servers will start sending and receiving messages.

General GC recomendations:

How to configure log4j for our web applications deployed in weblogic 10.3 domain?

The steps are given below:

1. Copy log4j-1.2.9.jar & wllog4j.jar under domain_root/lib folder.

2. Create log4j.xml and drop it under domain_root folder. If you have log4j.xml inside the application(EAR/WAR), I would recommend to move outside EAR/WAR as changing severity (log level) would require re-deployment. To avoid this, we can move log4j.xml into domain root folder but again the server needs to be bounced.

3. Login to weblogic server console. Go to Servers -> Admin Server-> Logging. Click on advanced mode. Change the logging implementation from JDK to Log4J. Click save.

4. Activate changes. Re-start the admin server.

This should enable log4j and should write logging into log file mentioned in log4j.xml or properties file.

Hang on! There is a catch here. Say now I want to change the log level from DEBUG into WARN or ERROR. How do i do? We go to log4j.xml and change the level. Now how does this change take into effect? It needs bouncing of the server.

Development Phases of J2EE Applications:

** Enterprise Bean Creation:

Person: software developer

Tasks:

Codes and compiles the Java source code needed by the enterprise bean

Specifies the deployment descriptor for the enterprise bean

Bundles the .class files and deployment descriptor into an EJB .jar file

Deliverable: the EJB .jar file containing the enterprise bean

** Web Component Creation:

Persons: Web designer (JavaServer Pages components), software developer (servlets)

Tasks:

Codes and compiles Java source code for the servlet

Writes .jsp and .html files

Specifies the deployment descriptor for the Web component

Bundles the .class, .jsp, .html, and deployment descriptor files into the .war file

Deliverable: the .war file containing the Web component

**J2EE Application Client Creation:

Person: software developer

Tasks:

Codes and compiles the Java source code needed by the client

Specifies the deployment descriptor for the client

Bundles the .class files and deployment descriptor into the .jar file for the client.

Deliverable: the .jar file containing the J2EE application client

**J2EE Application Assembly:

Person: software developer

Tasks:

Assembles enterprise beans (EJB .jar) and Web components (.war) created in the previous phases into a J2EE application (.ear)

Specifies the deployment descriptor for the J2EE application

Deliverable: the .ear file containing the J2EE application

**J2EE Application Deployment:

Person: system administrator

Tasks:

Adds the J2EE application (.ear) created in the preceding phase to the J2EE server

Configures the J2EE application for the operational environment by modifying the deployment descriptor of the J2EE application

Deploys (installs) the J2EE application (.ear) into the J2EE server

Deliverable: an installed and configured J2EE application

Analyzing the Performance Impact of Memory Utilization and Garbage Collection

Linux Commands for finding CPU's

To find the number of physical CPUs in Linux:

$ cat /proc/cpuinfo | grep “^physical id” | sort | uniq | wc -l

To find the number of cores per CPU in Linux:

$ cat /proc/cpuinfo | grep “^cpu cores” | uniq

The total number of processors available is the number of physical CPUs multiplied by the number of cores per CPU.

To find the total number of processors:

$ cat /proc/cpuinfo | grep “^processor” | wc -l