JMX Programming

Hi,
I am looking into JMX as a technology option for a project I am starting. The project is going to be a web-based admin console that will manage J2EE application components (confuration settings, state variables). JMX definitely looks like the right technology for instrumenting java classes for management... however, I need to build a custom Web-based GUI and the HTTP adaptors that are included with JMX implementations are lacking.
Has anyone built a custom Web-based JMX admin console? Are there options other than the HTTP adaptor or is there a way to customize the HTTP adaptor?
Thanks in adavance!

If nobody here has done it, I believe the folks at JBoss have...

Similar Messages

  • JMSML - XML Based Mark-Up Language for BEA WebLogic JMS and JMX

              JMSML is a Mark-Up language designed and developed to make Java Messaging Service
              (JMS) and Java Management Extensions (JMX) programming easy by hiding all the
              JMS and JMX Java API complexity behind a few, simple, easy to use XML tags.
              Both the White Paper and the binary download are available in dev2dev.beasys.com
              at the link below:
              http://dev2dev.beasys.com/resourcelibrary/whitepapers.jsp?highlight=whitepapers
              Regards
              [email protected]
              

    Hi,
    I finally managed to post a message to ActiveMQ 5.4.2 from WLS 10.3. I created a foreign JMS Server in WLS. I am not sure if you still have this issue, but I was facing this problem and managed to resolve it so posting the reply!
    I placed the activemq-all-5.4.2.jar file in WLS server classpath.
    The settings I used for the Foreign Server are:
    General tab
    JNDI Initial Context Factory: org.apache.activemq.jndi.ActiveMQInitialContextFactory
    JNDI Connection URL: tcp://localhost:61616
    Destinations Tab
    Name: TestQueue
    Local JNDI Name: TestQueue
    Remote JNDI Name: dynamicQueues/TestQueue (I tried with a normal queue, but it didn't work. So used dynamicQueues here. Will try with other queue also)
    Connection Factories Tab
    Name: AMQConnectionFactory (
    Local JNDI Name: AMQConnectionFactory
    Remote JNDI Name: ConnectionFactory (This is default name given by Active MQ, you can change by adding names in jndi.properties file and placing it in config folder of ActiveMQ installation. Please check here: http://activemq.apache.org/jndi-support.html)
    Using this configuration I was able to post message to ActiveMQ queue from Oracle Service Bus. One more issue to be taken care is that if the message type is not "Text" then the message body was coming as blank in ActiveMQ. So set the message type as "Text" explicitly.

  • Error getting attribute  on MBean

    After deploying EJB jar file I modified an EJB to add a CMP field. I deployed
    it again and tested it. It works fine. However, when I deployed I am getting
    a bunch of error. The stack trace is pasted here. Any ideas on resolving this.
    I am using WL 6.1 with service pack 3 on Solaris.
    Thanks, GP
    Here is the partial stack trace:-
    <Management> <tspwwi1> <esmirror> <ExecuteThread: '1' for queue: '__weblogic_admin_html_queue'>
    <system> <> <140001> <Error getting attribute on MBean esmirrordomain:Application=Catalog,EJBComponent=Catalog,EJBDescriptor=EJBDescriptor-6,EntityDescriptor=EntityDescriptor-11,Location=esmirror,Name=Pool-13,Type=Pool,WeblogicEJBJar=WeblogicEJBJar-13,WeblogicEnterpriseBean=WeblogicEnterpriseBean-13.
    Method: null>
    javax.management.AttributeNotFoundException:

    Hi all,
    I m facing similar with problem WLS 9.2, when I try to get value of any attributes for "EJBTransactionRuntime" AttributeNotFoundException ..can any one tell me exact hierarchy for accesing "EJBTransactionRuntime"..here is how my jmx program is accesing through below hierarchy.
    ServerRuntime->ApplicationRuntimes->ComponentRuntimes->EJBComponentRuntimes->EJBRuntimes->EntityEJBRuntimes->TransactionRuntimes->EJBTransactionRuntimes
    And I m getting following....Exception
    " in thread "main" javax.management.AttributeNotFoundException: com.bea:ServerRuntime=examplesServer,Name=BeanMa
    nagedAccountEJB,ApplicationRuntime=ejb20BeanMgedEar,Type=EntityEJBRuntime,EJBComponentRuntime=ejb20BeanMgedEjb:Transacti
    onRuntimes"
    This exception i m getting exactly when my program tries to access "TransactionRuntimes" from hierarchy..
    any help g8ly appreciated...

  • Clientgen Exception - java.lang.VerifyError:Cannot inherit from final class

    When i create a client jar from webservice ear the ant taks fails with compiler errors, such as:
    CreateProxy:
    [clientgen] Generating client jar for earname.ear(WebServiceName_WS) ...
    BUILD FAILED
    java.lang.VerifyError: Cannot inherit from final class
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:480)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:182)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:224)
    at weblogic.webservice.server.WebServiceFactory.loadNonArrayClass(WebServiceFactory.java:1318)
    at weblogic.webservice.server.WebServiceFactory.loadClass(WebServiceFactory.java:1293)
    at weblogic.webservice.server.WebServiceFactory.initTypeMaps(WebServiceFactory.java:384)
    at weblogic.webservice.server.WebServiceFactory.createFromMBean(WebServiceFactory.java:184)
    at weblogic.webservice.tools.build.internal.WSDLGenImpl.getWebServiceRuntime(WSDLGenImpl.java:240)
    at weblogic.webservice.tools.build.internal.WSDLGenImpl.run(WSDLGenImpl.java:135)
    at weblogic.webservice.tools.build.internal.ClientGenImpl.doClientGenFromEAR(ClientGenImpl.java:438)
    at weblogic.webservice.tools.build.internal.ClientGenImpl.run(ClientGenImpl.java:345)
    at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.doClientGen(ClientGenTask.java:351)
    at weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask.execute(ClientGenTask.java:208)
    at org.apache.tools.ant.Task.perform(Task.java:341)
    at org.apache.tools.ant.Target.execute(Target.java:309)
    at org.apache.tools.ant.Target.performTasks(Target.java:336)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
    at org.apache.tools.ant.Main.runBuild(Main.java:609)
    at org.apache.tools.ant.Main.start(Main.java:196)
    at org.apache.tools.ant.Main.main(Main.java:235)
    Total time: 25 seconds
    This is a ant command:
    <clientgen ear="${build}/earname.ear" onlyConvenienceMethod="true" warName="webservice.war" serviceName="WebServiceName_WS" packageName="my.package.webservices.generated" autotype="true" clientJar="${build.dist}/client/WebServiceName_WS.jar" overwrite="false" useServerTypes="true" keepGenerated="false" generateAsyncMethods="false" saveWsdl="true" j2me="false" useLowerCaseMethodNames="true" typePackageName="my.package.webservices.generated" usePortNameAsMethodName="false" />
    My webservice do not include any final class.
    I'm using WebLogic 8.1 SP4.Is there a solution for above problem?
    Thanks.
    Regards.

    Hi all,
    I m also facing quite similar problem.
    I have one sample JMX program, which i want to collect data from weblogic 9.2.
    but when i compile sample program on jdk 1.4 and run it on JDK 1.4 it throws following exception
    java.lang.VerifyError: class weblogic.utils.classloaders.GenericCl
    assLoader overrides final method .
    ERROR 02/13 09:54:03 Stderr 700100 at java.lang.ClassLoader.defineClass0(Native Method)
    ERROR 02/13 09:54:03 Stderr 700100 at java.lang.ClassLoader.defineClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.security.SecureClassLoader.defineClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.net.URLClassLoader.defineClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.net.URLClassLoader.access$100(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.net.URLClassLoader$1.run(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.security.AccessController.doPrivileged(Native Method)
    ERROR 02/13 09:54:03 Stderr 700100 at java.net.URLClassLoader.findClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.lang.ClassLoader.loadClass(Unknown Source)
    ERROR 02/13 09:54:03 Stderr 700100 at java.lang.ClassLoader.loadClass(Unknown Source)
    but sample program works fine if i run it on JDK 1.5..
    can someone tell me...wats reason?
    Thanks
    Nihil

  • Error getting attribute on MBean: AttributeNotFoundException

    Folks,
    our application on WL 6.1 SP 2 runs smooth, no probs during
    testing.
    But when we try to modify or view the deployment descriptor
    using the console, we get the exception which the stack trace
    below. We get this with every ejb-jar file.
    please help ....
    cu
    indy
    <Feb 25, 2002 10:43:10 AM GMT+00:00> <Error> <Management> <Error getting attribute
    on MBean xxxxx.xxx:Application=****,EJBComponent=****,
    EJBDescriptor=EJBDescriptor-2,Location=CentralServer,Name=Pool-7,StatelessSessionDescriptor=StatelessSessionDescriptor-7,
    Type=Pool,WeblogicEJBJar=WeblogicEJBJar-5,WeblogicEnterpriseBean=WeblogicEnterpriseBean-7.
    Method: null
    javax.management.AttributeNotFoundException:
    at weblogic.management.internal.DynamicMBeanImpl.getXAttributeInfo(DynamicMBeanImpl.java:1630)
    at weblogic.management.internal.DynamicMBeanImpl.getAttribute(DynamicMBeanImpl.java:502)
    at weblogic.management.internal.DynamicMBeanImpl.getAttribute(DynamicMBeanImpl.java:477)
    at com.sun.management.jmx.MBeanServerImpl.getAttribute(MBeanServerImpl.java:1181)
    at com.sun.management.jmx.MBeanServerImpl.getAttribute(MBeanServerImpl.java:1151)
    at weblogic.management.internal.MBeanProxy.getOneAttribute(MBeanProxy.java:283)
    at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:199)
    at $Proxy92.getAttribute(Unknown Source)
    at weblogic.management.console.utils.MBeans.getDisplayName(MBeans.java:785)
    at weblogic.management.console.utils.MBeans.getDisplayName(MBeans.java:662)
    at weblogic.management.console.tags.NavDeleteMenuTag.doStartTag(NavDeleteMenuTag.java:53)
    at weblogic.management.console.webapp._ejb._weblogic.__nav._jspService(__nav.java:1743)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:466)
    at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:296)
    at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:116)
    at weblogic.management.console.webapp._ejb.__nav._jspService(__nav.java:181)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:241)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at weblogic.management.console.actions.ForwardAction.perform(ForwardAction.java:35)
    at weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:171)
    at weblogic.management.console.actions.internal.ActionServlet.doGet(ActionServlet.java:91)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

    Hi all,
    I m facing similar with problem WLS 9.2, when I try to get value of any attributes for "EJBTransactionRuntime" AttributeNotFoundException ..can any one tell me exact hierarchy for accesing "EJBTransactionRuntime"..here is how my jmx program is accesing through below hierarchy.
    ServerRuntime->ApplicationRuntimes->ComponentRuntimes->EJBComponentRuntimes->EJBRuntimes->EntityEJBRuntimes->TransactionRuntimes->EJBTransactionRuntimes
    And I m getting following....Exception
    " in thread "main" javax.management.AttributeNotFoundException: com.bea:ServerRuntime=examplesServer,Name=BeanMa
    nagedAccountEJB,ApplicationRuntime=ejb20BeanMgedEar,Type=EntityEJBRuntime,EJBComponentRuntime=ejb20BeanMgedEjb:Transacti
    onRuntimes"
    This exception i m getting exactly when my program tries to access "TransactionRuntimes" from hierarchy..
    any help g8ly appreciated...

  • Monitoring and gathering runtime statistics

    Hi,
    I would like to be able to gather runtime statistics of a WL5.10 server and
    keep all the data for analysis at a later time.
    Basically, I'd like to log any of the information that's available from the
    console to a file. (This is for tuning purposes...)
    Gathering heap information is easy enough but how do I gather data on:
    - Connected users
    - Connection pool stats
    - EJB (cache/pool usage)
    - Execute queue length
    - Execute queue throughput
    Thanks!
    Frederic

    hi,
    JMX programs can do .. or u can use weblogic.admin for settign JMX stuff
    "Steve Feldman" <[email protected]> wrote:
    >
    I've got an ISAPI bridge connecting to a (6) node cluster. I've been
    running into
    some issues with my administrative node, so in order to determine all
    of my other
    nodes are actually up and running, I ran the "?__WebLogicBridgeConfig"
    command.
    I saw some interesting statistics that I am very unaware of. Does anyone
    have
    any insight into these...
    Build date/time: May 3 2001 15:44:35
    Runtime statistics:
    requests: 813
    successful requests: 812
    Exception objects created: 537
    Exception Objects deleted: 537
    URL Objects created: 652
    URL Objects deleted: 644
    connections recycled: 544
    UNKNOWN_ERROR_CODE exceptions: 0
    CONNECTION_REFUSED exceptions: 309
    CONNECTION_TIMEOUT exceptions: 0
    READ_ERROR exceptions: 0
    WRITE_ERROR exceptions: 0
    READ_TIMEOUT exceptions: 1
    WRITE_TIMEOUT exceptions: 0
    UNKNOWN_HOST exceptions: 0
    NO_RESOURCES exceptions: 0
    PROTOCOL_ERROR exceptions: 227
    CONFIG_ERROR exceptions: 0
    FAILOVER_REQUIRED exceptions: 0
    Regards,
    Steve
    PS: Does anyone know of any other commands that can be done from a browser
    to
    do some monitoring (beyond the console)...

  • ISAPI and WebLogicBridgeConfig Runtime statistics

    I've got an ISAPI bridge connecting to a (6) node cluster. I've been running into
    some issues with my administrative node, so in order to determine all of my other
    nodes are actually up and running, I ran the "?__WebLogicBridgeConfig" command.
    I saw some interesting statistics that I am very unaware of. Does anyone have
    any insight into these...
    Build date/time: May 3 2001 15:44:35
    Runtime statistics:
    requests: 813
    successful requests: 812
    Exception objects created: 537
    Exception Objects deleted: 537
    URL Objects created: 652
    URL Objects deleted: 644
    connections recycled: 544
    UNKNOWN_ERROR_CODE exceptions: 0
    CONNECTION_REFUSED exceptions: 309
    CONNECTION_TIMEOUT exceptions: 0
    READ_ERROR exceptions: 0
    WRITE_ERROR exceptions: 0
    READ_TIMEOUT exceptions: 1
    WRITE_TIMEOUT exceptions: 0
    UNKNOWN_HOST exceptions: 0
    NO_RESOURCES exceptions: 0
    PROTOCOL_ERROR exceptions: 227
    CONFIG_ERROR exceptions: 0
    FAILOVER_REQUIRED exceptions: 0
    Regards,
    Steve
    PS: Does anyone know of any other commands that can be done from a browser to
    do some monitoring (beyond the console)...

    hi,
    JMX programs can do .. or u can use weblogic.admin for settign JMX stuff
    "Steve Feldman" <[email protected]> wrote:
    >
    I've got an ISAPI bridge connecting to a (6) node cluster. I've been
    running into
    some issues with my administrative node, so in order to determine all
    of my other
    nodes are actually up and running, I ran the "?__WebLogicBridgeConfig"
    command.
    I saw some interesting statistics that I am very unaware of. Does anyone
    have
    any insight into these...
    Build date/time: May 3 2001 15:44:35
    Runtime statistics:
    requests: 813
    successful requests: 812
    Exception objects created: 537
    Exception Objects deleted: 537
    URL Objects created: 652
    URL Objects deleted: 644
    connections recycled: 544
    UNKNOWN_ERROR_CODE exceptions: 0
    CONNECTION_REFUSED exceptions: 309
    CONNECTION_TIMEOUT exceptions: 0
    READ_ERROR exceptions: 0
    WRITE_ERROR exceptions: 0
    READ_TIMEOUT exceptions: 1
    WRITE_TIMEOUT exceptions: 0
    UNKNOWN_HOST exceptions: 0
    NO_RESOURCES exceptions: 0
    PROTOCOL_ERROR exceptions: 227
    CONFIG_ERROR exceptions: 0
    FAILOVER_REQUIRED exceptions: 0
    Regards,
    Steve
    PS: Does anyone know of any other commands that can be done from a browser
    to
    do some monitoring (beyond the console)...

  • Deal Alert

    Fry's Electronics has a decent offer I spotted this morning for those of you building a new CS5 editing rig...
    Motherboard Combo:
    Gigabyte GA-X58A-UD3R
    Intel Core i7 930
    Fry's price after $20 rebate $364.99
    Newegg.com's price, over $500 when you include shipping.
    My budget home computer has a similar but different Gigabyte motherboard model, the EX58 UD3R rev. 1. It only has 4 Ram slots.  This model motherboard on sale at Fry's is an X58 with 6 Ram slots capable of 12GB of Ram, or if your budget allows expensive 4GB modules; 24GB.
    Here are the motherboard specs from the gigabyte.com website:
    SPECS

    Hi Todd,
    Please see this link
    http://docs.oracle.com/cd/E21764_01/apirefs.1111/e15033/com/bea/wli/sb/management/configuration/SessionManagementMBean.html
    The key is to get the reference to Session and then pretty much every thing you can access using the Java API. Although the API's are available; there is no description provided. This will give you tough time to understand ;))))
    Everything in OSB can be access via JMX Programming and the Java API references for OSB. Please see the relevant Interfaces Documentation to get idea on how to use the API in details. I will try to create the OSB flow which will simulate your error handling flow.
    Will keep posted.
    Regards
    Sushil Deshpande
    sushil.deshpande<at>techdemocracy.com
    Edited by: Sushil Deshpande on Apr 9, 2012 11:47 AM

  • MBean Server as a session bean?

    Hi folks,
    I´m new to JMX programming and I would like someone to answer what is the best practice for deploying the MBean Server:
    as a standalone java application (JSE) or can it be contained in an application server as a session bean?
    Thank you.

    It depends on your environment. E.g. we are developing server applications, and each process is exposing monitoring/configuration data through an embedded MBean Server.

  • Programming Weblogic with jmx without using weblogic api?

    Hi,
    I want to know if it is possible to program weblogic management service without
    using weblogic api but just rely on standard JMX interface and methods.
    Currently, I am relying on weblogic api weblogic.jndi.Environment and weblogic.management.MBeanHome
    interface to get the context and access the MBean Server subsystem. Can I find
    the equivalent using jmx?
    My code is as follows:
    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);
    String domain = home.getDomainName();
    homeServer = home.getMBeanServer();
    Thank you.

    Hi Ryan,
    I have looked through the documentation.
    It told me that I need to use weblogic.management.MBeanHome interface to get MBeanHome
    and from there then I can only use jmx interface.
    I presume it is not possible not to use weblogic.jar if I want to establish the
    initial connection with Weblogic server?
    Thanks.
    ryan upton <[email protected]> wrote:
    YongLeong wrote:
    Hi,
    I want to know if it is possible to program weblogic management servicewithout
    using weblogic api but just rely on standard JMX interface and methods.
    Currently, I am relying on weblogic api weblogic.jndi.Environment andweblogic.management.MBeanHome
    interface to get the context and access the MBean Server subsystem.Can I find
    the equivalent using jmx?
    My code is as follows:
    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);
    String domain = home.getDomainName();
    homeServer = home.getMBeanServer();
    Thank you.I think you'll find your answer here:
    http://edocs.bea.com/wls/docs81/jmx/index.html
    HTH
    ~Ryan

  • How to run a java program in the JVM of an already running program?

    As far as I know about JVM, each time we run a program a separate instance of JVM is created where the program runs. Correct me if I am wrong.
    Is there any way for another program to execute itself in the same JVM?
    Currently I am working on JFCUnit which is a tool used to automate swing applications. I am trying to automate JConsole.
    If I open "JConsole.exe" through a program and then try to get the handles using JFCUnit, things are not working.
    If I use JConsole.jar in JDK/lib and create a new instance of JConsole and then try to get the handles using JFCUnit, I am able to proceed with automation.
    But here comes the problem :-
    The application which needs to be automated through JConsole requires it to be started with few arguments, which is as follows:
    %JDK_HOME%\bin\jconsole -J-Djava.class.path=%CLASSPATH% -J-Dcom.sun.management.jmxremote.ssl=false -J-Dcom.sun.management.jmxremote.authenticate=true -J-Djmx.remote.protocol.provider.pkgs=oracle.oc4j.admin.jmx.remote "service:jmx:rmi://localhost:23791"So this problem can be solved in two ways,
    Either
    1. JFCunit could be made to recognize the JConsole.exe which would be running is a different JVM.
    OR
    2. JConsole.jar to be used in a way so that it takes the required arguments, hereby an instance of JConsole would be created that too in the same JVM as that of the program.
    I am more interested in the first solution as it would definitely be helpful in other projects as well.
    Please let me know if any other solution is possible.
    Any kinda solution is appreciated :)
    Thanks in advance.

    Give a look at Terracota.
    http://www.terracottatech.com/

  • Using JMX and MBeans

    I've been experimenting with Java instrumentation with MBeans.
    I created a small app to try out some of the JMX features. The app has a class that I would like to monitor with MBeans. So I created to interfaces to function as MBeans and then had the class in my app implement both interfaces.
    I then wrote a class with only a main() method to instantiate my class and call the methods it implemented from my MBean interface. In the main method I provided the code to get an MBeanServer object and then use that to register my class that implemented the MBean interfaces. My intention was to try this out, but before I did I commented out the code needed to register the class with the MBean server. I did this because I assumed the implemented interface methods would be available for monitoring without registering and it made me think if I can monitor the instrumented class like this why would I need the MBean server.
    So what is the purpose of the JMX framework and MBeans if I can instrument any class as described above?
    Is it necessary to register only to be able to monitor from outside the JMV where the instrumented class is running?
    Or are there other advantages\features\reasons for registering with the MBean server?
    Thanks

    "MS" <[email protected]> wrote:
    >
    Hello All,
    I am looking for a java program that can create JDBC connection pool
    and datasource
    using JMX/Mbeans of WLS 7.0.2.
    Can somebody help?
    Thanks in advance.
    rgds
    MS

  • Trouble Registering Custom MBean in WLS 6.1 (Example from JMX Guide)

    Hi there,
    I have trouble getting an example to work provided in the BEA Manual
    "Programming WebLogic JMX Services". The example of registering a
    custom MBeans produces in my case:
    java -cp .;C:\bea\wlserver6.1\lib\weblogic.jar jmx.dummy.MyClient
    Getting BEA MBean Server
    Using domain: weblogic
    Create object name
    Create MBean Dummy within MBean Server
    Could not create MBean Dummy
    java.rmi.UnmarshalException: error unmarshalling arguments; nested
    exception is:
    java.lang.ClassNotFoundException: jmx.dummy.MyClient
    java.lang.ClassNotFoundException: jmx.dummy.MyClient
    <<no stack trace available>>
    --------------- nested within: ------------------
    weblogic.rmi.extensions.RemoteRuntimeException - with nested
    exception:
    [java.rmi.UnmarshalException: error unmarshalling arguments; nested
    exception is:
            java.lang.ClassNotFoundException: jmx.dummy.MyClient]
    at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:60)
    at $Proxy2.registerMBean(Unknown Source)
    at jmx.dummy.MyClient.registerMBean(MyClient.java:57)
    at jmx.dummy.MyClient.main(MyClient.java:19)
    I have a custom MBean: MyCustomMBean:
    package jmx.dummy;
    public interface MyCustomMBean
    public int      getAttribute();
    and it's implementation class MyClient listed below. Does anybody know
    what I'm doing wrong ?
    Greetings,
    Alex
    package jmx.dummy;
    import weblogic.management.MBeanHome;
    import weblogic.management.Helper;
    import weblogic.management.RemoteMBeanServer;
    import javax.management.*;
    public class MyClient implements MyCustomMBean, java.io.Serializable
    MBeanServer server = null;
    ObjectName mbo = null;
    String mbeanName = null;
    public static void main(String[] args)
    MyClient client = new MyClient();
    client.createMBeanServer();
    client.registerMBean();
    client.getMBeanInfo();
    private void createMBeanServer()
    MBeanHome mbh =
    Helper.getMBeanHome("system","beabeabea","t3://localhost:7001","petstoreServer");
    echo("Getting BEA MBean Server");
    server = mbh.getMBeanServer();
    if (server == null)
    echo("Server is null");
    System.exit(2);
    private void registerMBean()
    String domain = server.getDefaultDomain();
    echo("Using domain: " + domain);
    mbeanName = new String("Dummy");
    try
    echo("Create object name");
    mbo = new ObjectName(domain + ":type="+mbeanName);
    catch (MalformedObjectNameException e1)
    echo("MalformedObjectNameException");
    e1.printStackTrace();
    System.exit(1);
    echo("Create MBean " + mbeanName + " within MBean Server");
    try
    //server.createMBean(mbeanName,mbo);
    server.registerMBean((Object) new MyClient(), mbo);
    catch (Exception e)
    echo("Could not create MBean " + mbeanName);
    e.printStackTrace();
    System.exit(1);
    private void getMBeanInfo()
    echo("getting management information for "+mbeanName);
    MBeanInfo info = null;
    try
    info = server.getMBeanInfo(mbo);
    catch (Exception e)
    echo("could not get MBeanInfo object for "+mbeanName);
    e.printStackTrace();
    return;
    echo("CLASSNAME: \t"+info.getClassName());
    echo("DESCRIPTION: \t"+info.getDescription());
    echo("ATTRIBUTES: todo ....");
    echo("\n\n");
    try
    echo("Get MBean Values:");
    String state = (String)
    server.getAttribute(mbo,"MyAttribute");
    catch (Exception e)
    echo("Could not read attributes");
    e.printStackTrace();
    return;
    echo("End of DEMO");
    private void echo(String error)
    System.out.println(error);
    public int getAttribute()
    return 3434;

    Hi, i'm using wl 6.0 on HPunix.
    And.. we don't have any serverclasses folder. :(
    Audun
    [email protected] (Alex) wrote:
    OK, I got it working. Will answer it here in case somebody else has a
    problem. Editing the CLASSPATH of WLS did not work for me but putting
    my classes in ./config/serverclasses/ did the trick. But then I
    encountered another problem, new exception that my code was not JMX
    compliant. Seperating the MBean implementation for the MyClient class
    to a new class worked:
    new class MyCustom:
    package jmx.dummy;
    public class MyCustom implements
    jmx.dummy.MyCustomMBean,java.io.Serializable
    public int getMyAttribute()
    return 3434;
    untouched MyCustomMBean class:
    package jmx.dummy;
    public interface MyCustomMBean
    public int      getMyAttribute();
    edited MyClient class:
    package jmx.dummy;
    import weblogic.management.MBeanHome;
    import weblogic.management.Helper;
    import weblogic.management.RemoteMBeanServer;
    import javax.management.*;
    public class MyClient
    MBeanServer server = null;
    ObjectName mbo = null;
    String mbeanName = null;
    public static void main(String[] args)
    MyClient client = new MyClient();
    client.createMBeanServer();
    client.registerMBean();
    client.getMBeanInfo();
         client.unregister();
    private void createMBeanServer()
    MBeanHome mbh =
    Helper.getMBeanHome("system","beabeabea","t3://localhost:7001","examplesServer");
    echo("Getting BEA MBean Server");
    server = mbh.getMBeanServer();
    if (server == null)
    echo("Server is null");
    System.exit(2);
    private void registerMBean()
    String domain = server.getDefaultDomain();
    echo("Using domain: " + domain);
    mbeanName = new String("MyCustomMBean");
    try
    echo("Create object name");
    mbo = new ObjectName(domain + ":type="+mbeanName);
    catch (MalformedObjectNameException e1)
    echo("MalformedObjectNameException");
    e1.printStackTrace();
    System.exit(1);
    echo("Create MBean " + mbeanName + " within MBean Server");
    try
    //server.createMBean(mbeanName,mbo);
    server.registerMBean((Object) new MyCustom(), mbo);
    catch (Exception e)
    echo("Could not create MBean " + mbeanName);
    e.printStackTrace();
    System.exit(1);
    private void getMBeanInfo()
    echo("getting management information for "+mbeanName);
    MBeanInfo info = null;
    try
    info = server.getMBeanInfo(mbo);
    catch (Exception e)
    echo("could not get MBeanInfo object for "+mbeanName);
    e.printStackTrace();
    return;
    echo("CLASSNAME: \t"+info.getClassName());
    echo("DESCRIPTION: \t"+info.getDescription());
    echo("ATTRIBUTES: todo ....");
    echo("\n\n");
    try
    echo("Get MBean Values:");
    String state =
    (server.getAttribute(mbo,"MyAttribute")).toString();
    System.out.println("state is "+state);
    catch (Exception e)
    echo("Could not read attributes");
    e.printStackTrace();
    return;
    echo("End of DEMO");
    private void echo(String error)
    System.out.println(error);
    public int getAttribute()
    return 3434;
    private void unregister()
    try
    server.unregisterMBean(mbo);
    catch (Exception e)
    echo("could not unregister mbean");
    [email protected] (Alex) wrote in message news:<[email protected]>...
    Hi there,
    I have trouble getting an example to work provided in the BEA Manual
    "Programming WebLogic JMX Services". The example of registering a
    custom MBeans produces in my case:
    java -cp .;C:\bea\wlserver6.1\lib\weblogic.jar jmx.dummy.MyClient
    Getting BEA MBean Server
    Using domain: weblogic
    Create object name
    Create MBean Dummy within MBean Server
    Could not create MBean Dummy
    java.rmi.UnmarshalException: error unmarshalling arguments; nested
    exception is:
    java.lang.ClassNotFoundException: jmx.dummy.MyClient
    java.lang.ClassNotFoundException: jmx.dummy.MyClient
    <<no stack trace available>>
    --------------- nested within: ------------------
    weblogic.rmi.extensions.RemoteRuntimeException - with nested
    exception:
    [java.rmi.UnmarshalException: error unmarshalling arguments; nested
    exception is:
    java.lang.ClassNotFoundException: jmx.dummy.MyClient]
    at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:60)
    at $Proxy2.registerMBean(Unknown Source)
    at jmx.dummy.MyClient.registerMBean(MyClient.java:57)
    at jmx.dummy.MyClient.main(MyClient.java:19)
    I have a custom MBean: MyCustomMBean:
    package jmx.dummy;
    public interface MyCustomMBean
    public int      getAttribute();
    and it's implementation class MyClient listed below. Does anybody know
    what I'm doing wrong ?
    Greetings,
    Alex
    package jmx.dummy;
    import weblogic.management.MBeanHome;
    import weblogic.management.Helper;
    import weblogic.management.RemoteMBeanServer;
    import javax.management.*;
    public class MyClient implements MyCustomMBean, java.io.Serializable
    MBeanServer server = null;
    ObjectName mbo = null;
    String mbeanName = null;
    public static void main(String[] args)
    MyClient client = new MyClient();
    client.createMBeanServer();
    client.registerMBean();
    client.getMBeanInfo();
    private void createMBeanServer()
    MBeanHome mbh =
    Helper.getMBeanHome("system","beabeabea","t3://localhost:7001","petstoreServer");
    echo("Getting BEA MBean Server");
    server = mbh.getMBeanServer();
    if (server == null)
    echo("Server is null");
    System.exit(2);
    private void registerMBean()
    String domain = server.getDefaultDomain();
    echo("Using domain: " + domain);
    mbeanName = new String("Dummy");
    try
    echo("Create object name");
    mbo = new ObjectName(domain + ":type="+mbeanName);
    catch (MalformedObjectNameException e1)
    echo("MalformedObjectNameException");
    e1.printStackTrace();
    System.exit(1);
    echo("Create MBean " + mbeanName + " within MBean Server");
    try
    //server.createMBean(mbeanName,mbo);
    server.registerMBean((Object) new MyClient(), mbo);
    catch (Exception e)
    echo("Could not create MBean " + mbeanName);
    e.printStackTrace();
    System.exit(1);
    private void getMBeanInfo()
    echo("getting management information for "+mbeanName);
    MBeanInfo info = null;
    try
    info = server.getMBeanInfo(mbo);
    catch (Exception e)
    echo("could not get MBeanInfo object for "+mbeanName);
    e.printStackTrace();
    return;
    echo("CLASSNAME: \t"+info.getClassName());
    echo("DESCRIPTION: \t"+info.getDescription());
    echo("ATTRIBUTES: todo ....");
    echo("\n\n");
    try
    echo("Get MBean Values:");
    String state = (String)
    server.getAttribute(mbo,"MyAttribute");
    catch (Exception e)
    echo("Could not read attributes");
    e.printStackTrace();
    return;
    echo("End of DEMO");
    private void echo(String error)
    System.out.println(error);
    public int getAttribute()
    return 3434;

  • JMX version 1.0 & 1.2 conflict.

    I have a JMX client program running in JDK1.5 and the JMX server in 1.4 JDK and weblogic8.1.
    When I am trying to connect it is throwing the exception :
    Exception caught: java.lang.NullPointerException
    at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
    at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:164)
    at weblogic.management.internal.RemoteMBeanServerImpl_815_WLStub.queryNames(Unknown Source)
    at JMXTEST.main(JMXTEST.java:41)
    Caused by: java.lang.NullPointerException
    This I understood, because of JMX version conflict 1.0 and 1.2, I tried setting System.setProperty("jmx.serial.form", "1.0") ;, but It didn�t worked.
    Problem here is, the classes are present in rt.jar and weblogic.jar, but having different versions of JMX. The program is getting the classes from rt.jar is creating the issue. Is there any way to specify in the program, get these classes from weblogic.jar and not from rt.jar
    OR is there any solution to this issue.
    Code :
    MBeanServer mbs = (RemoteMBeanServer) home.getMBeanServer();
    Set mbeans = mbs.queryNames(objName, null);
    Your help is greatly appreciated. Thanks in advance.
    Regards,
    Shyam

    Hmm..
    If the two JMX versions are incompatible,. then a SerializationException is thrown. I had faced a similar problem working with Websphere 5.x and JMX 1.2.. The only way you can go around this is to use a client that is built on JMX 1.0, or change your server side JMX version. Personally i think you should just use a JMX 1.0 client.
    The reason why both are incompatible is that the serviceVersionUIDs that are difined in the JMX 1.0 classes do not match the ones in JMX 1.2. There is not way out of this. :( You see, many JMX Classes such as ObjectName, etc are sent to - from the client and the server so they need to be serialized, deserialzed.
    Your NullPointerException may be due to something else. However i suspect that once you resolve NullPointerException, you will eventually bump into serialization / deserialization problems.

  • MBean sample program given in the URL is not working....

    Hi, i am a newbie learning about JMX and mBean and its registration.
    I am going through the following URL and downloaded jmx_examples.zip given in that page.
    <p>
    " http://java.sun.com/docs/books/tutorial/jmx/mbeans/standard.html "
    </p>
    But, when i run it from my local system, i am getting the following errors,
    C:\JMX_samples>javac com\example\*.java
    com\example\Client.java:15: cannot find symbol
    symbol : class JMX
    location: package javax.management
    import javax.management.JMX;
    ^
    com\example\QueueSample.java:9: cannot find symbol
    symbol : class ConstructorProperties
    location: package java.beans
    import java.beans.ConstructorProperties;
    ^
    com\example\QueueSample.java:18: cannot find symbol
    symbol : class ConstructorProperties
    location: class com.example.QueueSample
    @ConstructorProperties({"date", "size", "head"})
    ^
    com\example\Client.java:113: cannot find symbol
    symbol : variable JMX
    location: class com.example.Client
    JMX.newMBeanProxy(mbsc, mbeanName, HelloMBean.class, true);
    ^
    com\example\Client.java:167: cannot find symbol
    symbol : variable JMX
    location: class com.example.Client
    JMX.newMXBeanProxy(mbsc, mxbeanName, QueueSamplerMXBean.class);
    ^
    Note: com\example\QueueSampler.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: com\example\Client.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    5 errors
    I know that, i have to include some jars, but i dont know what are they? please help me find them and also let me know what are the jars that i need to run this sample program?
    Edited by: vinney_143 on Apr 7, 2009 5:31 PM

    It looks as if you are trying to use an example for Java 6 with a Java 5 platform. The javax.management.JMX and java.beans.ConstructorProperties classes are new with Java 6.
    Regards,
    Éamonn McManus -- JMX Spec Lead -- [http://weblogs.java.net/blog/emcmanus]

Maybe you are looking for

  • How can I sync iPod Mini after hard drive reformat?

    My son has an iPod mini. Recently, we had to have our computer hard drive reformatted and had to reinstall iTunes. When we try to sync the mini, it shows up with all it's songs, but the songs won't update into the library, so the desktop iTunes has n

  • Can't see application in calculation manager

    We are testing moving from Hyperion 9.3.1 to 11.1.1.3. We have created two new applications, one using EPMA and the second as a classic but with Calculation Manager. I have set the advanced settings in the classic application to calculation manager a

  • 8.1.7.4 Performance Issue

    Hi, I'm not sure I'm posting this question in the right place, but here is better than no where. We recently upgraded all our DB environments (in the last month) from 8.0.6 to 8.1.7.4 and we took performance hit. SQL that used to do rather well is do

  • Spotlight, Mail app and Entourage

    I was using spotlight today to try and find info ("this.x" inside a Javascript inside a .qtz file). Interestingly Entourage (which i rarely use) generated a hit for an email message where Mail app did not. Searching inside Mail app itself found the m

  • OneDrive App for Mac Will Not Work

    I'd like to use OneDrive's cloud storage bc my documents are primarily created with MS's Office products. However, when I download and install the app for my MacBook Pro (which meets or exceeds all necessary requirements) I am unable to do so. When i