Friday, April 24, 2009

WebSphere 6.1 - JMX MBeans Query Example

Server side configuration
-------------------------
Set these parameters in Generic JVM arguments.
-Djavax.management.builder.initial= -Dcom.sun.management.jmxremote

Specify these JVM custom properties
com.sun.management.jmxremote.authenticate false
com.sun.management.jmxremote.port 9004
com.sun.management.jmxremote.ssl false

Restart the server for the changes to take effect.

Java client program
-------------------
import java.util.Set;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;

public class JMXTest {

public static void main(String[] args) {
JMXTest jmxtest = new JMXTest();
jmxtest.execute();
}

public void execute() {
MBeanServerConnection mbeanServerConnection = null;
JMXServiceURL serviceURL;
try {
serviceURL = new JMXServiceURL(
"service:jmx:rmi://{your_host_name}:2809/jndi/JMXConnector");
JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL);
mbeanServerConnection = jmxConnector.getMBeanServerConnection();
System.out.println("Successfully Connected!");

String query = "WebSphere:type=IlrBresModel,*";
ObjectName queryName = new ObjectName(query);
Set s = mbeanServerConnection.queryNames(queryName, null);
if (!s.isEmpty())
System.out.println(s.iterator().next());
else
System.out.println("MBean was not found");
} catch (Exception e) {
e.printStackTrace();
}

}

}

You should also have these two jars in the class path for the Java program to run.
com.ibm.ws.runtime_6.1.0.jar
ws_runtime.jar

Otherwise, runtime exceptions will be thrown. 

Friday, April 10, 2009

WebSphere 6.1 - Remove uninstallable enterprise apps

Problem:
WebSphere enterprise apps remain uninstalled after remove node.

Solution:
cd profile/config/cells/{cellname}/applications
Manually delete the ear directories.
Restart dmgr if necessary.

Thursday, April 9, 2009

Microsoft Word Mathematical Equations

Tools -> Customize -> Commands -> Insert -> Equation Editor

Click on Equation Editor, drag and drop on the tool bar

Tuesday, April 7, 2009

WebSphere Portal Server 6.1.0.1 database transfer

Problem:
WebSphere Portal Server 6.1.0.1 database transfer fails with message: ORA-02158: invalid CREATE INDEX option

Solution:
Update {dbdomain}.space_mapping.properties files table spaces without the quotes
dbdomian.AI_APP.tablespace=TABLESPACE TBLSNAME
instead of
dbdomian.AI_APP.tablespace="TABLESPACE TBLSNAME"

Thursday, April 2, 2009

Oracle list Indexes

select index_name, column_name, column_position from user_ind_columns where table_name='MYTABLENAME' order by index_name, column_position

Just replace the tablename