Monday, February 14, 2011

WebLogic Admin Console

WebLogic Admin Console

The WebLogic Admin Console is a web-based, user interface used to configure and control a set of WebLogic servers or clusters (i.e. a "domain"). In any logical group of WebLogic servers there must exist one admin server, which hosts the WebLogic Admin Console application and manages the associated configuration files.

WebLogic Administrators will use the Administration Console for a number of tasks, including:
  • Starting and stopping WebLogic servers or entire clusters.
  • Configuring server parameters, security, database connections and deployed applications.
  • Viewing server status, health and metrics.
Note: It is not strictly necessary to use the Weblogic Admin Console to perform these tasks, as they can be scripted using WLST (the WebLogic Scripting Tool).

Accessing the Admin Console

WebLogic Admin Console Url: http://hostname:port/console.

To access the WebLogic Administration Console, assuming the admin server has been started, goto the above url. Where hostname and port is the listen address/port specified when creating the WebLogic domain. Eg. http://localhost:7001/console.

Evolution of the WebLogic Admin Console

The Weblogic Admin Console has changed considerably in the time since it was first included in the WebLogic product. Early WebLogic versions (prior to version 6) did not have an administration console. Its initial form was fairly consistent from version 6 through 8 (example below).


With the introduction of WebLogic 9, the Administration Console was completely redesigned. Now using WebLogic Portal technologies it was more customizable and featured better configuration control. A common complaint from users moving to the newer version was its slower performance and need for more memory.



The latest versions of the WebLogic Admin Console have been rebranded (BEA was aquired by Oracle) and a number of usability improvements have been made.


Learning to use the Administration Console

Oracle provides a number of introductry articles in the WebLogic documentation (see links below). There are also a number of WebLogic Administration courses offered by Oracle and training vendors.

Disabling the Admin Console

By default the WebLogic Admin Console is enabled. For security reasons, you may require to disable it. This can be done by executing the following WLST script (WebLogic 8.1 SP6 or later).

connect("t3://hostname:port", "username","password")
edit()
startEdit()
cmo.setConsoleEnabled(false)
save()
activate()
disconnect()

Note: You will need to restart the admin server for this to take effect.

References

http://download.oracle.com/docs/cd/E13222_01/wls/docs90/intro/console.html
http://download.oracle.com/docs/cd/E13222_01/wls/docs60/notes/new.html

Thursday, February 10, 2011

JVM detects UTC timezone as ACT


This is a simple symptom-cause-solution blog entry only. I hope these blogs will help fellow administrators.

Symptom

JVM detects UTC timezone as ACT. This will be evident particularly in web application servers, such as WebLogic, WebSphere and JBoss. Reported time (for example in log files) will not match operating system's time.

Cause

JVM tries to determine what the timezone is by looking at operating system settings. It does not recognize the UTC timezone properly and chooses (or defaults to) ACT timezone.

Solution

Specify -Duser.timezone=Etc/UTC on the java command-line. This forces the JVM to use the UTC timezone.

Using the tzupdate tool does not appear to rectify the issue.

Note: Some Windows operating systems do not provide a UTC timezone out-of-the-box. A patch is available from Microsoft to rectify this.

References



Monday, February 7, 2011

WebLogic Interview Questions

In this article I will briefly discuss how I conduct interviews for WebLogic Administration roles.

When conducting interviews I prefer to avoid difficult questions, and instead ask fairly simple questions and look at how well the candidate answers. I would prefer to hire someone who can clearly and concisely explain how to do a simple task than someone who knows every single thing about a particular technology.

I explain at the beginning of the interview, it's acceptable if they are not able to answer every question; I use their answers to help decide if they will be a good fit for the team and the role.

Here are some of the questions I like to ask after I've given them a description of the role on offer.

