ServerRuntimeMBean.isAdminServer()
Hi,
in our portal application, we need to check if the administration server is up. We've got the following method :
public static boolean isAdminServerAlive(HttpServletRequest request) {
boolean isAlive = false;
MBeanHome adminBeanHome = null;
// Récupération des paramètres de connexion
String url = "t3://"+request.getServerName()+":"+request.getServerPort();
String username = WebAppAdmProfils.getParamValue("supervision.login");
String password = WebAppAdmProfils.getParamValue("supervision.password");
if(username == null || username.equalsIgnoreCase("") || password == null || password.equalsIgnoreCase("")) {
SUOLogger.logError(WebAppAdmProfils.getParams(), "SupervisionUtil.isAdminServerAlive() - Les paramètres supervision.login et/ou supervision.password sont mal renseignés dans le fichier de properties.");
return false;
try {
adminBeanHome = getAdminMBeanHome(url, username, password);
// liste de tous les serveurs
List serverRuntimeMBeans = getServerRuntimeMBeans(adminBeanHome);
Iterator itServerRuntimeMBeans = serverRuntimeMBeans.iterator();
while(itServerRuntimeMBeans.hasNext()) {
ServerRuntimeMBean serverRuntimeMBean = (ServerRuntimeMBean)itServerRuntimeMBeans.next();
// pour chaque serveur, on vérifie si c'est le serveur d'admin
if(serverRuntimeMBean.isAdminServer()) {
// si c'est le cas, ça veut dire qu'on a pu accéder au serveur d'admin
// et donc qu'il est vivant
isAlive = true;
} catch(Exception e) {
SUOLogger.logError(WebAppAdmProfils.getParams(), "SupervisionUtil.isAdminServerAlive() - Erreur lors de l'accès au serveur d'admin (il doit être arrêté).");
return isAlive;
This works on our integration environment where there is only one managed server and where the admin server is on the same machine than the managed server.
But on our production environment, this doesn't work. Our production environment is a cluster of 9 managed servers and the admin server is on another machine.
Is the MBean behavior different between a cluster and a non cluster environment ? Is it different if the admin server is not on the same machine than the managed servers ?
Thanks
Thomas
The ExecuteQueueRuntimeMBean interface does not appear anywhere in WebLogic
6.0 API documentation. But it is included in WebLogic 6.1 API documentation.
Still, this doc does not say how to get a reference to an
ExecuteQueueRuntimeMBean. I know that this is done via
ServerMBean/ServerRuntimeMBean, but this is not documented.
Paul
"Kumar Allamraju" <[email protected]> wrote in message
news:[email protected]..
if it's not documented, that means it's internal use only and it's
not safe to rely on internal API's as they might change in future
releases.
Kumar
Paul Tatavu wrote:
The ServerRuntimeMBean exposes an undocumented method that can be used
to
get the execute queue:
ServerRuntimeMBean.getExecuteQueueRuntime()
Is it safe to use this method? Will it be documented in future versions?
TIA,
Paul Tatavu
Similar Messages
-
Usage of weblogic.management.runtime.ServerRuntimeMBean
Hi all,
Does anyone knows how to use this mbean? How to
use MBeanHome to get hold of this mbean, and use it to
shutdown the server?
My code segment is like following, and an InstanceNotFoundException is
always thrown back. Any suggestion?
Context ctx = new InitialContext();
MBeanHome home = (MBeanHome)
ctx.lookup("weblogic.management.adminhome");
ServerRuntimeMBean server = (ServerRuntimeMBean) home.getMBean(new
ObjectName("truetel:Type=ServerRuntime,Location=sleesvr,Name=sleesvr"));
Any help will be appreciated,
Lynch
p.s. The code is within a timer class to shutdown itself in the proper time.
The domain is "truetel" and the server name is "sleesvr".Please ignore the previous post. I've found the way anyway.
Use home.getRuntimeMBean("sleesvr", "ServerRuntime");
"Lynch" <[email protected]> ¼¶¼g©ó¶l¥ó
news:[email protected]..
Hi all,
My code segment is like following, and an InstanceNotFoundException is
always thrown back. Any suggestion?
Context ctx = new InitialContext();
MBeanHome home = (MBeanHome)
ctx.lookup("weblogic.management.adminhome");
ServerRuntimeMBean server = (ServerRuntimeMBean) home.getMBean(new
ObjectName("truetel:Type=ServerRuntime,Location=sleesvr,Name=sleesvr")); -
weblogic.management.runtime.ServerRuntimeMBean.getURL() returns weird characters in address.
For instance,
http://[2606:b400:2010:5046:216:3eff:fe48:3362]:7001/RTLAppBasicAuth
How to get the user readable value from this, means proper hostname.
Is there anything I have to do in my linux machine to get right value here. -
Wlst in WebLogic 8.1.4
Hello,
I cannot seem to find wlst.cmd file in WebLogic 814.
I'm getting the following error, when I attempt to connect from a remote server.
wls:/offline> connect('weblogic', 'weblogic', 't3://xxx.xxx.xxx.xxx:7001')
Connecting to t3://xxx.xxx.xxx.xxx:7001 with userid weblogic ...
<Jan 19, 2010 3:16:12 PM EST> <Error> <RJVM> <BEA-000503> <Incoming message header or abbreviation processing failed
java.io.InvalidClassException: javax.management.ObjectName; local class incompatible: stream classdesc serialVersionUID = -5467795090068647408, local class serialVersionUID = 1081892073854801359
java.io.InvalidClassException: javax.management.ObjectName; local class incompatible: stream classdesc serialVersionUID = -5467795090068647408, local class serialVersionUID = 1081892073854801359
at java.io.ObjectStreamClass.initNonProxy(Ljava.io.ObjectStreamClass;Ljava.lang.Class;Ljava.lang.ClassNotFoundException;Ljava.io.ObjectStreamClass;)V(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Z)Ljava.io.ObjectStreamClass;(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Z)Ljava.io.ObjectStreamClass;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
at weblogic.rjvm.ClassTableEntry.readExternal(ClassTableEntry.java:36)
at java.io.ObjectInputStream.readExternalData(Ljava.io.Externalizable;Ljava.io.ObjectStreamClass;)V(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject0(Z)Ljava.lang.Object;(Unknown Source)
at java.io.ObjectInputStream.readObject()Ljava.lang.Object;(Unknown Source)
at weblogic.rjvm.InboundMsgAbbrev.readObject(InboundMsgAbbrev.java:65)
at weblogic.rjvm.InboundMsgAbbrev.read(InboundMsgAbbrev.java:37)
at weblogic.rjvm.MsgAbbrevJVMConnection.readMsgAbbrevs(MsgAbbrevJVMConnection.java:214)
at weblogic.rjvm.MsgAbbrevInputStream.init(MsgAbbrevInputStream.java:174)
at weblogic.rjvm.MsgAbbrevJVMConnection.dispatch(MsgAbbrevJVMConnection.java:426)
at weblogic.rjvm.t3.MuxableSocketT3.dispatch(MuxableSocketT3.java:368)
at weblogic.socket.AbstractMuxableSocket.dispatch(AbstractMuxableSocket.java:378)
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:853)
at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:789)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:283)
at weblogic.socket.SocketReaderRequest.run(SocketReaderRequest.java:29)
at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
>
The CompatabilityMBeanServer is not initialized properly.
This might happen if the CompatabilityMBeanServer is
disabled via the JMXMBean.
To view the root cause exception use dumpStack()
WLST detected that the RuntimeMBeanServer is not enabled. This
might happen if the RuntimeMBeanServer is disabled via the JMXMBean.
Please ensure that this MBeanServer is enabled. Online WLST cannot
function without this MBeanServer.
Traceback (innermost last):
File "<console>", line 1, in ?
File "<iostream>", line 22, in connect
WLSTException: 'Error occured while performing connect : "Cannot connect to WLST."While trying to lookup \'weblogic.management.mbeanservers.runtime\' didn\'t find subcontext \'mbeanservers\' Resolved weblogic.management Use dumpStack() to view the full stacktrace'
Any suggestions?pfa the code that i have for my WL 9.1 JDK 1.5 and the same is failing to compli itself when i am trying with WL 81. jdk 14. so can you please review and let help me out to sort out the issue please.
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Hashtable;
import java.rmi.Remote
import javax.management.MBeanServer
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
public class EnvDetail {
public static String username = "system";
public static String password = "password";
public static int chkValue;
public static String hostname = null;
public static String port = null;
private static MBeanServerConnection connection;
private static JMXConnector connector;
private static final ObjectName service; // Initializing the object name for DomainRuntimeServiceMBean
// so it can be used throughout the class.
static {
try {
service = new ObjectName("com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean");
}catch (MalformedObjectNameException e)
throw new AssertionError(e.getMessage());
/* * Initialize connection to the Domain Runtime MBean Server */
public static void initConnection(String hostname, String portString, String username, String password)
throws IOException, MalformedURLException {
String protocol = "t3";
Integer portInteger = Integer.valueOf(portString);
int port = portInteger.intValue();
String jndiroot = "/jndi/";
String mserver = "weblogic.management.mbeanservers.domainruntime";
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port, jndiroot + mserver);
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
} /* * Print an array of ServerRuntimeMBeans. * This MBean is the root of the runtime MBean hierarchy, and * each server in the domain hosts its own instance. */
public static ObjectName[] getServerRuntimes() throws Exception {
return (ObjectName[]) connection.getAttribute(service, "ServerRuntimes");
public void getJvmRuntime() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
String name = (String) connection.getAttribute(serverRT,"Name");
ObjectName jvmRT = (ObjectName) connection.getAttribute(serverRT[i],"JVMRuntime");
System.out.println("\n..<"+name+" : .JVMRuntime>");
Long heapSMX =(Long)connection.getAttribute(jvmRT, "HeapSizeMax");
System.out.println("HeapSizeMax :" Math.round((heapSMX.longValue()/1048576*100000)/100000) " MB ("+connection.getAttribute(jvmRT, "HeapSizeMax")+")" );
Long heapSC =(Long)connection.getAttribute(jvmRT, "HeapSizeCurrent");
System.out.println("HeapSizeCurrent :" Math.round((heapSC.longValue()/1048576*100000)/100000) " MB ("+connection.getAttribute(jvmRT, "HeapSizeCurrent")+" bytes)");
Long heapFC =(Long)connection.getAttribute(jvmRT, "HeapFreeCurrent");
System.out.println("HeapFreeCurrent :" Math.round((heapFC.longValue()/1048576*100000)/100000) " MB ("+connection.getAttribute(jvmRT, "HeapFreeCurrent")+" bytes)");
System.out.println("HeapFreePercent :" + connection.getAttribute(jvmRT, "HeapFreePercent")+"%");
System.out.println("JavaVendor :" + connection.getAttribute(jvmRT, "JavaVendor"));
System.out.println("JavaVersion :" + connection.getAttribute(jvmRT, "JavaVersion"));
Long uptime =(Long)connection.getAttribute(jvmRT, "Uptime");
System.out.println("Uptime :" + connection.getAttribute(jvmRT, "Uptime")+" milliseconds (" + (uptime*.001)+" Seconds)");
System.out.println("******************\n");
public void getJdbcRuntime() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
String name = (String) connection.getAttribute(serverRT[i],"Name");
ObjectName[] appRT =
(ObjectName[]) connection.getAttribute(new ObjectName("com.bea:Name="+name+",ServerRuntime="+name+",Location="+name+",Type=JDBCServiceRuntime"),"JDBCDataSourceRuntimeMBeans");
int appLength = (int) appRT.length;
for (int x = 0; x < appLength; x++) {
System.out.println("\n.. .<"+name+" : JDBCDataSourceRuntimeMBeans>" + (String)connection.getAttribute(appRT[x], "Name")+"");
System.out.println("ActiveConnectionsCurrentCount : " + connection.getAttribute(appRT[x], "ActiveConnectionsCurrentCount"));
System.out.println("ActiveConnectionsAverageCount : " + connection.getAttribute(appRT[x], "ActiveConnectionsAverageCount"));
System.out.println("ActiveConnectionsAverageCount : " + connection.getAttribute(appRT[x], "ActiveConnectionsAverageCount"));
System.out.println("ConnectionsTotalCount : " + connection.getAttribute(appRT[x], "ConnectionsTotalCount"));
System.out.println("CurrCapacity : " + connection.getAttribute(appRT[x], "CurrCapacity"));
System.out.println("CurrCapacityHighCount : " + connection.getAttribute(appRT[x], "CurrCapacityHighCount"));
System.out.println("HighestNumAvailable : " + connection.getAttribute(appRT[x], "HighestNumAvailable"));
System.out.println("HighestNumAvailable : " + connection.getAttribute(appRT[x], "HighestNumAvailable"));
System.out.println("LeakedConnectionCount : " + connection.getAttribute(appRT[x], "LeakedConnectionCount"));
System.out.println("WaitSecondsHighCount : " + connection.getAttribute(appRT[x], "WaitSecondsHighCount"));
System.out.println("WaitingForConnectionCurrentCount: " + connection.getAttribute(appRT[x], "WaitingForConnectionCurrentCount"));
System.out.println("WaitingForConnectionFailureTotal: " + connection.getAttribute(appRT[x], "WaitingForConnectionFailureTotal"));
System.out.println("WaitingForConnectionTotal : " + connection.getAttribute(appRT[x], "WaitingForConnectionTotal"));
System.out.println("WaitingForConnectionHighCount : " + connection.getAttribute(appRT[x], "WaitingForConnectionHighCount"));
System.out.println(".\n");
public void getThreadStateandName() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
//System.out.println("got server runtimes");
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
String name = (String) connection.getAttribute(serverRT[i], "Name");
String state = (String) connection.getAttribute(serverRT[i],"State");
System.out.println("Server name: " + name + ". Server state: " + state);
ObjectName ThreadRT =(ObjectName) connection.getAttribute(serverRT[i], "ThreadPoolRuntime");
System.out.println("ExecuteThreadTotalCount :"+ (Object)connection. getAttribute(ThreadRT,"ExecuteThreadTotalCount"));
System.out.println("StandbyThreadCount:"+ (Object)connection.getAttribute(ThreadRT, "StandbyThreadCount"));
Integer e_ThreadTotal =(Integer)(Object)connection. getAttribute(ThreadRT,"ExecuteThreadTotalCount");
Integer e_standbyCount = (Integer)connection.getAttribute(ThreadRT, "StandbyThreadCount");
int eThreadTotal = e_ThreadTotal.intValue();
int estandbyCount = e_standbyCount.intValue();
System.out.println("ExecuteActiveThreadCount:"+(eThreadTotal-estandbyCount));
System.out.println("ExecuteThreadIdleCount :"+ (Object)connection. getAttribute(ThreadRT,"ExecuteThreadIdleCount"));
System.out.println("ExecuteHoggingThreadCount:"+ (Object)connection.getAttribute(ThreadRT, "HoggingThreadCount"));
System.out.println("Throughput :"+ (Object)connection.getAttribute(ThreadRT, "Throughput"));
System.out.println("HealthState :"+ (Object)connection.getAttribute(ThreadRT, "HealthState"));
//System.out.println("QueueLength:"+ (Object)connection.getAttribute(ThreadRT, "QueueLength"));
//System.out.println("StandbyThreadCount:"+ (Object)connection.getAttribute(ThreadRT, "StandbyThreadCount"));
//System.out.println("ExecuteActiveThreadCount:"+ (Object[])connection.getAttribute(ThreadRT, "ExecuteThreads"));
//System.out.println("ExecuteActiveThreadCount:"+ ((Object[])connection.getAttribute(ThreadRT, "ExecuteThreads")).size());
//System.out.println("ExecuteActiveThreadCount:"+ ((Object[])connection.getAttribute(ThreadRT, "ExecuteThreads")).length);
public void getExecuteAll() throws Exception {
System.out.println("*****************-Heap-****************");
getJvmRuntime();
System.out.println("*****************-JDBC-****************");
getJdbcRuntime();
System.out.println("*****************-Thread-****************");
getThreadStateandName();
public static void main(String[] args) throws Exception {
if (args.length != 5) {
System.out.println("\n CheckValue ------> HeapCheck : 1\n");
System.out.println(" CheckValue ------> DBCConnectionCheck : 2\n");
System.out.println(" CheckValue ------> ThreadStatusCheck : 3\n");
System.out.println(" CheckValue ------> All : 0\n");
System.out.println("Usage: java EnvDetail HostName Port CheckValue\n");
//System.out.println(args[0]);
String hostname =args[0];
//System.out.println(args[1]);
String port= args[1];
//System.out.println(args[2]);
chkValue = Integer.parseInt(args[2]);
EnvDetail ts = new EnvDetail();
initConnection(hostname,port, username, password);
switch (chkValue) {
case 1: ts.getJvmRuntime(); break;
case 2: ts.getJdbcRuntime(); break;
case 3: ts.getThreadStateandName(); break;
case 0: ts.getExecuteAll(); break;
case 5: System.out.println("CheckValue5"); break;
return;
}//main method
}// class -
How to get application's state on weblogic server using jmx.
I want to get application state using JMX, I am able to get application list, name but not able to find its state. Some code snippet mentioned below. Please let me know if I can use some other MBean
Thanks in advance..
static {
try {
service = new ObjectName("com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean");
}catch (MalformedObjectNameException e) {
throw new AssertionError(e.getMessage());
* Initialize connection to the Domain Runtime MBean Server
public static void initConnection(String hostname, String portString, String username, String password) throws IOException, MalformedURLException
String protocol = "t3";
int port = Integer.parseInt(portString);
String jndiroot = "/jndi/";
String mserver = "weblogic.management.mbeanservers.domainruntime";
JMXServiceURL serviceURL= new JMXServiceURL(protocol,hostname, port, jndiroot+mserver);
// JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, portString, jndiroot , mserver);
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
* Get an array of ServerRuntimeMBeans
public static ObjectName[] getServerRuntimes() throws Exception {
return (ObjectName[]) connection.getAttribute(service,
"ServerRuntimes");
* Get an array of WebAppComponentRuntimeMBeans
public void getApplicationData() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
ObjectName[] appRT =
(ObjectName[]) connection.getAttribute(serverRT,
"ApplicationRuntimes");
int appLength = (int) appRT.length;
for (int x = 0; x < appLength; x++) {
System.out.println("Application name: " +
(String)connection.getAttribute(appRT[x], "Name")+"Application Status"+(String)connection.getAttribute(appRT[x], "State"));
public static void main(String[] args) throws Exception {
String hostname = "*****.us.oracle.com";
String portString = "*****";
String username = "***";
String password = "****";
JMXUtil s = new JMXUtil();
initConnection(hostname, portString, username, password);
s.getApplicationData();
connector.close();register at elicense.bea.com and ask there.
but, a license is a license, as long as the ipaddr is not restricted.
Wayne
Bora wrote:
I downloaded an Evaluation copy from BEA but it expires in 30 days. The place I
work has licenses for HPUX but I need to have a copy on my laptop for development
& test.
Thanks for help!
Sincerely
Bora -
How to get the current EAR name in a servlet ?
Greetings,
In a servlet, I need to retrive the EAR name. Using the ServerRuntimeMBean I can retrieve the list of the applications via the ApplicationsRuntime attribute. But I don't find any CurrentApplicationRuntime attribute or something similar. Many thanks in advance for any help.
Kind regards,
Nicolasj0o wrote:
System.out.println("Class Name: " + new Exception().getStackTrace()[0].getClassName() +
"/n Method Name : " + new Exception().getStackTrace()[0].getMethodName() +
"/n Line number : " + new Exception().getStackTrace()[0].getLineNumber());
I pointed the OP at this approach yesterday in one of his multi-posts. I still have not been given my Dukes! -
I am getting this error , any body please help
When i am using WLST to connect the admin server i am getting the following error.
I appreciate, if anybody can help me to resolve this.
connect('system', 'system','t3://localhost:9001')
Connecting to weblogic server instance running at t3://localhost:9001 as username system ...
Traceback (innermost last):
File "<input>", line 1, in ?
File "<iostream>", line 74, in connect
WLSTException: 'Error occured while performing connect : Unknown Error. Use dumpStack() to view the error stack trace'
wls:/(offline)> dumpStack( )
weblogic.rjvm.PeerGoneException: ; nested exception is:
java.io.EOFException
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:137)
at weblogic.management.mbeanservers.compatibility.internal.RemoteMBeanServerImpl_922_WLStub.getAttribute(Unknown Source)
at weblogic.management.internal.MBeanProxy.getAttribute(MBeanProxy.java:610)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:226)
at $Proxy0.isAdminServer(Unknown Source)
at weblogic.management.scripting.WLScriptContext.connect(WLScriptContext.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at org.python.pycode._pyx0.connect$2(<iostream>:68)
at org.python.pycode._pyx0.call_function(<iostream>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.pycode._pyx3.f$0(<input>:1)
at org.python.pycode._pyx3.call_function(<input>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at org.python.core.Py.exec(Py.java)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at weblogic.WLST.main(WLST.java:110)
Caused by: java.io.EOFException
at weblogic.rjvm.t3.T3JVMConnection.endOfStream(T3JVMConnection.java:874)
at weblogic.socket.SocketMuxer.deliverExceptionAndCleanup(SocketMuxer.java:583)
at weblogic.socket.SocketMuxer.deliverEndOfStream(SocketMuxer.java:533)
at weblogic.socket.SocketMuxer.readReadySocketOnce(SocketMuxer.java:691)
at weblogic.socket.SocketMuxer.readReadySocket(SocketMuxer.java:638)
at weblogic.socket.JavaSocketMuxer.processSockets(JavaSocketMuxer.java:282)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:32)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
[weblogic.rjvm.PeerGoneException: ; nested exception is:
java.io.EOFException]
at weblogic.management.mbeanservers.compatibility.internal.RemoteMBeanServerImpl_922_WLStub.getAttribute(Unknown Source)
at weblogic.management.internal.MBeanProxy.getAttribute(MBeanProxy.java:610)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:226)
at $Proxy0.isAdminServer(Unknown Source)
at weblogic.management.scripting.WLScriptContext.connect(WLScriptContext.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at org.python.pycode._pyx0.connect$2(<iostream>:68)
at org.python.pycode._pyx0.call_function(<iostream>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.pycode._pyx3.f$0(<input>:1)
at org.python.pycode._pyx3.call_function(<input>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at org.python.core.Py.exec(Py.java)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at weblogic.WLST.main(WLST.java:110)
weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
[weblogic.rjvm.PeerGoneException: ; nested exception is:
java.io.EOFException]
wls:/(offline)>I am getting this error even though tunneling is enabled, anybody knows why this happens
Connecting to weblogic server instance running at http://localhost:9001 as username system ...
<Mar 30, 2009 4:15:52 PM EDT> <Error> <RJVM> <BEA-000515> <execute failed
java.net.ProtocolException: Tunneling result not OK, result: 'DEAD', id: '2'
java.net.ProtocolException: Tunneling result not OK, result: 'DEAD', id: '2'
at weblogic.rjvm.http.HTTPClientJVMConnection.receiveAndDispatch(HTTPClientJVMConnection.java:463)
at weblogic.rjvm.http.HTTPClientJVMConnection.execute(HTTPClientJVMConnection.java:327)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
>
Traceback (innermost last):
File "<input>", line 1, in ?
File "<iostream>", line 74, in connect
WLSTException: 'Error occured while performing connect : Unknown Error. Use dumpStack() to view the error stack trace'
wls:/(offline)> dumpStack()
weblogic.rjvm.PeerGoneException: ; nested exception is:
java.net.ProtocolException: Tunneling result not OK, result: 'DEAD', id: '2'
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:137)
at weblogic.management.mbeanservers.compatibility.internal.RemoteMBeanServerImpl_922_WLStub.getAttribute(Unknown Source)
at weblogic.management.internal.MBeanProxy.getAttribute(MBeanProxy.java:610)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:226)
at $Proxy0.isAdminServer(Unknown Source)
at weblogic.management.scripting.WLScriptContext.connect(WLScriptContext.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at org.python.pycode._pyx0.connect$2(<iostream>:68)
at org.python.pycode._pyx0.call_function(<iostream>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.pycode._pyx2.f$0(<input>:1)
at org.python.pycode._pyx2.call_function(<input>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at org.python.core.Py.exec(Py.java)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at weblogic.WLST.main(WLST.java:110)
Caused by: java.net.ProtocolException: Tunneling result not OK, result: 'DEAD', id: '2'
at weblogic.rjvm.http.HTTPClientJVMConnection.receiveAndDispatch(HTTPClientJVMConnection.java:463)
at weblogic.rjvm.http.HTTPClientJVMConnection.execute(HTTPClientJVMConnection.java:327)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
[weblogic.rjvm.PeerGoneException: ; nested exception is:
java.net.ProtocolException: Tunneling result not OK, result: 'DEAD', id: '2']
at weblogic.management.mbeanservers.compatibility.internal.RemoteMBeanServerImpl_922_WLStub.getAttribute(Unknown Source)
at weblogic.management.internal.MBeanProxy.getAttribute(MBeanProxy.java:610)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:226)
at $Proxy0.isAdminServer(Unknown Source)
at weblogic.management.scripting.WLScriptContext.connect(WLScriptContext.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
at org.python.core.PyMethod.__call__(PyMethod.java)
at org.python.core.PyObject.__call__(PyObject.java)
at org.python.core.PyObject.invoke(PyObject.java)
at org.python.pycode._pyx0.connect$2(<iostream>:68)
at org.python.pycode._pyx0.call_function(<iostream>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyFunction.__call__(PyFunction.java)
at org.python.pycode._pyx2.f$0(<input>:1)
at org.python.pycode._pyx2.call_function(<input>)
at org.python.core.PyTableCode.call(PyTableCode.java)
at org.python.core.PyCode.call(PyCode.java)
at org.python.core.Py.runCode(Py.java)
at org.python.core.Py.exec(Py.java)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java)
at weblogic.WLST.main(WLST.java:110)
weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
[weblogic.rjvm.PeerGoneException: ; nested exception is:
java.net.ProtocolException: Tunneling result not OK, result: 'DEAD', id: '2'] -
Printing the Name and State of Servers
Hi,
Please can somebody help in executing the below mentioned code which will print the name and state of the servers.
Below Java file taken from the following location : http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13951/core/index.html
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Hashtable;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
public class PrintServerState {
private static MBeanServerConnection connection;
private static JMXConnector connector;
private static final ObjectName service;
// Initializing the object name for DomainRuntimeServiceMBean
// so it can be used throughout the class.
static {
try {
service = new ObjectName(
"com.bea:Name=DomainRuntimeService,Type=weblogic.management.
mbeanservers.domainruntime.DomainRuntimeServiceMBean");
}catch (MalformedObjectNameException e) {
throw new AssertionError(e.getMessage());
* Initialize connection to the Domain Runtime MBean Server
public static void initConnection(String hostname, String portString,
String username, String password) throws IOException,
MalformedURLException {
String protocol = "t3";
Integer portInteger = Integer.valueOf(portString);
int port = portInteger.intValue();
String jndiroot = "/jndi/";
String mserver = "weblogic.management.mbeanservers.domainruntime";
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
port, jndiroot + mserver);
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
* Print an array of ServerRuntimeMBeans.
* This MBean is the root of the runtime MBean hierarchy, and
* each server in the domain hosts its own instance.
public static ObjectName[] getServerRuntimes() throws Exception {
return (ObjectName[]) connection.getAttribute(service,
"ServerRuntimes");
* Iterate through ServerRuntimeMBeans and get the name and state
public void printNameAndState() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
System.out.println("got server runtimes");
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
String name = (String) connection.getAttribute(serverRT,
"Name");
String state = (String) connection.getAttribute(serverRT[i],
"State");
System.out.println("Server name: " + name + ". Server state: "
+ state);
public static void main(String[] args) throws Exception {
String hostname = args[0];
String portString = args[1];
String username = args[2];
String password = args[3];
PrintServerState s = new PrintServerState();
initConnection(hostname, portString, username, password);
s.printNameAndState();
connector.close();
When executing the above mentioned code getting the following error
Exception in thread "main" java.net.MalformedURLException: Bad IPv6 address: t3:
//localhost
at javax.management.remote.JMXServiceURL.validateHost(Unknown Source)
at javax.management.remote.JMXServiceURL.validateHost(Unknown Source)
at javax.management.remote.JMXServiceURL.validate(Unknown Source)
at javax.management.remote.JMXServiceURL.<init>(Unknown Source)
at PrintServerState.initConnection(PrintServerState.java:39)
at PrintServerState.main(PrintServerState.java:84)
Caused by: java.net.UnknownHostException: t3://localhost
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(Unknown Source)
at java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getAllByName(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
... 6 moreHi,
Copy the below code and save it as PrintServerState.java,
I also have copied the code from
http://docs.oracle.com/cd/E21764_01/web.1111/e13728/accesswls.htm#i1116377
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Hashtable;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
import java.lang.*;
public class PrintServerState {
private static MBeanServerConnection connection;
private static JMXConnector connector;
private static final ObjectName service;
// Initializing the object name for DomainRuntimeServiceMBean
// so it can be used throughout the class.
static {
try {
service = new ObjectName(
"com.bea:Name=DomainRuntimeService,Type=weblogic.management.
mbeanservers.domainruntime.DomainRuntimeServiceMBean");
}catch (MalformedObjectNameException e) {
throw new AssertionError(e.getMessage());
* Initialize connection to the Domain Runtime MBean Server
public static void initConnection(String hostname, String portString,
String username, String password) throws IOException,
MalformedURLException {
String protocol = "t3";
Integer portInteger = Integer.valueOf(portString);
int port = portInteger.intValue();
String jndiroot = "/jndi/";
String mserver = "weblogic.management.mbeanservers.domainruntime";
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname,
port, jndiroot + mserver);
Hashtable h = new Hashtable();
h.put(Context.SECURITY_PRINCIPAL, username);
h.put(Context.SECURITY_CREDENTIALS, password);
h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, h);
connection = connector.getMBeanServerConnection();
* Print an array of ServerRuntimeMBeans.
* This MBean is the root of the runtime MBean hierarchy, and
* each server in the domain hosts its own instance.
public static ObjectName[] getServerRuntimes() throws Exception {
return (ObjectName[]) connection.getAttribute(service,
"ServerRuntimes");
* Iterate through ServerRuntimeMBeans and get the name and state
public void printNameAndState() throws Exception {
ObjectName[] serverRT = getServerRuntimes();
System.out.println("got server runtimes");
int length = (int) serverRT.length;
for (int i = 0; i < length; i++) {
String name = (String) connection.getAttribute(serverRT,
"Name");
String state = (String) connection.getAttribute(serverRT[i],
"State");
System.out.println("Server name: " + name + ". Server state: "
+ state);
public static void main(String[] args) throws Exception {
String hostname = args[0];
String portString = args[1];
String username = args[2];
String password = args[3];
PrintServerState s = new PrintServerState();
initConnection(hostname, portString, username, password);
s.printNameAndState();
connector.close();
Now compile it as javac -d . PrintServerState.java
Then Execute WL_HOME/weblogic92/server/bin/setWLSEnv.sh
Now Execute ur class file generated as
java -classpath .:WL_HOME/weblogic92/server/lib/wljmxclient.jar PrintServerState ipaddress port username password
The output will be as follows
Server name: Server3. Server state: RUNNING
Server name: Server2. Server state: RUNNING
Server name: Server1. Server state: RUNNING
Server name: Server4. Server state: RUNNING
Regards
Fabian -
I have a class that is used to check the status of all managed server in a domain. I use this class to check on the status of multiple domains.
I have a for loop over all the domains and then invoke the method below, one for each domain (I instantiate the class anew for each domain)
The 1st domain connects and returns the status properly. However on subsequent iterations thru the look I get the following SecuriyException below. I have tried a number of things such as setting MBeanHome to null etc but this error repeats anytime I connect to N+1 domains.
Is there a fix for this.
Note: I am using WLS 8.1 SP3 thru 5. And I know the username & pwd is correct cause I can connect using to the admin console using the same username & password and am part of the Administrators group.
Exception on the client on N+1 connect attemp:
java.lang.SecurityException: [Security:090398]Invalid Subject: admin
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.j
ava:108)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:137)
at weblogic.management.internal.AdminMBeanHomeImpl_815_WLStub.getDomainN
ame(Unknown Source)
Exception on the server:
####<Mar 28, 2006 2:59:51 PM CST> <Warning> <RMI> <htx6056> <AdminServer> <Execu
teThread: '2' for queue: 'weblogic.socket.Muxer'> <<WLS Kernel>> <> <BEA-080003>
<RuntimeException thrown by rmi server: weblogic.rmi.internal.BasicServerRef@10
2 - hostID: '-4547912678907759832S:htx6056.cce.hp.com:[10250,10250,10251,10251,1
0250,10251,-1,0,0]:arc_prd1:AdminServer', oid: '258', implementation: 'weblogic.
management.internal.AdminMBeanHomeImpl@1e22632'
java.lang.SecurityException: [Security:090398]Invalid Subject: admin.
java.lang.SecurityException: [Security:090398]Invalid Subject: admin
The code:
public void checkWebLogicServerState( String user, String pass, String url ) throws Exception {
MBeanHome home = Helper.getAdminMBeanHome( user, pass, url );
Set beans = home.getMBeansByType( "Server", home.getDomainName( ));
for( Iterator iter = beans.iterator( ); iter.hasNext( );){
WebLogicMBean bean = (WebLogicMBean)iter.next( );
WebLogicObjectName objName = bean.getObjectName( );
String serverName = objName.getName( );
String location = objName.getLocation( );
ServerRuntimeMBean serverRuntimeMBean = null;
try {
serverRuntimeMBean = (ServerRuntimeMBean)home.getMBean( serverName, "ServerRuntime", home.getDomainName( ), serverName);
String state = serverRuntimeMBean.getState( );
System.out.println( "\t[" + serverName + "] IS " + state + "." );
} catch( Exception ex ) {
System.out.println( "\t[" + serverName + "] IS NOT RUNNING." );
}I worked around the problem by removing the usage of the weblogic.management.Helper and using standard JNDI lookups instead.
Clearly there is a bug in the Helper class that stores securtiy information in a static variable since it cannot be re used within the same JVM/Classloader without sharing the security information.
Used instead:
Environment env = new Environment();
env.setProviderUrl( url );
env.setSecurityPrincipal( user );
env.setSecurityCredentials( pass );
Context ctx = env.getInitialContext( );
home = (MBeanHome)ctx.lookup( MBeanHome.ADMIN_JNDI_NAME ); -
What is the alternate for T3ServicesDef.config()
Hi,
In 5.1, I was using
T3ServicesDef.config().getProperty(DBStatic.WEBLOGIC_PORT_IDENTIFIER)
inside my program to get the port where my server is running.
Now it seems I need to use Management APIs.
Could someone please let me know how to do it using new APIs.
I read the documentation posted on this. But that seems to tell me that I
need to get the handle of MBeanHome first, and for that I need to know the
port where weblogic is running.
SushilSushil Goel <[email protected]> wrote in message news:[email protected]...
Sanjeev,
I have two questions about this doc:
1. This document talks about creating my own MBean. I was interested in
using the weblogic MBeans, e.g. ServerRuntimeMBean to find out runtime
configuration. I have been struggling to find out how to get a handle to
this object. The methods exposed by MBeanHome such as getMBeansByType at
least needs a type string supplied and I don't see any documentation
pointing what is the type of these beans. I might be missing something very
basic here. I understand that eventually I need to read the javax.management
specs to get the complete idea. It would be nice if there is some
documentation which doesn't assume knowledge of management specs.Sushil, there seems to be a missing section in this doc, which talks about how MBeans are named and how to tell which type,name strings to use. See below ....
It should say someting like ....
Naming of MBeans
The WebLogic Management API distinguishes between three types of MBeans: Administration, Configuration and Runtime MBeans, as described in the overiew section. All MBeans have a name, a type and a domain. These attributes are reflected in the MBean's JMX Object Name. The Object Name is the unique identifier for a given MBean across all domains. It has the following structure:
<domain name>:Name=<name>,Type=<type>[,<attr>=<value>]...
Name is a name that is unique for a given Domain and a given Type. Examples of type could be Server, WebComponent or JDBCConnectionPoolRuntime. Type is used to distinguish between the various types of MBeans. For instance the value of Type for a Server MBean is :
a.. Server for the Administration MBean,
b.. ServerConfig for the Configuration MBean and
c.. ServerRuntime for the Runtime MBean.
Note that the 'MBean' suffix is removed from the MBean interface name to get the base type of an MBean. And then 'Config' and 'Runtime' suffices are added to the base name to distinguish configuration and runtime mbeans, respectively from administration mbean.
In addition, specific MBean types have additional components...
a.. All runtime and configuration mbeans have a component called 'Location' whose value is the name of the server on which that mbean is located. e.g. 'mydomain:Name=myServlet,Type=ServletRuntime,Location=myserver'
b.. Any mbean which has a child relationship with another parent mbean, has an extra attribute in its objectname '<TypeOfParentMBean>=<NameOfParentMBean>'. e.g. 'mydomain:Name=mylog,Type=Log,Server=myserver'
Package names
All interfaces types for Administration/Configuration mbeans are located in weblogic.management.configuration
All interfaces types for Runtime mbeans are located in weblogic.management.runtime
>
2. This document talks about ISVServer class to create my own entry point. I
don't see this class anywhere. BEA support says that this kind of startup is
no longer supported. Could you please clarify this and point me where I
could find this class and related API doc.
There is no link for this document from the 6.0 documentation page. Until I
came to this group and stumbled upon your earlier post about this doc, I had
no idea about existence of this doc, even when I had asked BEA support
specifically for a 6.0 ISV doc.I will have this fixed. Thanks.
>
Thank,
Sushil
"Sanjeev Chopra" <[email protected]> wrote in message
news:[email protected]...
see http://e-docs.bea.com/wls/docs60/isv/index.html
Sushil Goel <[email protected]> wrote in message
news:[email protected]...
Thanks Viresh,
How do I get handle to the beans in weblogic.management.configuration or
weblogic.management.runtime?
Thanks,
Sushil
"Viresh Garg" <[email protected]> wrote in message
news:[email protected]...
Sushil Goel wrote:
Hi,
In 5.1, I was using
T3ServicesDef.config().getProperty(DBStatic.WEBLOGIC_PORT_IDENTIFIER)
inside my program to get the port where my server is running.
Now it seems I need to use Management APIs.
Could someone please let me know how to do it using new APIs.
I read the documentation posted on this. But that seems to tell methat
I
need to get the handle of MBeanHome first, and for that I need to
know
the
port where weblogic is running.You don't need to specify URL from within the server to do MBean
lookup
and so
you don't need to know of the port.
Viresh Garg
Principal Developer Relations Engineer
BEA Systems
Sushil
[att1.html] -
Best way to determine if JMS server is alive in a cluster
Can anyone give me an idea on the best way to find out if a JMS server
in a cluster
has failed so I can signal migration to another server in the cluster.
Thanks Larry
PS weblogic 7.0 sp1
Hallo Larry,
you can go via JMX and retrieve the according RuntimeMBeans in order to
check the health state of the
JMSServer resp. the server hosting the JMSServer. If they are not available
or failed you can trigger the
migration. At least that's the way I'm doing it...
try
JMSServerMBean jmsServer = null;
ServerMBean candidateServer = null;
MigratableTargetMBean migratableTarget = null;
* Retrieve all JMSServer defined for the current domain
Set jmsServerSet = home.getMBeansByType("JMSServer", domainName);
Object[] jmsServers = jmsServerSet.toArray();
* Just the first one is picked assuming there is only one defined
* within the active FHO domain
if(jmsServers != null && jmsServers.length > 0)
jmsServer = (JMSServerMBean) jmsServers[0];
if(s_logger.isDebugEnabled())
s_logger.debug("JMSServer: " + jmsServer.getName());
* A JMSServer can only be associated with a single target,
* thus pick again the first from the list.
TargetMBean[] targets = jmsServer.getTargets();
if(targets != null && targets.length > 0)
boolean hostingServerRunning = false;
boolean candidateServerRunning = false;
* Check whether the JMSServer is really associated with
* a migratable target. Otherwise the migration must be canceled
* since it cannot be performed!
if(targets[0] instanceof MigratableTargetMBean)
migratableTarget = (MigratableTargetMBean) targets[0];
* Retrieve all available candidates and select a running instance
* if any. First check for constrained candidate servers, than for
* all candidate servers
ServerMBean[] candidates =
migratableTarget.getConstrainedCandidateServers();
if(candidates == null || candidates.length == 0)
candidates = migratableTarget.getAllCandidateServers();
if(candidates != null && candidates.length > 0)
ServerMBean hostingServer = migratableTarget.getHostingServer();
boolean gotHostingServer = false;
boolean gotCandidateServer = false;
boolean runningInstance = false;
* Loop over all candidates as long as hosting server and candidate
* server are visited and there running state has been determined
for(int i=0; i< candidates.length; i++)
ServerRuntimeMBean serverRuntime = null;
* Retrieve the current state from the according runtime MBean
* if available
try
serverRuntime = (ServerRuntimeMBean) home.getMBean(new
WebLogicObjectName(candidates.getName(), "ServerRuntime", domainName,
candidates[i].getName()));
runningInstance =
serverRuntime.getState().equalsIgnoreCase(ServerRuntimeMBean.RUNNING);
catch(InstanceNotFoundException inf)
* When a server instance is not available, an InstanceNotFoundException will
be raised
* by WLS, which can be ignored
if(hostingServer != null && hostingServer.equals(candidates[i]))
hostingServerRunning = runningInstance;
gotHostingServer = true;
else
* A running candidate server will be prefered, thus only if no running
* instance can be detected, another instance is selected
if(!gotCandidateServer)
candidateServerRunning = runningInstance;
candidateServer = candidates[i];
gotCandidateServer = runningInstance;
if(gotCandidateServer && gotHostingServer)
break;
if(s_logger.isDebugEnabled())
s_logger.debug("Migratable Target: " + migratableTarget.getName());
s_logger.debug("Candidate Server: " + candidateServer.getName());
else
throw new Exception("JMSServer not deployed on a migratable target!");
* Retrieve the migration service coordinator for the active domain assuming
* there exists only one and invoke the migration later on
MigratableServiceCoordinatorRuntimeMBean coordinator = null;
Set coordinatorSet =
home.getMBeansByType("MigratableServiceCoordinatorRuntime", domainName);
Object[] coordinators = coordinatorSet.toArray();
if(coordinators.length > 0)
coordinator = (MigratableServiceCoordinatorRuntimeMBean) coordinators[0];
if(enforceMigrationOnInstancesDown)
coordinator.migrate(migratableTarget, candidateServer, hostingServerRunning,
candidateServerRunning);
else
coordinator.migrate(migratableTarget, candidateServer);
s_logger.info("Migration of JMSServer from node "
+ migratableTarget.getName()
+ " to node "
+ candidateServer.getName()
+ " has been started");
else
throw new Exception("MigrationServiceCoordinator cannot be retrieved");
catch(Exception e)
s_logger.error("Could not migrate JMSServer", e);
Regards,
CK
"Larry Presswood" <[email protected]> schrieb im Newsbeitrag
news:[email protected]...
> Can anyone give me an idea on the best way to find out if a JMS server
> in a cluster
> has failed so I can signal migration to another server in the cluster.
>
> Thanks Larry
>
> PS weblogic 7.0 sp1
> -
Persisting Configuration in Config.xml, Using Administration MBeans
Dear Friends,
I am facing a problem on persisting the configuration, using the administration
Mbeans.
I am using weblogic 6.1 sp1 version. And i am running weblogic in production mode.
i have made the AutoDeployEnabled=false in my config.xml file.
In my program i am setting a target to one my EJB component. But the entry in
the config.xml is not happening.
If anyone could help me in this problem, it would be greatful, thanx in advance.
I am attaching my code with here below.
import javax.naming.Context;
import java.util.Set;
import java.util.Iterator;
import java.util.Vector;
import weblogic.jndi.Environment;
import weblogic.management.MBeanHome;
import weblogic.management.WebLogicMBean;
import weblogic.management.WebLogicObjectName;
import weblogic.management.runtime.ServerRuntimeMBean;
import weblogic.management.configuration.ApplicationMBean;
import weblogic.management.configuration.ServerMBean;
import weblogic.management.configuration.ComponentMBean;
import weblogic.management.configuration.RepositoryMBean;
import weblogic.management.configuration.AdminMBean;
public class ListAllMbean{
public static void main(String args[]) {
String url = "t3://localhost:7001";
String username = "system";
String password = "security";
try {
//Obtaining an MBeanHome Using JNDI
Environment env = new Environment();
env.setProviderUrl(url);
env.setSecurityPrincipal(username);
env.setSecurityCredentials(password);
Context ctx = env.getInitialContext();
MBeanHome home = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
ServerMBean serverMbean = null;
Set targetMBeans = home.getMBeansByType("Server");
for (Iterator itr = targetMBeans.iterator(); itr.hasNext(); ) {
serverMbean = (ServerMBean)itr.next();
Set allMBeans = home.getMBeansByType("Application");
for (Iterator itr = allMBeans.iterator(); itr.hasNext(); ) {
ApplicationMBean application = (ApplicationMBean)itr.next();
// Getting all the components in the application
ComponentMBean comp[] = application.getComponents();
for ( int i = 0; i < comp.length; i++ ) {
// Setting the target, to deploy the component
if(comp.getName().equalsIgnoreCase("startup_ejbs_1")){
comp[i].addTarget(serverMbean);
// Using the repositaryMBean to persist, not sure this the right way
RepositoryMBean repositorymbean = (RepositoryMBean)home.getMBean("Default",
"Repository", "weblogic");
repositorymbean.saveDomain(home.getActiveDomain().getName()) ;
}catch(Exception e){
System.out.println(e);
Regards,
Karthickraj.Hi Karthik,
Why don't you post your question at http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=xover&group=weblogic.developer.interest.management.general_and_jmx&utag=
This is a portal server group and a remote chance of getting reply on JMX here.
Cheers
Syed
"Karthikraj" <[email protected]> wrote:
>
Dear Friends,
I am facing a problem on persisting the configuration, using the administration
Mbeans.
I am using weblogic 6.1 sp1 version. And i am running weblogic in production
mode.
i have made the AutoDeployEnabled=false in my config.xml file.
In my program i am setting a target to one my EJB component. But the
entry in
the config.xml is not happening.
If anyone could help me in this problem, it would be greatful, thanx
in advance.
I am attaching my code with here below.
import javax.naming.Context;
import java.util.Set;
import java.util.Iterator;
import java.util.Vector;
import weblogic.jndi.Environment;
import weblogic.management.MBeanHome;
import weblogic.management.WebLogicMBean;
import weblogic.management.WebLogicObjectName;
import weblogic.management.runtime.ServerRuntimeMBean;
import weblogic.management.configuration.ApplicationMBean;
import weblogic.management.configuration.ServerMBean;
import weblogic.management.configuration.ComponentMBean;
import weblogic.management.configuration.RepositoryMBean;
import weblogic.management.configuration.AdminMBean;
public class ListAllMbean{
public static void main(String args[]) {
String url = "t3://localhost:7001";
String username = "system";
String password = "security";
try {
//Obtaining an MBeanHome Using JNDI
Environment env = new Environment();
env.setProviderUrl(url);
env.setSecurityPrincipal(username);
env.setSecurityCredentials(password);
Context ctx = env.getInitialContext();
MBeanHome home = (MBeanHome)ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
ServerMBean serverMbean = null;
Set targetMBeans = home.getMBeansByType("Server");
for (Iterator itr = targetMBeans.iterator(); itr.hasNext();
serverMbean = (ServerMBean)itr.next();
Set allMBeans = home.getMBeansByType("Application");
for (Iterator itr = allMBeans.iterator(); itr.hasNext(); ) {
ApplicationMBean application = (ApplicationMBean)itr.next();
// Getting all the components in the application
ComponentMBean comp[] = application.getComponents();
for ( int i = 0; i < comp.length; i++ ) {
// Setting the target, to deploy the component
if(comp.getName().equalsIgnoreCase("startup_ejbs_1")){
comp[i].addTarget(serverMbean);
// Using the repositaryMBean to persist, not sure this the right
way
RepositoryMBean repositorymbean = (RepositoryMBean)home.getMBean("Default",
"Repository", "weblogic");
repositorymbean.saveDomain(home.getActiveDomain().getName())
}catch(Exception e){
System.out.println(e);
Regards,
Karthickraj. -
Hi All,
I am getting following exception while deploying application .
Can anybody point out reason for this.
Thank you in advance
[#|2007-12-18T10:57:48.499+0000|INFO|sun-appserver-ee8.2|javax.ee.enterprise.system.tools.synchronization|_ThreadID=131;|SYNC062:
Synchronization for dpEAIG0197E02prjStgComPrjIMS is complete. Total time
spent 9732 milli second(s).|#]
[#|2007-12-18T10:57:48.764+0000|SEVERE|sun-appserver-ee8.2|STC.eWay.framework.ra.com.stc.connector.framework.jca.system.STCResourceAdapter|_ThreadID=131;|In
createMBean(), error creating ObjectReference|#]
[#|2007-12-18T10:57:48.764+0000|SEVERE|sun-appserver-ee8.2|STC.eWay.framework.ra.com.stc.connector.framework.jca.system.STCResourceAdapter|_ThreadID=131;|Problem
creating RA MBeans|#]
[#|2007-12-18T10:57:48.764+0000|SEVERE|sun-appserver-ee8.2|javax.enterprise.resource.resourceadapter|_ThreadID=131;|RAR6035
: Resource adapter start failed : {0}
javax.resource.spi.ResourceAdapterInternalException:
com.stc.connector.management.STCCreateMBeanException:
SeeBeyond:GUID={07010000-254402EC160100-0AC92572-01},Name=dpEAIG0197E02prjStgComPrjIMS|prjIMS|dpEAIG0197E02|svcIMSIIFU232_eaLocal_IMS_001,type=RA
at
com.stc.connector.framework.jca.system.STCResourceAdapter.start(STCResourceAdapter.java:329)
at
com.sun.enterprise.connectors.ActiveInboundResourceAdapter.<init>(ActiveInboundResourceAdapter.java:107)
at
com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:71)
at
com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:267)
at
com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:189)
at
com.sun.enterprise.server.AbstractLoader.loadRars(AbstractLoader.java:665)
at
com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:145)
at
com.sun.enterprise.server.HttpServiceApplicationLoader.load(HttpServiceApplicationLoader.java:97)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:229)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:164)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:500)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:872)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:856)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:424)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:139)
at
com.sun.enterprise.ee.admin.mbeans.ServerRuntimeMBean.forwardEvent(ServerRuntimeMBean.java:64)
at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:305)
at
com.sun.enterprise.admin.runtime.BaseRuntimeMBean.invoke(BaseRuntimeMBean.java:386)
at
com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1410)
at
javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1247)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1343)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:784)
at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
|#]
[#|2007-12-18T10:57:48.766+0000|WARNING|sun-appserver-ee8.2|javax.enterprise.system.core.classloading|_ThreadID=131;|LDR5005:
ApplicationLoader exception :
com.sun.enterprise.connectors.ConnectorRuntimeException: Failed to start
resource adapter : com.stc.connector.management.STCCreateMBeanException:
SeeBeyond:GUID={07010000-254402EC160100-0AC92572-01},Name=dpEAIG0197E02prjStgComPrjIMS|prjIMS|dpEAIG0197E02|svcIMSIIFU232_eaLocal_IMS_001,type=RA
at
com.sun.enterprise.connectors.ActiveInboundResourceAdapter.<init>(ActiveInboundResourceAdapter.java:116)
at
com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:71)
at
com.sun.enterprise.connectors.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:267)
at
com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:189)
at
com.sun.enterprise.server.AbstractLoader.loadRars(AbstractLoader.java:665)
at
com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:145)
at
com.sun.enterprise.server.HttpServiceApplicationLoader.load(HttpServiceApplicationLoader.java:97)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:229)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:164)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:500)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:872)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:856)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:424)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:139)
at
com.sun.enterprise.ee.admin.mbeans.ServerRuntimeMBean.forwardEvent(ServerRuntimeMBean.java:64)
at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:305)
at
com.sun.enterprise.admin.runtime.BaseRuntimeMBean.invoke(BaseRuntimeMBean.java:386)
at
com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1410)
at
javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1247)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1343)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:784)
at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.resource.spi.ResourceAdapterInternalException:
com.stc.connector.management.STCCreateMBeanException:
SeeBeyond:GUID={07010000-254402EC160100-0AC92572-01},Name=dpEAIG0197E02prjStgComPrjIMS|prjIMS|dpEAIG0197E02|svcIMSIIFU232_eaLocal_IMS_001,type=RA
at
com.stc.connector.framework.jca.system.STCResourceAdapter.start(STCResourceAdapter.java:329)
at
com.sun.enterprise.connectors.ActiveInboundResourceAdapter.<init>(ActiveInboundResourceAdapter.java:107)
... 38 more
|#]
[#|2007-12-18T10:57:48.774+0000|INFO|sun-appserver-ee8.2|javax.enterprise.system.container.ejb|_ThreadID=131;|Instantiated
container for: ejbName: queIMSIIFU232_svcIMSIIFU232; containerId:
78510475787632641|#]
[#|2007-12-18T10:57:48.783+0000|SEVERE|sun-appserver-ee8.2|javax.enterprise.system.container.ejb.mdb|_ThreadID=131;|MDB00017:
[queIMSIIFU232_svcIMSIIFU232]: Exception in creating message-driven bean
container: [com.sun.enterprise.connectors.ConnectorRuntimeException:
Resource adapter dpEAIG0197E02prjStgComPrjIMS#queIMSIIFU232_svcIMSIIFU232 is
not deployed]|#]
[#|2007-12-18T10:57:48.783+0000|SEVERE|sun-appserver-ee8.2|javax.enterprise.system.container.ejb.mdb|_ThreadID=131;|com.sun.enterprise.connectors.ConnectorRuntimeException
com.sun.enterprise.connectors.ConnectorRuntimeException: Resource adapter
dpEAIG0197E02prjStgComPrjIMS#queIMSIIFU232_svcIMSIIFU232 is not deployed
at
com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:134)
at
com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.java:187)
at
com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:221)
at
com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:488)
at
com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:148)
at
com.sun.enterprise.server.HttpServiceApplicationLoader.load(HttpServiceApplicationLoader.java:97)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:229)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:164)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:500)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:872)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:856)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:424)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:139)
at
com.sun.enterprise.ee.admin.mbeans.ServerRuntimeMBean.forwardEvent(ServerRuntimeMBean.java:64)
at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:305)
at
com.sun.enterprise.admin.runtime.BaseRuntimeMBean.invoke(BaseRuntimeMBean.java:386)
at
com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1410)
at
javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1247)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1343)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:784)
at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
|#]
[#|2007-12-18T10:57:48.785+0000|SEVERE|sun-appserver-ee8.2|javax.enterprise.system.container.ejb|_ThreadID=131;|EJB5090:
Exception in creating EJB container
[com.sun.enterprise.connectors.ConnectorRuntimeException: Resource adapter
dpEAIG0197E02prjStgComPrjIMS#queIMSIIFU232_svcIMSIIFU232 is not deployed]|#]
[#|2007-12-18T10:57:48.785+0000|SEVERE|sun-appserver-ee8.2|javax.enterprise.system.container.ejb|_ThreadID=131;|appId=dpEAIG0197E02prjStgComPrjIMS
moduleName=queIMSIIFU232_svcIMSIIFU232_jar
ejbName=queIMSIIFU232_svcIMSIIFU232|#]
[#|2007-12-18T10:57:48.786+0000|SEVERE|sun-appserver-ee8.2|javax.enterprise.system.core.classloading|_ThreadID=131;|LDR5004:
UnExpected error occured while creating ejb container
com.sun.enterprise.connectors.ConnectorRuntimeException: Resource adapter
dpEAIG0197E02prjStgComPrjIMS#queIMSIIFU232_svcIMSIIFU232 is not deployed
at
com.sun.enterprise.connectors.inflow.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:134)
at
com.sun.ejb.containers.MessageBeanContainer.<init>(MessageBeanContainer.java:187)
at
com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:221)
at
com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:488)
at
com.sun.enterprise.server.ApplicationLoader.load(ApplicationLoader.java:148)
at
com.sun.enterprise.server.HttpServiceApplicationLoader.load(HttpServiceApplicationLoader.java:97)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:229)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:164)
at
com.sun.enterprise.server.ApplicationManager.applicationDeployed(ApplicationManager.java:500)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.invokeApplicationDeployEventListener(AdminEventMulticaster.java:872)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.handleApplicationDeployEvent(AdminEventMulticaster.java:856)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:424)
at
com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:139)
at
com.sun.enterprise.ee.admin.mbeans.ServerRuntimeMBean.forwardEvent(ServerRuntimeMBean.java:64)
at sun.reflect.GeneratedMethodAccessor304.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:305)
at
com.sun.enterprise.admin.runtime.BaseRuntimeMBean.invoke(BaseRuntimeMBean.java:386)
at
com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1410)
at
javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81)
at
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1247)
at
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1343)
at
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:784)
at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
at java.lang.Thread.run(Thread.java:595)
|#]
[#|2007-12-18T10:57:48.812+0000|WARNING|sun-appserver-ee8.2|javax.enterprise.system.core|_ThreadID=131;|CORE5021:
Application NOT loaded: [dpEAIG0197E02prjStgComPrjIMS]|#]Looks like you are having issues connecting to IMS. Look at this error message in particular:
: Resource adapter start failed : {0}
javax.resource.spi.ResourceAdapterInternalException:
com.stc.connector.management.STCCreateMBeanException:
SeeBeyond:GUID={07010000-254402EC160100-0AC92572-01},Name=dpEAIG0197E02prjStgComPrjIMS|prjIMS|dpEAIG0197E02|svcIMSIIFU232_eaLocal_IMS_001,type=RA
The resource adapter is your connector to the external system (looks like IMS in this case). Verify that your IMS settings are correct in the Environment tab. -
Can somebody please help me with this? Security code issue; very small code
Hi All, Iam a Unix admin and trying to learn Java/weblogic. I have a JSP and iam trying to run on my weblogic 81 Service Pack version 3.
My following code failed to work and giving me some security exceptions. Then in my weblogic console i saw
Domain Wide Security Settings > Anonymous Admin Lookup Enabled
The above checkbox is disabled. When i enabled, it worked. I talked to my company "Security" folks and they do not allow this checkbox to be enabled. they are saying fix your code problem......
if somebody can please let me know what a probable fix would, that be great and very helpful.
try{
Environment env = new Environment();
javax.naming.InitialContext ic = new InitialContext();
MBeanHome home = (MBeanHome) ic.lookup(MBeanHome.LOCAL_JNDI_NAME);
DomainMBean dom = home.getActiveDomain();
Set s = home.getMBeansByType("ServerRuntime");
ServerRuntimeMBean srmb = (ServerRuntimeMBean) s.iterator().next();
WebLogicObjectName on = new WebLogicObjectName(home.getDomainName()+":Location="+srmb.getName()+",Name="+srmb.getName()+",Type=ServerConfig");
//WebLogicObjectName on = new WebLogicObjectName(Name="+srmb.getName()+",Type="ServerConfig",Domain="+home.getDomainName()+",Location="+srmb.getName()+");
ServerMBean server = (ServerMBean) home.getMBean(on);
ClusterMBean cluster = null;
if( server != null)
cluster = server.getCluster();did i asked such a dumb question? ... :)Well, yes, sort of. The problem description "My following code failed to work and giving me some security exceptions" doesn't have nearly enough details. Such as, what exceptions, what is it supposed to do, what did it do instead, that sort of thing.
-
How to access "Active Sessions" using MBeans
Hi all,
I have deployed an application at EM (Enterprise Manager).
when I logged into EM and click the application I can see the number of active sessions under "Servlets and JSPs" topic.
how can I access that parameter at application level..??
(I want to access that parameter *"x"* at my web application and display Logged in users : x )
EM shows that the number of active sessions. it updates too.. so there must be some bean or record for that parameter..
how can I access that....??
Regards,
Dinuka.You can use something like the following:
package middleware.magic;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.naming.Context;
import java.io.IOException;
import java.util.Hashtable;
public class Browse {
private String hostname = "172.31.0.106";
private Integer port = 7001;
private String username = "weblogic";
private String password = "transfer11g";
private String protocol = "t3";
private String jndiRoot = "/jndi/";
private String mBeanServer = "weblogic.management.mbeanservers.domainruntime";
private String serviceName = "com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean";
private JMXConnector connector;
public static void main(String[] args) {
Browse test = new Browse();
try {
MBeanServerConnection connection = test.getMBeanServerConnection();
test.getSomeInformation(connection);
test.closeJmxConnector();
} catch (Exception e) {
e.printStackTrace();
public void getSomeInformation(MBeanServerConnection connection) throws Exception {
ObjectName service = new ObjectName(serviceName);
ObjectName[] serverRunTimes = (ObjectName[]) connection.getAttribute(service, "ServerRuntimes");
for (int i = 0; i < serverRunTimes.length; i++) {
String name = (String) connection.getAttribute(serverRunTimes, "Name");
String version = (String) connection.getAttribute(serverRunTimes[i], "WeblogicVersion");
String state = (String) connection.getAttribute(serverRunTimes[i], "State");
System.out.println("Server name: " + name + ", Version: " + version + ", Server state: " + state);
for (int i = 0; i < serverRunTimes.length; i++) {
ObjectName[] applicationRuntimes = (ObjectName[]) connection.getAttribute(serverRunTimes[i], "ApplicationRuntimes");
for (int j = 0; j < applicationRuntimes.length; j++) {
String name = (String) connection.getAttribute(applicationRuntimes[j], "Name");
ObjectName[] componentRuntimes = (ObjectName[]) connection.getAttribute(applicationRuntimes[j], "ComponentRuntimes");
System.out.println("Application name: " + name);
for (int k = 0; k < componentRuntimes.length; k++) {
if (connection.getAttribute(componentRuntimes[k], "Type").equals("WebAppComponentRuntime")) {
String componentName = (String) connection.getAttribute(componentRuntimes[k], "Name");
Integer sessionsCurrent = (Integer) connection.getAttribute(componentRuntimes[k], "OpenSessionsCurrentCount");
Integer sessionsHigh = (Integer) connection.getAttribute(componentRuntimes[k], "OpenSessionsHighCount");
System.out.println(" - Component Name: " + componentName + ", Sessions Current: " + sessionsCurrent + ", Sessions High: " + sessionsHigh);
public MBeanServerConnection getMBeanServerConnection() throws IOException {
return getJmxConnector().getMBeanServerConnection();
public JMXConnector getJmxConnector() throws IOException {
JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port, jndiRoot + mBeanServer);
Hashtable hashtable = new Hashtable();
hashtable.put(Context.SECURITY_PRINCIPAL, username);
hashtable.put(Context.SECURITY_CREDENTIALS, password);
hashtable.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES, "weblogic.management.remote");
connector = JMXConnectorFactory.connect(serviceURL, hashtable);
return connector;
public void closeJmxConnector() throws IOException {
connector.close();
Information regarding runtimeMBean can be found here: http://download.oracle.com/docs/cd/E12839_01/apirefs.1111/e13951/core/index.html.
Open the tree Runtime MBeans, ServerRuntimeMBean and click attributes to see the available attributes (such as Name, WeblogicVersion, State etcetera).
An example output of the program above:Server name: AdminServer, Version: WebLogic Server 10.3.2.0 Tue Oct 20 12:16:15 PDT 2009 1267925 , Server state: RUNNING
Server name: soa_server1, Version: WebLogic Server 10.3.2.0 Tue Oct 20 12:16:15 PDT 2009 1267925 , Server state: RUNNING
Application name: FMW Welcome Page Application_11.1.0.0.0
- Component Name: AdminServer__11.1.0.0.0, Sessions Current: 0, Sessions High: 0
Application name: Module-FMWDFW
Application name: bea_wls_internal
- Component Name: AdminServer_/bea_wls_internal, Sessions Current: 0, Sessions High: 0
Application name: mds-soa
Application name: bea_wls_deployment_internal
- Component Name: AdminServer_/bea_wls_deployment_internal, Sessions Current: 0, Sessions High: 0
Application name: wsil-wls
- Component Name: AdminServer_/inspection.wsil, Sessions Current: 0, Sessions High: 0
Application name: bea_wls_diagnostics
- Component Name: AdminServer_/bea_wls_diagnostics, Sessions Current: 0, Sessions High: 0
Application name: mejb
Application name: bea_wls9_async_response
- Component Name: AdminServer_/_async, Sessions Current: 0, Sessions High: 0
Application name: uddiexplorer
- Component Name: AdminServer_/uddiexplorer, Sessions Current: 0, Sessions High: 0
Application name: mds-owsm
Application name: bea_wls_management_internal2
- Component Name: AdminServer_/bea_wls_management_internal2, Sessions Current: 0, Sessions High: 0
Application name: consoleapp
- Component Name: AdminServer_/console, Sessions Current: 0, Sessions High: 2
- Component Name: AdminServer_/consolehelp, Sessions Current: 0, Sessions High: 1
Application name: DMS Application_11.1.1.1.0
- Component Name: AdminServer_/dms_11.1.1.1.0, Sessions Current: 0, Sessions High: 0
Application name: em
- Component Name: AdminServer_/em, Sessions Current: 0, Sessions High: 0
Application name: uddi
- Component Name: AdminServer_/uddi, Sessions Current: 0, Sessions High: 0
Application name: MQSeriesAdapter
Application name: OraSDPMDataSource
Application name: JmsAdapter
Application name: uddi
- Component Name: soa_server1_/uddi, Sessions Current: 0, Sessions High: 0
Application name: wsil-wls
- Component Name: soa_server1_/inspection.wsil, Sessions Current: 0, Sessions High: 0
Application name: SOAJMSModule
Application name: DbAdapter
Application name: bea_wls9_async_response
- Component Name: soa_server1_/_async, Sessions Current: 0, Sessions High: 0
Application name: composer
- Component Name: soa_server1_/soa/composer, Sessions Current: 0, Sessions High: 0
Application name: DMS Application_11.1.1.1.0
- Component Name: soa_server1_/dms_11.1.1.1.0, Sessions Current: 0, Sessions High: 0
Application name: Module-FMWDFW
Application name: usermessagingdriver-email
- Component Name: soa_server1_/sdpmessagingdriver/email-mbeanlifecycle, Sessions Current: 0, Sessions High: 0
Application name: UMSJMSSystemResource
Application name: AqAdapter
Application name: FtpAdapter
Application name: OracleBamAdapter
Application name: SOADataSource
Application name: usermessagingserver
- Component Name: soa_server1_/sdpmessaging/mbeanlifecycle, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/sdpmessaging/parlayx, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/sdpmessaging/userprefs-ui, Sessions Current: 0, Sessions High: 0
Application name: bea_wls_internal
- Component Name: soa_server1_/bea_wls_internal, Sessions Current: 0, Sessions High: 0
Application name: SocketAdapter
Application name: SOALocalTxDataSource
Application name: FileAdapter
Application name: DefaultToDoTaskFlow
- Component Name: soa_server1_/DefaultToDoTaskFlow, Sessions Current: 0, Sessions High: 0
Application name: soa-infra
- Component Name: soa_server1_/soa-infra, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/TaskService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/TaskMetadataService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/TaskQueryService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/TaskReportService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/IdentityService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/UserMetadataService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/RuntimeConfigService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/TaskEvidenceService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/CompositeMetadataService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/b2b, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/b2b, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/AGMetadataService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/AGQueryService, Sessions Current: 0, Sessions High: 0
- Component Name: soa_server1_/integration/services/AGAdminService, Sessions Current: 0, Sessions High: 0
Application name: wsm-pm
- Component Name: soa_server1_/wsm-pm, Sessions Current: 0, Sessions High: 0
Application name: mds-owsm
Application name: b2bui
- Component Name: soa_server1_/b2bconsole, Sessions Current: 0, Sessions High: 0
Application name: bea_wls_diagnostics
- Component Name: soa_server1_/bea_wls_diagnostics, Sessions Current: 0, Sessions High: 0
Application name: bea_wls_cluster_internal
- Component Name: soa_server1_/bea_wls_cluster_internal, Sessions Current: 0, Sessions High: 0
Application name: EDNLocalTxDataSource
Application name: EDNDataSource
Application name: uddiexplorer
- Component Name: soa_server1_/uddiexplorer, Sessions Current: 0, Sessions High: 0
Application name: bea_wls_deployment_internal
- Component Name: soa_server1_/bea_wls_deployment_internal, Sessions Current: 0, Sessions High: 0
Application name: worklistapp
- Component Name: soa_server1_/integration/worklistapp, Sessions Current: 0, Sessions High: 0
Application name: mds-soa
Application name: OracleAppsAdapter
Maybe you are looking for
-
Creative Cloud Update Error 205
Good morning. I have had Creative Cloud Desktop app running smoothly until recently when I started to get the Error 205 while updating through the app. It always stopped at 12%. Additionally, I have uninstalled the app and gotten the same error as I
-
How to replace a character in a string with blank space.
Hi, How to replace a character in a string with blank space. Note: I have to change string CL_DS_1===========CM01 to CL_DS_1 CM01. i.e) I have to replace '=' with ' '. I have already tried with <b>REPLACE ALL OCCURRENCES OF '=' IN temp
-
I have a E4200 as well as a WRT54G. I'm looking to create two different access points to the same network, one access point being 802.11g (WRT54G) and the other being 802.11n (E4200) I want to do this because I need the extra speed from 802.11n for s
-
Maximum no. of plots allowed in Graph
I want some basic queries regarding the base Labview 2011 version. 1) How many plots (with same x-axis: time) but different y-axis are allowed in a single chart. 2) How many shared variables can be configured in a single Labview project. 3) In Labvie
-
Can I please have my old iCal back?
I had my computer updated to Lion maybe two weeks ago. Being months away from finally completing my undergrad, I can honestly say I have no problem with change. But I've been trying to make myself adapt to this new system, and I keep coming back to