MBean registered in MBeanServer automatically?
Hi,
After I create an Coherence object using new ObejctName(), will this object be automatically registered to the MBeanServer?
Thanks,
Mike
Hi Mike,
I think I finally understand what you're trying to do. Correct me if my assumptions are wrong:
(1) The process that you are launching with the first script is a Coherence Command Line Utility. You would like to expose all MBeans registered by this node remotely, including your custom MBean.
(2) The Tomcat process that you are launching with the second script is serving as an admin server. Its purpose is to use JMX to render MBeans exposed by the first process.
If my assumptions are correct, you'll need to do the following:
(1) Remove the code that registers your custom MBean from your admin web application.
(2) Create a CacheFactory "wrapper" class that registers your custom MBean and then calls CacheFactory.main(). For example:
package com.tangosol.examples;
import com.tangosol.net.CacheFactory;
import com.tangosol.net.Cluster;
import com.tangosol.net.management.Registry;
public class MyCacheFactory extends CacheFactory
public static void main(String[] asArg)
throws Exception
Cluster cluster = CacheFactory.ensureCluster();
Registry registry = cluster.getManagement();
registry.register(registry.ensureGlobalName("type=JvmLabel"), new JvmLabel());
CacheFactory.main(asArg);
}(3) Substitute your CacheFactory "wrapper" class for com.tangosol.net.CacheFactory in your first script.
Regards,
Jason Howes
Similar Messages
-
Does jconsole support monitoring of MBeans registered to New MBean Server?
I see that jconsole is displaying the MBeans registered to Platform MBean Server (obtained through java.lang.ManagementFactory.getPlatformMBeanServer()) but not the MBeans that are registered to a newly created MBean Server (created using javax.management.MBeanServerFactory.createMBeanServer()).
Is there a way through which I can view the MBeans registered to newly created MBean Server in the jconsole?Thank you for the information emcmanus.
So what I understand is that the jconsole if opened in a normal way (i.e. Local), it loads MBeans by looking up the Platform MBean Server.
All the MBeans belonging to other MBean Servers or custom created MBean Servers can be managed & monitored if jconsole is loaded using Advanced option (i.e. providing JMX URL) and with the help of remote connectors.
When I open Platform MBean Server, I dont see MBeans of other MBean Server and vice versa. (I think they are mutually exclusive).
Please correct me if what I have mentioned above is incorrect.
One confusing thing is that I see "JVImplementation" MBean is available when I open jconsole with either of the two option mentioned above.
Is there any specific reason for that?
Is that MBean part of Platform MBean Server or some other MBean Server? -
i want to add additonal MBean to the agent.
i know html Admin View is an HTML page presented by HTML adapter can
do this.
but my question is that how to write code to create,unregister and
constructors without using HTML adapter.Greetings,
You can use standard JMX conventions to create, register, unregister MBeans.
See:
http://java.sun.com/j2ee/1.4/docs/api/index.html
For more information on using JMX with WLS:
http://e-docs.bea.com/wls/docs70/jmx/overview.html (7.x)
http://e-docs.bea.com/wls/docs81/jmx/overview.html (8.1)
Regards
Chris Chiodo
BEA Systems
"hsienda" <[email protected]> wrote in message
news:[email protected]..
i want to add additonal MBean to the agent.
i know html Admin View is an HTML page presented by HTML adapter can
do this.
but my question is that how to write code to create,unregister and
constructors without using HTML adapter. -
Why does PS CS4 register .psd-files automatically?
Hello,
ever since I a have PS CS4, it's driving me nuts that it registers .pdf-files for opening automatically.
I want .psd-files to be opened (viewed) with ACDSee when doubleclicked, NOT Photoshop.
I browsed through all the preferences, but did not find anything for that matter.
Can anybody help me, so that Photoshop does NOT "capture" psd-files anymore ??
Thanks!
RedFirst off, big thanks guys!
@John: Sorry for the mixup, the "pdf" was a mistake ... only psd involved.
@Zeno: My OS is Vista and ACDSee is already set as the default.
But it seems, that PS CS4 associates PSD-files "on its own" whenever I start it. Even though I set it back manually, the next time I start Photoshop the association will change back to PS.
I hope I explained it better this time ... English is not my first language :-)
Thanks
Red -
Registered cs6 software automatically identified as not genuine so I cannot update
I contacted the chat line and he said that I had to go to the forum. He did check and the license key is genuine. But he said he could not offer any assistance.
How do I go about getting this fixed since I am only supposed to be able to get cs6 answers on the forum? The update is for ACRThat the "support" chat staffer sent you here is outrageous, but par for the course for the outsourced Adobe support staff in India. These are user to user forums.
At least try this dedicated forum:
Downloading, Installing, Setting Up -
Registering MBean in Dispatcher node
Hi All,
I am trying to figure out a way to register a
customized StandardMBean in all cluster nodes.
Unfortunately I don't manage to register my mbean in
dispatcher MBeanServer as it doesn't have the MBean classloader.
Currently I am registering the MBeans from a servlet so
the server classloader is aware of the MBean (it is
deployed together with the servlet in the EAR file), but
the dispatcher node isn't.
I am using javax.management.MBeanServerConnection to
obtain connection to the remote MBean server.
Then I am using the createMBean(..) method to istantiate
and register the MBean in the remote MBeanServer.
Could someone give me a hint how to add my MBean to the
dispatcher classloader. Any alternatives will be also
appreciated.
This is the exception I get when trying to register the
MBean in the dispatcher MBeanServer:
com.sap.engine.services.jmx.exception.JmxConnectorException:
Unable to de-serialize request parameters, message [ JMX request
(java) v1.0 len: 323 | src: cluster target-node: 505798100 req:
createMBean(S,ON,ON) params-number: 3 params-bytes: 0 | com.abc.jmx.MyMBean :name=MyName,j2eeType=ABC_MyType,SAP_J2EEClusterNode=505798100,SAP_J2EECluster=""
:name="abc.com/MyLoader",j2eeType=SAP_J2EEClassLoader,SAP_J2EEClusterNode="",SAP_J2EECluster="" ] at
com.sap.engine.services.jmx.RequestMessage.readParams(RequestMessage.java:526) at
com.sap.engine.services.jmx.RequestMessage.getParams(RequestMessage.java:575) at
com.sap.engine.services.jmx.MBeanServerInvoker.invokeMbs(MBeanServerInvoker.java:106) at
com.sap.engine.services.jmx.JmxServiceConnectorServer.receiveWait(JmxServiceConnectorServer.java:173) at com.sap.engine.core.service630.context.cluster.message.MessageListenerWrapper.process(MessageListenerWrapper.java:81) at
com.sap.engine.core.cluster.impl6.ms.MSListenerThread.run(MSListenerThread.java:47) at
com.sap.engine.frame.core.thread.Task.run(Task.java:60)
at com.sap.engine.core.thread.impl6.SingleThread.execute(SingleThread.java:72) at
com.sap.engine.core.thread.impl6.SingleThread.run(SingleThread.java:142) <b>Caused by:
javax.management.InstanceNotFoundException: ClassLoader with name :name="abc.com/MyLoader",j2eeType=SAP_J2EEClassLoader,SAP_J2EEClusterNode="",SAP_J2EECluster="" not found in repository at com.sap.engine.services.jmx.CompletionInterceptor.getClassLoader(CompletionInterceptor.java:556)</b> at com.sap.engine.services.jmx.RedirectInterceptor.getClassLoader(RedirectInterceptor.java:493) at
com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.getClassLoader(MBeanServerInterceptorChain.java:435) at com.sap.engine.services.jmx.RequestMessage.readParams
(RequestMessage.java:515) ... 8 more -
predecessor system -
com.sap.engine.services.jmx.exception.JmxConnectorException: Unable to de-serialize request parameters, message
[ JMX request (java) v1.0 len: 323 | src: cluster target-node: 505798100 req: createMBean(S,ON,ON)
params-number: 3 params-bytes: 0 | com.abc.jmx.MyMBean :name=MyName,j2eeType=ABC_MyType,SAP_J2EEClusterNode=505798100,SAP_J2EECluster=""
:name="abc.com/MyLoader",j2eeType=SAP_J2EEClassLoader,SAP_J2EEClusterNode="",SAP_J2EECluster="" ] at com.sap.engine.services.jmx.MBeanServerConnectionImpl.invokeMbsInternal(MBeanServerConnectionImpl.java:677) at com.sap.engine.services.jmx.MBeanServerConnectionImpl.createMBean(MBeanServerConnectionImpl.java:105) at
com.sap.engine.services.jmx.MBeanServerConnectionSecurityWrapper.createMBean(MBeanServerConnectionSecurityWrapper.java:95) at ...
Dan
Message was edited by: Dan SobolI dont think SAP has intended customers to register custom mbeans in the dispatcher node. This is probably the reason that there is no documentation in regard. Anyway with some common sense and creativeness I found the way.
<b>1)</b>
First think you want to deploy your mbean so a class loader of your mbean class is available in all the cluster nodes including dispatcher nodes. In order to accomplish this youll have to:
<b>a.</b> Implement your mbean and archive it in a jar file.
<b>b.</b> Create a Library J2EE Server component. File ---> new --> other --> J2EE Server Component --> Library
<b>c.</b> Use the privder.xml wizard to add your jar created in (a) to the library project.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE provider-descriptor SYSTEM "library.provider.dtd">
<provider-descriptor>
<display-name>XxxLib</display-name>
<component-name>XxxLib</component-name>
<major-version>6</major-version>
<minor-version>40</minor-version>
<micro-version>0</micro-version>
<provider-name>xxx.com</provider-name>
<references>
<reference provider-name="sap.com" strength="weak" type="library">tc/jmx</reference>
<reference provider-name="sap.com" strength="weak" type="library">com.sap.tc.Logging</reference>
<reference provider-name="sap.com" strength="weak" type="library">core_lib</reference>
</references>
<jars>
<jar-name>mbeanjar.jar</jar-name>
</jars>
</provider-descriptor>
<b>d.</b> Now the tricky part:
The current library project structure as created by the Netweaver IDE is
ProjectName
META-INF
sda-dd.xml
server
provider.xml
In order to deploy the mbean to the dispatcher node you need to create another folder named dispatcher and copy the provider.xml to it.
ProjectName
META-INF
sda-dd.xml
server
provider.xml
dispatcher
provider.xml
<b>e.</b> Create a deployable .sda archive from the library project.
<b>f.</b> Deploy the sda archive.
<b>g.</b> Check if the mbean class loader has been added to all cluster nodes. Go to visual admin Services --> Class Loader Viewer --> Libraries and check if the mbean class loader exists e.g. library:com.xxx~libname.
<b>2)</b>
Once a class loader of your mbean implementation exists in all nodes it is straightforward how to actually register the mbean.
<b> </b>
MBeanServer mbs = (MBeanServer) initCtx.lookup("jmx");
mbs.createMBean(<i>mbeanClassName</i>, <i>objectName</i>, <i>classLoaderObjectName</i>);
<b>Where:</b>
mbeanClassName is the mbean class full qualified name e.g. com.xxx.mbean.ClassName
objectName is the mbean object name. You may create it by using ObjectNameFactory.getNameForServerChildPerNode(<i>j2eeType</i>, <i>name</i>, <i>nodeId</i>, null);
classLoaderObjectName is the mbean's class loader object name: You may create it using ObjectNameFactory.getNameForClassLoader(<i>libraryName</i>, null, null);
Hopefully I didnt miss anything substantial.
Have fun -
MBeans and MBeanServer in different JVM
Hi,
Is it possible that MBeans reside in different JVM and MBeanServer reside on different JVM? If so, then how to get instance of MBean into MBeanServer, as it is needed to register that MBean into server.
or how its to be done.
Thanks in advance.Please Help.Hi Jahnvi,
As I have already answered in this thread a few weeks ago:
http://forum.java.sun.com/thread.jspa?threadID=790563&messageID=4508174#4508174
what you describe is a use case for MBeanServer federation - aka Cascading.
You can set up a master agent/sub agent hierarchy where:
Each "subagent" JVMs has local MBeans registered in its MBeanServer, and starts
a JMXConnectorServer.
The "master" JVM (the JVM that the end client sees) uses JMXConnectors to talk to
access the MBeans registered in the subagents, and creates proxies for these MBeans
in its local MBeanServer.
The console then simply needs to connect to the "master" JVM, where it can see
all proxied MBeans.
The Java DMK has an API that allows you to set-up and control such a hiearchy.
A standard feature for federating MBeanServer is also in discussion for JDK 7.
See more info on my previous post here:
http://forum.java.sun.com/thread.jspa?threadID=790563&messageID=4508174#4508174
Hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/jmxetc -
Question on Registering MBean on specific Domain
We have a Run-time which is at present modeled as a Domain level MBean. In the MBean descriptor , we have the following snippet for registering
<jmx-runtime-mbean
objectname="EMDomain:name=oracle.sysman.emfa.FADiscovery,type=EMDiscoveryIntegration"
class="oracle.apps.fnd.applcore.topologyMBean.runtime.mbean.FADiscovery"
management-interface="oracle.apps.fnd.applcore.topologyMBean.runtime.mbean.FADiscoveryMXBean">
<description>Fusion Applications Discovery MBean</description>
</jmx-runtime-mbean>
As a result , all the domains are having the above MBean registered. Requirement is that register this MBean only on a specific domain. Is it possible to achieve this by any means?
Thanks
JosephR167 wrote:
Go to apple though, tell them what happened, have them discontinue your other iPod, and get a replacement (if covered by warranty) restoring from last backup of other device.
That is entirely incorrect. Apple will NOT discontinue an iPod and theft is NOT covered by the warranty.
Remember, in order to do most things, you need to have the ipod unlocked before connecting to a computer.
Yes, but most common thieves know how to place it in Recovery Mode, thus bypassing the passcode. -
Viewing an MBean on the administration console
I have registered an MBean on a WebLogic 6.0 server. Now I need to know how
to view this MBean and run the methods
of the class represented by this MBean possibly from the Administration
Console. I want some way to run the methods as
I could on the HtmlAdaptorServer for the SUN JMX Reference Implementation.
Thank you.
T. PeiWhen do you think we will have it? We really want this done (for run-time
configuration, changing variables, etc.).
news:3a7f3758$[email protected]..
Admin console in WLS 6.0 does not support automatic extensibility for user
MBeans registered to WLS server. You can only access them programmatically
by getting the MBean from the MBeanServer in the WLS server.
This functionality is being considered for future releases.
news:[email protected]..
I have registered an MBean on a WebLogic 6.0 server. Now I need to knowhow
to view this MBean and run the methods
of the class represented by this MBean possibly from the Administration
Console. I want some way to run the methods as
I could on the HtmlAdaptorServer for the SUN JMX ReferenceImplementation. -
MBeanServer location in JNDI tree
Hello,
I'm testing methods that use a MBeanServer from JConsole and MBean browser in EM console. I launch the JConsole using this parameters:
jconsole -J-Djava.class.path=/home/user/wlfullclient-10.3.5.0.jar:/usr/java/jdk1.6.0_30/lib/jconsole.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote
When I use the JConsole for testing I obtain the MBeanServer in this way:
InitialContext ctx = new InitialContext();
server = (MBeanServer)ctx.lookup("java:comp/jmx/runtime");
And when I use the MBean browser I have to to use this code:
server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
I'm following the next Oracle documentation, but I want to know if there is other way to use only once String to found the MBeanServer in the JNDI tree.
Does anybody know a different way to do this?
Thanks in advance,
Make Local Connections to the Runtime MBean Server+
Local clients can access a WebLogic Server instance’s Runtime MBean Server through the JNDI tree instead of constructing a JMXServiceURL object. Only the Runtime MBean Server registers itself in the JNDI tree.+
When accessed from JNDI, the Runtime MBean Server returns its javax.management.MBeanServer interface. This interface contains all of the methods in the MBeanServerConnection interface plus additional methods such as registerMBean(), which local process can use to register custom MBeans. (See MBeanServer in the J2SE 5.0 API Specification.)+
If the classes for the JMX client are located at the top level of an enterprise application (that is, if they are deployed from the application’s APP-INF directory), then the JNDI name for the Runtime MBean Server is:+
java:comp/jmx/runtime
If the classes for the JMX client are located in a Java EE module, such as an EJB or Web application, then the JNDI name for the Runtime MBeanServer is:+
java:comp/env/jmx/runtime
For example:
InitialContext ctx = new InitialContext();
server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");Hi,
I have same problem.
I have developed some libs (with common functionality to be used in many places, utils, and so) which I deploy in $DOMAIN/lib. I also have an ear, with ApplicationLifecycleListener to register some MBeans in the MBeanServer and they make use of this shared libs.
The thing is that if I access on of my MBeans from JConsole and if I access the same MBean from within em console, my app needs to look at different locations in the JNDI tree for the MBeanServer. Shouldn't this code, as it is running in the same location need to locate the MBeanServer the same way? Or because the client application in one case is remote, and in the other is local, need to look for the MBeanServer in one location and if not found in the other.
Think that code is deployed as a Util class in the DOMAIN/lib directory.
Thanks, -
Writing MBeans on Weblogic Server 8.1 sp5
Hi,
I am trying to write a standard mbean for managing my application. As of now its a simple MBean which just needs to print hello world on the server when a MBean Client invokes it. Let me discuss the apporach i have taken. Classes that have been devloped are.
Interface HelloMBean.java which doesnt extend any interface (as this is not a dynamic mbean). This contains a method hello()
Class Hello.java implementing the HelloMBean. This contains the method hello() which does the printing on the server when invoked.
HelloStartup which registers the mbean with the MBeanServer after doing a JNDI lookup for "weblogic.management.server"
MBeanClient.java which does a look up for the mbean the code of which is :-
url = "t3://localhost:7001" ;
username = "weblogic";
password = "weblogic";
MBeanHome home = null;
Environment env = new Environment();
env.setProviderUrl(url);
env.setSecurityPrincipal(username);
env.setSecurityCredentials(password);
Context ctx = env.getInitialContext();
//Retrieving the Administration MBeanHome interface
Object obj = ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
home = (MBeanHome) PortableRemoteObject.narrow(obj, MBeanHome.class);
WebLogicObjectName mbeanName = new WebLogicObjectName("MBeanDomain:Name=Hello,Type=ServerConfig");
WebLogicMBean mbean = (WebLogicMBean)home.getMBean(mbeanName);
Now At the server startup i see that the mbean has got successfully registered by using the isRegistered() method. But when i try to retreive the object from client i am getting a exception javax.management.InstanceNotFoundException.
I would appreciate if anyone could help me out in this issue. Also if anyone has written any sample code to register and invoke the mbeans written using other interfaces like DynamicMBean, WeblogicMBean etc and could share them or perhaps give pointers in how to go about writing and invoking them in weblogic would be really helpfull.
I read somewhere that till 7.0 weblogic didnt support writing of custom MBeans can anyone confirm that we can write custom MBeans on 8.1 ??
My purpose of writing this MBean is to invoke it from across the JVM. I know its possible using rmi but do think MBean would be the rite choice for it.
Thanks in advanceChange this code
<i>WebLogicObjectName mbeanName = new WebLogicObjectName("MBeanDomain:Name=Hello,Type=ServerConfig");
WebLogicMBean mbean = (WebLogicMBean)home.getMBean(mbeanName);</i>
to
MBeanServer mbs = home.getMBeanServer()
ObjectName oname = new ObjectName("MBeanDomain:Name=Hello,Type=ServerConfig");
// to invoke your mbean's hello method
mbs.invoke(oname, "hello", null, null);
You should remember that for CustomMBean's you cannot use MBeanHome.
HTH,
-satya
BEA Blog:
http://dev2dev.bea.com/blog/sghattu/
Get Involved in CodeShare:
https://wls-console-extensions.projects.dev2dev.bea.com/
https://wlnav.projects.dev2dev.bea.com/
https://eclipse-wlst.projects.dev2dev.bea.com/
https://wlst.projects.dev2dev.bea.com/ -
Connection problem to 10.1.2 OC4J mbeanserver
Hi All -
I am trying to connect to OC4J mbean server in OAS 10.1.2. I found the reqd code in the oracle docs.
//Import the JSR-160 classes and interfaces from jmx_remote_api.jar
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;
import javax.naming.Context;
import javax.management.MBeanServerConnection;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
public class OC4j
public static void main( String[] args )
OC4j oc4j = new OC4j();
oc4j.oc4jstat();
private void oc4jstat(){
String url="service:jmx:rmi:///opmn://localhost:6003/home/";
JMXConnector jmxCon = null ;
try {
// Define the connection target
JMXServiceURL serviceUrl = null;
try
serviceUrl = new JMXServiceURL(url);
catch ( MalformedURLException e )
// TODO Auto-generated catch block
e.printStackTrace();
// Use to pass environment properties to be used while
// retrieving a connection
Hashtable env= new Hashtable();
// Define the provider root package
env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"oracle.oc4j.admin.jmx.remote");
Hashtable credentials= new Hashtable();
// Connect using the oc4jadmin super-user administrator account
credentials.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
credentials.put(Context.PROVIDER_URL,url);
credentials.put(Context.SECURITY_PRINCIPAL,"oc4jadmin");
credentials.put(Context.SECURITY_CREDENTIALS,"password");
//credentials.put("login","ias_admin");
//credentials.put("password","ias_admin1");
// Specify the login/password to use for the connection
env.put(JMXConnector.CREDENTIALS, credentials);
// env.put(JMXConnectorConstant.PROPRIETARY_MBEANSERVER_DOMAIN_NAME, "default");
// Get an instance of the JMXConnector interface for OC4J's rmi protocol
// User is not yet connected
try
jmxCon = JMXConnectorFactory.newJMXConnector(serviceUrl, env);
catch ( IOException e )
// TODO Auto-generated catch block
e.printStackTrace();
// Connect to the target OC4J instance defined in the JMXServiceURL
try
jmxCon.connect();
catch ( IOException e )
// TODO Auto-generated catch block
e.getLocalizedMessage();
// Retrieve the MBeanServerConnection instance that acts as a proxy
// for the OC4J MBeanServer we are connecting to.
MBeanServerConnection con = null;
System.out.println("jmxcon :"+jmxCon);
try
con = jmxCon.getMBeanServerConnection();
System.out.println("Connection Succeeded..");
catch ( IOException e )
System.out.println("Connection failed\n");
e.printStackTrace();
// Use the MBeanServerConnection instance to perform remote
// operations on the OC4J MBeanServer. This call retrieves
// all MBeans registered with the server.
Set mbeans = null;
try
mbeans = con.queryNames(null, null);
catch ( IOException e )
e.printStackTrace();
Iterator iter = mbeans.iterator();
// Display each MBean's ObjectNameIterator iter= mbeans.iterator();
while(iter.hasNext())
System.out.println(iter.next().toString());
// Important!!! Release the connection, ideally using a Finally block
finally {
if(jmxCon!=null)
try
jmxCon.close();
catch ( IOException e )
// TODO Auto-generated catch block
e.printStackTrace();
Since , i am using 10.1.2 i am not able to use the jar file adminclient.jar whic is required for oracle.oc4j.admin.jmx.remote.api.JMXConnectorConstant class.
Hence i used this way of connecting.
I also tried out this way :
//credentials.put("login","ias_admin");
//credentials.put("password","ias_admin1");
But i am not able to get any connection either way to the oc4j instance.
This is the error that i am getting:
java.io.IOException: Not connected
jmxcon :javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi:///opmn://localhost:6003/home/OC4J_BPEL
Connection failed
at javax.management.remote.rmi.RMIConnector.getMBeanServerConnection(RMIConnector.java:353)
at javax.management.remote.rmi.RMIConnector.getMBeanServerConnection(RMIConnector.java:337)
at OC4j.oc4jstat(OC4j.java:102)
at OC4j.main(OC4j.java:24)
Exception in thread "main" java.lang.NullPointerException
at OC4j.oc4jstat(OC4j.java:117)
at OC4j.main(OC4j.java:24)
Am i missing something here ?
Thanks
Ajayjgrocock,
even though Jdev 1013 is production, BPEL PM 10.1.3 is not yet production, and so is the BPEL Designer for JDev - this is the reason for little issues like this here .. I would recommend (as you are writing a label, looks like you work for ORacle) to go ahead and file a bug that we can ensure in the QA cycle it's fixed..
thx clemens -
Hi,all
i have some trouble to add mbean
i connect agent with rmi connector
Here is my code
this is my agent
public class MyAgent {
//MBean server
private MBeanServer mbeanServer ;
public MyAgent() {
//create mbean server
mbeanServer = MBeanServerFactory.createMBeanServer() ;
this is Host.java implements HostMBean
public class Host extends Polling implements
HostMBean,NotificationListener
public Host(String hostName,MBeanServer mbServer){
this is client, i use this to connect agent to add mbean
public AddHostMBean(String ip)
try
RmiConnectorClient client = RMIClientFactory.getClient();
InetAddress address = InetAddress.getByName(ip);
ObjectName hostObjName = new ObjectName("Host" +":address="
+ address.getHostName());
Object[] params = new Object[2] ;
String[] sign = new String[2] ;
params[0] = ip;
params[1] = ??;//here is my question
sign[0] = "java.lang.String" ;
sign[1] = ??;//here is my question
client.createMBean("Host",hostObjName,params,sign);
catch(Exception e)
e.printStackTrace();
If i write in Agent.java, i can write
public class MyAgent {
//MBean server
private MBeanServer mbeanServer ;
public MyAgent() {
//create mbean server
mbeanServer = MBeanServerFactory.createMBeanServer() ;
Host host = new Host(ip,mbeanServer) ;
mbeanServer.registerMBean(host,hostObjName) ;
That i can create and register HostMBean
but, i don't know how to instantiates the Host class and registers it
on the remote MBeanServer
Please help, thanks[email protected] (hsienda) wrote in message news:<[email protected]>...
Hi,all
i have some trouble to add mbean
i connect agent with rmi connector
Here is my code
this is my agent
public class MyAgent {
//MBean server
private MBeanServer mbeanServer ;
public MyAgent() {
//create mbean server
mbeanServer = MBeanServerFactory.createMBeanServer() ;
this is Host.java implements HostMBean
public class Host extends Polling implements
HostMBean,NotificationListener
public Host(String hostName,MBeanServer mbServer){
this is client, i use this to connect agent to add mbean
public AddHostMBean(String ip)
try
RemoteMBeanServer connector = new RmiConnectorClient() ; RmiConnectorAddress address = new RmiConnectorAddress() ;
address.setName("NCNU_AGENT") ;
connector.connect(address) ;
>
InetAddress address = InetAddress.getByName(ip);
ObjectName hostObjName = new ObjectName("Host" +":address="
+ address.getHostName());
Object[] params = new Object[2] ;
String[] sign = new String[2] ;
params[0] = ip;
params[1] = ??;//here is my question
sign[0] = "java.lang.String" ;
sign[1] = ??;//here is my question
connector.createMBean("Host",hostObjName,params,sign);
catch(Exception e)
e.printStackTrace();
If i write in Agent.java, i can write
public class MyAgent {
//MBean server
private MBeanServer mbeanServer ;
public MyAgent() {
//create mbean server
mbeanServer = MBeanServerFactory.createMBeanServer() ;
Host host = new Host(ip,mbeanServer) ;
mbeanServer.registerMBean(host,hostObjName) ;
That i can create and register HostMBean
but, i don't know how to instantiates the Host class and registers it
on the remote MBeanServer
Please help, thanks -
Trying to run an MBean on OCMS
Hello
I am trying to run a sample MBean on the OCMS server. The sample being run is "JMX Essentials" found at the following link...
http://java.sun.com/j2se/1.5.0/docs/guide/jmx/examples.html
However, I am not sure how should I deploy this MBean to the em. Can someone please guide me?
Thanks
AHello
I am not able to see the MBean in EM. Here are the steps I followed...
My application is called "basicresponse", which is deployed using eclipse SCE onto OCMS.
Within, I have the following files in the com.example.mbeans package...
1. HelloMBean.java //interface
2. Hello.java //implementation
3. Main.java //registering program
My orion-application.xml file, found in the application_deployments folder within OCMS, is as follows...
<?xml version="1.0"?>
<orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd"
deployment-version="10.1.3.1.1" default-data-source="jdbc/OracleDS" component-
classification="external"
schema-major-version="10" schema-minor-version="0" >
<web-module id="basicresponse" path="basicresponse.war" />
<persistence path="persistence" />
<principals path="principals.xml" />
<jazn provider="XML" />
<log>
<file path="application.log" />
</log>
<jmx-mbean objectname=":type=Application,name=Hello"
class="com.example.mbeans:Hello">
<description>My First MBean</description>
</jmx-mbean>
</orion-application>
NOTE: I have NOT created any jar file for the above classes, do I need to create one? Eclipse has the basicresponse.ear and .war files already made.
If yes, where and how do I package it?
Also, my MBean registration program, ie. Main.java , is as follows...
/* Main.java - main class for Hello World example. Create the
HelloWorld MBean, register it, then wait forever (or until the
program is interrupted). */
package com.example.mbeans;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
public class Main {
/* For simplicity, we declare "throws Exception". Real programs
will usually want finer-grained exception handling. */
public static void main(String[] args) throws Exception {
try
// Get a reference to the MBeanServer
MBeanServer m = MBeanServerFactory.newMBeanServer();
// Create the MBean instance
Hello bean = new Hello();
//Construct the MBean name using the default application's domain name
ObjectName beanName= new ObjectName(m.getDefaultDomain()+
":type=Hello,name=Hello");
// Register the MBean with the MBeanServer
m.registerMBean(bean, beanName);
} catch(Exception e)
// Handle exceptions; for simplicity, dump the stack trace to show any
// errors that occur
e.printStackTrace();
// Wait forever
System.out.println("Waiting forever...");
Thread.sleep(Long.MAX_VALUE);
Please guide me.
Thanks,
AJ -
Coherence Mbeans doesnt support weblogic standard
Hi,
According to weblogic standard, the mbeans should be called:
domain:Name=name,Type=type[,Location=serverName][,TypeOfParentMBean=NameOfParentMBean][,TypeOfParentMBean1=NameOfParentMBean1]...
The Mbeans I looked at use the type attribute instead of Type.
The code I use queries the server using "Type" and therefore I dont get as a result any of the coherence mbeans, just the weblogic ones.
What can I do about it? (the code is already deployed on mulitple customer sites)
Also, when I use the connection to query all mbeans for example:
mbeanServerConnection.queryNames(null, null);
I dont get back the coherence mbeans. is that because of the same problem?Hi,
Have you tried using an MBean Notification Listener? You can register for MBean events on MBeans that provide notifications. In this case we want to know when a Coherence MBean is regaitered so we can access it so you can listen to events on the JVM's own JMImplementation:type=MBeanServerDelegate MBean. Among other things, this MBean fires an event each time an MBean is registered.
Here is an example
final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
NotificationFilter filter = new NotificationFilter() {
@Override
public boolean isNotificationEnabled(Notification notification) {
return "JMX.mbean.registered".equals(notification.getType());
NotificationListener listener = new NotificationListener() {
@Override
public void handleNotification(Notification notification, Object handback) {
try {
ObjectName mBeanName = ((MBeanServerNotification) notification).getMBeanName();
if ("Node".equals(mBeanName.getKeyProperty("type"))) {
System.out.println("Node MBean registered " + mBeanName);
Integer member = (Integer) mBeanServer.getAttribute(mBeanName, "Id");
System.out.println("Node Member ID = " + member);
} catch (Exception e) {
e.printStackTrace();
mBeanServer.addNotificationListener(new ObjectName("JMImplementation:type=MBeanServerDelegate"), listener, filter, null);In the code above we create a NotificationFilter that will only pass MBean registration events. We create a listener that looks for MBean registrations where the "type" attribute of the MBean's ObjectName is "Node", i.e. we have a Coherence Node MBean registration. The listener then gets the Nodes member Id and prints it. You should be able to figure out from that how to do other things.
JK
Maybe you are looking for
-
Balance sheet statement Print out
Dear all, I would like to print out a balance sheet report through transaction code S_ALR_87012284. But I would like to assign another form (smartform) to this transaction instead of print out ABAP List. (It means the screen display ABAP List but pri
-
How to make actual file for TV Shows on ipod
I have a 30g ipod, and I would like to know if it is possible to make a actual file for tv shows. When you go under video on the ipod, there is one for music videos, and one for movies, but when you set the videos to tv shows, it only shows up under
-
Debugging with Eclipse Plugin using Weblogic 6.1
I am having a problem debugging using Eclipse 2.1 and the weblogic server plugin provided by this site. If I start the server and run the application everything works fine. If I put a breakpoint into my code and then run the application I do not see
-
Adding a Layer (absolute position div) to a locked page
Maybe I am just not understanding templates but I have a really simple one that has one editable region called "content". I want to add a absolute positioned div to the content area but DW tells me this would require changing code that is locked by t
-
Understanding 7-Mode 'license show' command output
What does the "-"/hyphen/dash mean in the Expiration field? How does one determine the current expiration of installed licenses based on this output? Package Type Description Expiration NFS license NFS License