Non-Technical Questions
  • Which of your previous roles do you think have give you experience that could be important for this role?
  • Tell me what is involved in a typical day in this role?
  • Describe the kind of infrastructure you worked with in this role?
  • On a scale of 1 to 10, with 1 being "no knowledge" and 10 being "know everything", how would you rate your own skills? (I don't look for people who think they "know everything").
  • What are some of the things you need to learn more about?

Technical Questions
  • If you were trying to access an application via a HTTP proxy and were getting a 404 error, how would you go about determining why you were getting this error?
  • Describe how you would go about configuring a WebLogic server to give an application access to a database.
  • How many threads does a managed server make available to an application? (expect different answers for different versions of WebLogic)
  • What kind of problems would you expect to encounter when trying to increase a managed server's maximum heap size to 3 GB? (Problems on 32-bit operating systems).
  • If an application was suffering short periodic freezes, and no errors were appearing in the logs, can you suggest a possible cause? (Garbage collection)
  • How could you prevent these periodic lock-ups?
  • What are the ways you could check when garbage collection is occurring?
  • If you start an admin server as a Windows service, where is that server's classpath defined? (Windows Registry)
  • If you start a managed server via a node manager, where is that server's classpath defined? (config.xml)
  • If a managed server is crashing with a StackOverflow exception, what could be the cause?
  • Describe how you would go about configuring a JMS queue in a WebLogic cluster. (i.e. a distributed queue).
  • Describe how you might run a WLST script?

Other Questions
Note it is also important to ask questions that determine if the candidate is familiar with best practices, such as Change Control and Configuration Management.

Java System Properties

This is a quick post with some useful code for printing a complete list of Java system properties. System properties give you access to certain JVM startup parameters and system information.

The following code (SysProp.java) can be used to print all system properties.

import java.util.Properties;
import java.util.Enumeration;

public class SysProp {

public static void main(String[] args) {
Properties sysprops = System .getProperties();
Enumeration e = sysprops.propertyNames();
while (e.hasMoreElements()) {
String key = (String)e.nextElement();
String value = sysprops.getProperty(key);
System.out.println(key + "=" + value);
}
}

}

The resulting output should look like this:

java.vm.vendor.url.bug=http://edocs.bea.com/jrockit/go2troubleshooting.html
java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
sun.boot.library.path=E:\APPS\bea_x64\jrockit-R27.5.0-jdk1.5.0_14\jre\bin
java.vm.version=R27.5.0-110_o-99226-1.5.0_14-20080528-1505-windows-x86_64
java.vm.vendor=BEA Systems, Inc.
java.vendor.url=http://www.bea.com/
path.separator=;
java.vm.name=BEA JRockit(R)
file.encoding.pkg=sun.io
user.country=US
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=Service Pack 2
java.vm.vendor.url=http://www.bea.com/
java.vm.specification.name=Java Virtual Machine Specification
user.dir=C:\
java.runtime.version=1.5.0_14-b03
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs=...\bea_x64\jrockit-R27.5.0-jdk1.5.0_14\jre\lib\endorsed
os.arch=amd64
java.io.tmpdir=C:\Users\*****\AppData\Local\Temp\2\
line.separator=

java.vm.specification.vendor=Sun Microsystems Inc.
user.variant=
os.name=Windows Vista
sun.jnu.encoding=Cp1252
java.library.path=...
java.specification.name=Java Platform API Specification
java.class.version=49.0
sun.management.compiler=BEA JRockit(R) Optimizing Compiler
os.version=6.0
user.home=C:\Users\******
user.timezone=
java.awt.printerjob=sun.awt.windows.WPrinterJob
file.encoding=Cp1252
java.specification.version=1.5
user.name=*****
java.class.path=.
java.vm.specification.version=1.0
sun.arch.data.model=64
java.home=E:\APPS\bea_x64\jrockit-R27.5.0-jdk1.5.0_14\jre
java.specification.vendor=Sun Microsystems Inc.
user.language=en
awt.toolkit=sun.awt.windows.WToolkit
java.vm.info=compiled mode
java.version=1.5.0_14
java.ext.dirs=...
java.vendor=BEA Systems, Inc.
file.separator=\
java.vendor.url.bug=http://edocs.bea.com/jrockit/go2troubleshooting.html
sun.cpu.endian=little
sun.io.unicode.encoding=UnicodeLittle
sun.desktop=windows
sun.cpu.isalist=amd64


Monday, January 10, 2011

Connection refused: No available router to destination


This is a simple symptom-cause-solution blog entry only. I hope these blogs will help fellow administrators.

Symptom

The following exception occurs in WebLogic server logs. Most likely to occur during WebLogic server start-up, but similar exceptions may occur at other times.

java.net.ConnectException: t3://myserver:8000: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:49)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:363)
at weblogic.jndi.Environment.getContext(Environment.java:307)
at weblogic.jndi.Environment.getContext(Environment.java:277)

Cause

This message (Connection refused: connect; No available router to destination) is a kind of "catch-all" exception message. There may be a number of causes, but essentially the application or server is attempting to establish a connection, but is unable to.

Solution

Check the following:
  • The destination name resolves to an IP address
  • The destination is "pingable"
  • The destination port is open (use telnet, for example)

References

None