JMX vs Reflexion

Hello,
I am trying to establish a comparison of Java Management Extensions and Java Reflexion. What does JMX brings that "standard" reflexion cannot do? What is the difference between those two APIs and what would be a practical use case for them?
Thanks in advance,
Balteo.

Well, firstly by defining an MBean you are restricting what classes and methods can be accessed - using reflection you could access any class and any method.
Secondly, you register in a central repository all your managed objects, so you don't have to keep track of all your objects yourself. This repository has namespaces so you can organise your objects.
Thirdly, JMX allows notification of events, rather than having to write your own custome event handling/routing etc.
Fourthly, JMX provides gauges, so that user defined limits can be put onto objects, and special events triggered when these limits are breached.
Using products such as Suns JDMK you can transparently remotely manage things, without having to write all that custom code yourself.
There may be more that I haven't thought of.
Don't really know of all of the uses of reflection, but JMX is very good for managing objects and managing and monitoring your system. If you look at JBoss they have a JMX micro kernal which loads all of the other parts of the app server, making it extremely flexible and easy to manage.

Similar Messages

  • Jmx Services as Business Services ?

    I am wondering if JMX service are just for managing or even suitable to use as business services.
    In my new work all remote (business) service invocation is done by using jmx services which i find rather freaky.
    The people there come from implementing in C++ and are doing the shift to Java to use JBoss and all, so they're looking for all the java fancy stuff and stacking it all together. Some architectural decisions are questionable, imo.
    Maybe im too long into java to see the possibilities.. I thought JMX is (best used) for managing (only).. are Jmx invocations scalable ?
    What do u think ?
    Any hints, suggestions welcome.

    This isn't the first time I've heard of JMX technology being used as a general-purpose distributed object model. While that isn't the principal design centre of the technology, it is a reasonably good fit in some circumstances. The main advantages people have cited to explain why they make this choice are, first, the notification (event) support, which provides a simple but powerful model that does not require the server to be able to make a connection back to the client; second, a good security model; and third, the fact that it has been part of the core Java platform since 2004, which means not only that it is trivial to deploy but also that it is maintained.
    The main disadvantage is that it does not come with built-in support for transactions, although that can be achieved by having the JMX MBeans use the Java Transaction API, for example.
    Concerning scalability, the technology is reasonably scalable along the various dimensions (number of managed objects, number of servers, number of clients). Scalability is one of the main targets of the work we are doing on the next version of the API, due to ship with the Java 7 platform, but the existing scalability will usually be enough except for the biggest deployments.
    Regards,
    �amonn McManus -- JMX Spec Lead -- [http://weblogs.java.net/blog/emcmanus]

  • How to monitor an application using JMX

    Hi,
    How can I monitor the portal application running on  portal server by using MBeans (JMX)? For this I need to make a connection between my portal application and  MBean class, How to monitor operations? How can I do that? If anybody has come across the same requirement pls explain me with the implementation details.

    Hello,
    I have done that in a project (not Portal, but pure Java Application, should be no difference), working fine.
    The steps are as follows:
    - create MBean Server (e.g. MBeanServerFactory.createMBeanServer("test");)
    - create your MBeans
    - make them accessible to clients (register the MBeans in the server)
    - query them from clients
    see http://java.sun.com/developer/technicalArticles/J2SE/jmx.html
    for very good explanation including sample source code.
    CSY

  • Questions on JMX and management-config

    I was wondering if anyone can clarify the usage of management-config.
    We've got a setup with managed-nodes=all and allow-remote-management=true (other params defaulted). We've got processes that occasionally ping the cluster (via a single node) to log performance statistics and to look for problems that might require intervention (across all nodes via remote management).
    I'm trying to determine if the JMX subsystem is completely isolated from runtime cache performance.
    1) Does the setting for the read-only flag impact performance in any way? If set to false, is there any sort of locking or synchronization that takes place when querying cluster nodes?
    2) Do calls to JMX (and presumably the Invocation Service) share any resources with a Distributed Cache Service?
    3) the Default management-config settings in Tangosol-coherence.xml point to the "Management" service - which is not actually defined elsewhere in the configuration file. Is this actually an implicit link to the Invocation Service?
    4) Is there a single "Service Thread"? or does each distinct service have its own service thread?
    Thanks in advance,
    Dave

    The performance impact of management is relatively small. The consumption is based on the information "read" (getAttribute/getAttribute) and the frequency of the poll. Polls of the same data element within 1 second will receive the same result for remote nodes.
    The formula to determine the network consumption estimation formula for Coherence 3.3 on a single poll of the information is:
    Estimated network bytes per poll =
    Number of remote Node MBeans retrieved * 725
    + Number of remote Cache MBeans retrieved * 225
    + Number of remote Storage Manager MBeans Retrieved * 720
    + Number of remote Service MBeans Retrieved * 144
    + Number of remote Point to Point MBeans * (Number of Nodes in Grid -1 * 250)
    Given the order N size of the Point-to-Point MBeans, It is not recommended to put that information in a loop for a large cluster.
    1) Does the setting for the read-only flag impact performance in any way? If set to false, is there any sort of locking or synchronization that takes place when querying cluster nodes?
    EW: The Read-only flag does not impact performance. There is no synchronization on read of the objects. Synchronization on update is on an attribute by attribute basis.
    2) Do calls to JMX (and presumably the Invocation Service) share any resources with a Distributed Cache Service?
    EW: The JMX calls are processed through the Management (Invocation) Service. This shares system (memory, CPU, network) resources with other services. The management information is not processed out-of-band and under extreme load performance will be impacted.
    3) the Default management-config settings in Tangosol-coherence.xml point to the "Management" service - which is not actually defined elsewhere in the configuration file. Is this actually an implicit link to the Invocation Service?
    EW: The Management service is a non-configurable Invocation service.
    4) Is there a single "Service Thread"? or does each distinct service have its own service thread?
    EW : Not exactly sure I understand the question. Each service has its' own "Service" thread and thread pool. However, there are some shared components at the TCMP (network) layer.
    Hope this helps,
    Everett Williams
    Message was edited by:
    user631017
    Message was edited by:
    user631017

  • How to connect to remote server with jmx from jvisualvm

    I have a WL 10.3.2 domain running on a single box. The adminserver and managed server are running on the same box, on different ports (7001 and 8001, respectively).
    I have a Spring application deployed to the managed server and I've configured it to register a Spring bean as a JMX mbean.
    When I run this entire configuration on my laptop, I can run jvisualvm and connect to my server and see and manipulate my registered mbean.
    I'm having trouble figuring out how to get a remote connection working, however. I want to run jvisualvm on my laptop and connect to the remote server.
    I first did "Add Remote Host", where I specified the IP address. It appears that this was created successfully, and it apparently was able to determine the DNS name for it.
    I then tried to add a JMX connection. In the "Connection" field, I just entered the IP address followed by a colon and 8001 (managed server port number).
    In the "Use security credentials" section, I entered the weblogic admin principal and credentials.
    When I click OK, it chugs for a while and eventually gives up, saying:
    Cannot connect to [email protected]:8001 using
    service:jmx:rmi:///jndi/rmi://nn.nn.nn.nn:8001/jmxrmi
    What might I be missing?

    I've resolved this. At least I was able to configure an authenticated connection. It doesn't use SSL yet, but I'm ok with that for a while.
    Resolving this only required changing the command line parameters for the managed server, and being aware of the "jmxremote.access" and jmxremote.password" files. The following blog article helped a lot: [http://www.dzone.com/links/r/monitoring_your_java_application_with_jmx_part_2.html] .
    I'm now passing the following command-line parameters:
    -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8888 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true
    The default "role" configured in "jmxremote.access" is "controlRole", and the "jmxremote.password" file specifies the credentials for that principal. I simply used that principal and credential in JVisualVM, and the connection succeeded.
    And I just used the "host:port" form, not the protocol form.
    Edited by: david.karr on Feb 4, 2011 12:47 PM

  • How to read the messages in the JMS Queue using JMX

    Hi,
              I want to read messages in the JMS queue using JMX. I was able to read using QueueBrowser but want to modify priority of the messages using JMX.
              I tried to use JMSDestinationRuntimeMBean but it does not allow us to read messages unless we pass the message Id. Is there any way that I can get all the messages in the queue.
              I am using Weblogic 8.1 SP4
              Can someone please help me in this regard.
              Thanks,
              Kiran.
              Edited by KGudipati at 10/22/2007 1:22 AM

    Hi,
    As far as i know, JMS Object Messages is not supported by XI JMS adapter.
    you need to have the JMS provider to transform the message to bytes messages.
    (Refer to SAP note 856346)

  • How to find all JMX ports on a server?

    How to find all jmx ports on particular server (say localhost) on windows
    I have multiple JVM's running on my local server, and there is extensive use of JXM mbeans by the applications running on each server. So I want to connect to all these JMX servers and to instrument the MBeans using Jconsole(Jconsole localhost:<port>). But I don't know the port numbers, and its not logged by the application.
    How do I find all the ports jmx servers connected?
    Note : In my case I can not instrument using the PID.
    thanks,
    bala K

    Hi kajbj,
    I tried stop/start the application, but couldn't find any difference in the netstat command. I know it should show the JMX port (I am able to see on a test application), but this application's JMX port usage is missing.
    netstat -ano --> Do i need to use any other commands?
    I just injected few lines of code ( to list the MBeanServers programatically), to this application (did some usual tweaks to let this code execute at some time) and its listing couple of MBeanServers and lot of MBeans.
    MBeanServerFactory.findMBeanServer(null); and so on.....
    Is there a way to get the port using the Management API's?
    thanks,
    bala K

  • JMX API to Create Event Generator

    Is there any JMX API available to create JMS event generator?
    Thanks

    Hi,
    As mentioned in the last post go to the event screen by
    Environment --> Modifications --> Events.
    There you click on new entries and try writing your logic for event 21 i.e. after selecting 21 give some name of your event and write down the logic how you want to do this.
    If event number 21 does not work then try 1. One of these two should work.
    Hope this helps!!!
    Regards,
    Lalit

  • Using JMX to get status information about NetWeaver cluster

    Hi everybody,
    We are trying to use JMX to get some status information about NetWeaver cluster.
    For example, using the MBean with the name u201Ccom.sap.default:name=EL1,j2eeType=SAP_J2EEClusteru201D we can obtain the list of all instances running in cluster. Here an instance is a u201CJava instanceu201D in the NetWeaver terminology.
    The method u201CgetInstanceNodeIDsu201D provides us with a list of all nodes of an instance.
    Concretely, calling this method for a cluster running on one machine with two java processes, we get the following list of node Ids: u201C0, 1476420, 1476450, 1476451u201D where the last two correspond to the two java processes.
    What are the first two node Ids from the list?
    How can the last two node Ids be identified as java processes?
    How can we obtain status information about each java process (node id) ?
    Thanks for all ideas,
    Radu

    As there seems to be a lot of interest in this subject, and since I found some form of solution, I thought I'd share it with you.
    In the es-cli interface, there is a thing called browse mode. Activate it by typing browse after logging in.
    Now you can easily browse your network and all of the managed objects. Use getattributes at the end of each branch to see the properties of objects. So far, I've indexed all of the kernel reader module, the health monitor module, the common config reader and the config reader for workgroup servers. If my employer allows, I will post results to http://tille.garrels.be/training/sunmc/ - check later this week.
    Machtelt.

  • Deploying a WebApp using JMX

              IHAC who has the following problem while deploying a webapp in 6.1. I am including
              her description of the problem.
              Thanks in advance.
              i'm still playing around with deploying to the 6.1 beta wl server using the api
              calls. Although the
              following code executes, it makes the server crash when attempting to add the
              target MBean to the WebAppComponent...
              TargetMBean targetMBean = (TargetMBean)home.getMBean(managedSrv,
              "Server", domain);
              ApplicationMBean appMBean = (ApplicationMBean) home.findOrCreateAdminMBean(
              appNm, "Application", domain);
              appMBean.setPath(path);
              WebAppComponentMBean webappBean =
              (WebAppComponentMBean)home.createAdminMBean
              ( webAppNm,"WebAppComponent", domain, ppMBean);
              webappBean.setURI(warFile);
              if (targetMBean.isRegistered()){
              System.out.println("target is registered. Type is: " + targetMBean.getType());
              webappBean.addTarget(targetMBean);
              .. when the call to webappBean.addTarget(targetMBean) is made, the server console
              shows this error...
              java.lang.NullPointerException
              at java.io.File.<init>(File.java:180)
              at weblogic.management.mbeans.custom.Application.findInputStream(Application.java:1708)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy9.findInputStream(Unknown Source)
              at weblogic.management.mbeans.custom.Application.findInputStream(Application.java:1701)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy42.findInputStream(Unknown Source)
              at weblogic.management.configuration.ApplicationMBean_CachingStub.findInputStream(ApplicationMBean_CachingStub.java:694)
              at weblogic.j2ee.Application.retrieveEar(Application.java:425)
              at weblogic.j2ee.Application.<init>(Application.java:119)
              at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:110)
              at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329)
              at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
              at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.java:76)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy40.addWebDeployment(Unknown Source)
              at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDeployment(WebServerMBean_CachingStub.java:1066)
              at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:315)
              at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java:443)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:321)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:944)
              at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:931)
              at weblogic.management.internal.DynamicMBeanImpl.add(DynamicMBeanImpl.java:916)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:591)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.RemoteMBeanServerImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:266)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:233)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              javax.management.MBeanException
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:323)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:944)
              at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:931)
              at weblogic.management.internal.DynamicMBeanImpl.add(DynamicMBeanImpl.java:916)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:591)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.RemoteMBeanServerImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:266)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:233)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              This code attempts to deploy a war from a remote directory.
              The code in the war file is mostly the security web app sample in the wl examples
              directory roled into a war archive. this war deploys and runs ok using the console
              ("manually").
              If all the code is allowed run - crashing the server - then, after restarting
              the server
              (if the console was running), the deployment entries are in the config.xml and
              the
              'mirrored' copy of the war file shows up in the .wlnotdelete directory - from
              which it runs successfully.
              i'd appreciate any insight on what might be going on or whether the code is correct
              useage
              for deployment.
              

              IHAC who has the following problem while deploying a webapp in 6.1. I am including
              her description of the problem.
              Thanks in advance.
              i'm still playing around with deploying to the 6.1 beta wl server using the api
              calls. Although the
              following code executes, it makes the server crash when attempting to add the
              target MBean to the WebAppComponent...
              TargetMBean targetMBean = (TargetMBean)home.getMBean(managedSrv,
              "Server", domain);
              ApplicationMBean appMBean = (ApplicationMBean) home.findOrCreateAdminMBean(
              appNm, "Application", domain);
              appMBean.setPath(path);
              WebAppComponentMBean webappBean =
              (WebAppComponentMBean)home.createAdminMBean
              ( webAppNm,"WebAppComponent", domain, ppMBean);
              webappBean.setURI(warFile);
              if (targetMBean.isRegistered()){
              System.out.println("target is registered. Type is: " + targetMBean.getType());
              webappBean.addTarget(targetMBean);
              .. when the call to webappBean.addTarget(targetMBean) is made, the server console
              shows this error...
              java.lang.NullPointerException
              at java.io.File.<init>(File.java:180)
              at weblogic.management.mbeans.custom.Application.findInputStream(Application.java:1708)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy9.findInputStream(Unknown Source)
              at weblogic.management.mbeans.custom.Application.findInputStream(Application.java:1701)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy42.findInputStream(Unknown Source)
              at weblogic.management.configuration.ApplicationMBean_CachingStub.findInputStream(ApplicationMBean_CachingStub.java:694)
              at weblogic.j2ee.Application.retrieveEar(Application.java:425)
              at weblogic.j2ee.Application.<init>(Application.java:119)
              at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:110)
              at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329)
              at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
              at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.java:76)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:437)
              at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:178)
              at $Proxy40.addWebDeployment(Unknown Source)
              at weblogic.management.configuration.WebServerMBean_CachingStub.addWebDeployment(WebServerMBean_CachingStub.java:1066)
              at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:315)
              at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144)
              at java.lang.reflect.Method.invoke(Native Method)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:587)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.ConfigurationMBeanImpl.updateConfigMBeans(ConfigurationMBeanImpl.java:443)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:321)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:944)
              at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:931)
              at weblogic.management.internal.DynamicMBeanImpl.add(DynamicMBeanImpl.java:916)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:591)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.RemoteMBeanServerImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:266)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:233)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              javax.management.MBeanException
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:323)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:944)
              at weblogic.management.internal.DynamicMBeanImpl.addDeployment(DynamicMBeanImpl.java:931)
              at weblogic.management.internal.DynamicMBeanImpl.add(DynamicMBeanImpl.java:916)
              at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:591)
              at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:573)
              at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:319)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at weblogic.management.internal.RemoteMBeanServerImpl_WLSkel.invoke(Unknown
              Source)
              at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:266)
              at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:233)
              at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              This code attempts to deploy a war from a remote directory.
              The code in the war file is mostly the security web app sample in the wl examples
              directory roled into a war archive. this war deploys and runs ok using the console
              ("manually").
              If all the code is allowed run - crashing the server - then, after restarting
              the server
              (if the console was running), the deployment entries are in the config.xml and
              the
              'mirrored' copy of the war file shows up in the .wlnotdelete directory - from
              which it runs successfully.
              i'd appreciate any insight on what might be going on or whether the code is correct
              useage
              for deployment.
              

  • Remote access of InitialContext via JMX client

    Hi,
    I'm not sure if i'm the right place here for posting my problem, but I don't know where to put it otherwise.
    I'm trying to access a JBoss datasource via JMX. The JMX code and datasource code is both placed inside a WAR file that is deployed in Jboss 5.1.
    When I access the datasource from a servlet, it runs oke but when I try to run it from jconsole I get a classnotfoundexception.
    The code where I register the MBean is:
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    try
    ObjectName mbeanName = new ObjectName(OBJECT_NAME);
    Test mbean = new Test();
    mbs.registerMBean(mbean, mbeanName);
    catch (Exception e)
    //handle
    The code where I get the exception is:
    Context initContext = new InitialContext(jndiProps);
    The exception is:
    javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory]
    These are my JNDI props:
    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
    java.naming.provider.url=jnp://localhost:1099
    Any ideas?

    OK - I found another thread dealing with the problem at hand.
    http://forums.sun.com/thread.jspa?threadID=5369697
    Edited by: Christian.Yttesen on Jan 13, 2010 5:15 AM

  • Help needed in using JMX APIs

    Hi
    My requirement is to retrieve the JNDI Names of the JMSConnectionFactory and the JMSQueue using the Connection factory or Queue name. In short im trying out a feasibility of reading the JNDI values for queues from weblogic config.xml instead of reading them from a properties file.
    I developed a sample code using JMX APIs that will fetch the JNDI names of all the JMS destinations available for a particluar JMSServer.
    But is there any way to retrieve the JNDI names based on the queue names .. in general i will give queue name as input and i want the queue's JNDI name as output.
    My sample code is :
    import java.util.Iterator;
    import java.util.Set;
    import javax.management.ObjectName;
    import javax.management.QueryExp;
    import javax.management.Attribute;
    import javax.naming.Context;
    import weblogic.jndi.Environment;
    import weblogic.management.MBeanHome;
    import weblogic.management.RemoteMBeanServer;
    import weblogic.management.WebLogicObjectName;
    import weblogic.management.configuration.JMSQueueMBean;
    import weblogic.management.configuration.JMSServerMBean;
    import weblogic.management.configuration.JMSConnectionFactoryMBean;
    import weblogic.management.configuration.JMSDestinationMBean;
    import weblogic.management.runtime.JMSServerRuntimeMBean;
    import weblogic.management.configuration.JMSDestinationMBean;
    public class JMSAddQueue {// The name of the WebLogic domain, please change this to match the //// name of your installation specific domain name                  
    private static String weblogicDomain = "conciergetestdomain";// The name of the WebLogic server, please change this to match the //// name of your installation specific server name
    public static void main(String[] args) {
         try
              Environment env = new Environment(); 
              env.setProviderUrl("t3://localhost:7001");  
              env.setSecurityPrincipal("system");  
              env.setSecurityCredentials("weblogic");  
              Context ctx = env.getInitialContext();  
              MBeanHome home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);  
              ctx.close();  
      JMSServerMBean cf = (JMSServerMBean)home.findOrCreateAdminMBean("TESTSERVER","JMSServer", weblogicDomain);
    JMSDestinationMBean[] jdb = cf.getDestinations();
    System.out.println("** The JNDI name is : "+jdb[0].getJNDIName());
    catch (Exception e) {
    e.printStackTrace();
    }Is there any way to retrieve the JNDI names using the queue names ?
    Thanks
    Arun B

    I will send up an alert for you, Colin. Even though I use iTunes for Mac, troubleshooting it isn't my forté.

  • 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

  • Unit test in jmx 1.0

    Hi folks,
    I need to unit test my code to see if my solution is viable.
    I have the following code ( written for WLS 8.1 using jdk 1.4).
    I my junit test I make a call to connect() then I get the follwing error:
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at se.netwise.mcx.alarmhandler.AlarmNotificationManager.connect(AlarmNotificationManager.java:54)
         at se.netwise.mcx.alarmhandler.test.AlarmHandlingTest.testSendAlarmPRS001(AlarmHandlingTest.java:48)
    The line that is a problem seems to be:
    home = (MBeanHome) ctx.lookup("weblogic.management.home");
    Do need to mock it?
    cheers,
    //mike
    import java.util.Date;
    import javax.management.Attribute;
    import javax.management.AttributeList;
    import javax.management.ObjectName;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import org.apache.log4j.Logger;
    import weblogic.management.MBeanHome;
    import weblogic.management.RemoteMBeanServer;
    public class AlarmNotificationManager {
         private ObjectName objName = null;
         private MBeanHome home = null;
         private RemoteMBeanServer rmbs = null;
         private static Logger LOG = Logger.getLogger(AlarmHandlerManager.class);
         private static AlarmNotificationManager instance = null;
         protected AlarmNotificationManager() {
              // Exists only to defeat instantiation.
         public static AlarmNotificationManager getInstance() {
              if (instance == null) {
                   instance = new AlarmNotificationManager();
              return instance;
         public void connect(){
              try {
                   // Environment env = new Environment();
                   // env.setProviderUrl(url);
                   // env.setSecurityPrincipal(username);
                   // env.setSecurityCredentials(password);
                   // Context ctx = env.getInitialContext();
                    //Context ctx =new InitialContext();
                   //home = (MBeanHome) ctx.lookup("weblogic.management.home");
                    InitialContext ctx = new InitialContext();
                    home = (MBeanHome) ctx.lookup("weblogic.management.home");
                   System.out.println("Got the MBeanHome: " + home);
              } catch (NamingException e) {
                   LOG.error("Could not create initial context.", e);
                   throw new RuntimeException("Could not create initial context", e);
              try {
                   rmbs = home.getMBeanServer();
                   System.out.println("got MBeanServer: " + rmbs);
              } catch (Exception e) {
                   System.out.println("Caught exception: " + e);
             try {
              objName = new ObjectName("alarmnotificationmbean.fm.mc.sdf.ericsson.com:type=AlarmNotification");
             } catch (javax.management.MalformedObjectNameException mone) {
                System.out.println("MalformedObjectNameException: " + mone);
         public void sendNotification(String id) throws Exception {
              AlarmData data = AlarmList.getAlarmData(id);
              if (data == null) {
                   LOG.error("alarm contains no data");
              // Send alarm notification
              int attrListSize = 5;
              AttributeList attrList = new AttributeList(attrListSize);
              attrList.add(new Attribute("EventType",
                        new Integer(data.getEventType())));
              attrList.add(new Attribute("EventTime", new Date()));
              attrList.add(new Attribute("ProbableCause",
                        new Integer(data.getCause())));
              attrList
                        .add(new Attribute("Severity", new Integer(data.getSeverity())));
              attrList.add(new Attribute("SpecificProblems", data
                        .getSpecificProblem()));
              rmbs.setAttributes(objName, attrList);
              // Send alarm notification
              rmbs.invoke(objName, "sendAlarmNotification", null, null);
         public void resetNotification(String id) throws Exception {
              rmbs.invoke(objName, "resetAlarmNotification", null, null);
         public void close() {
    }

    Daniel's right, that it needs to run in weblogic, if you're not doing that. I've written some unit tests that get called from a startup class when the server boots for the same reason. I couldn't (or didn't want to spend the time) to mock the MBeanHome. But I've tried to ween off using MBeanHome since it's not standard jmx, and use MBeanServer wherever possible. MBeanHome has been deprecated, and this will help when you have to port to a later version of weblogic.
    Alper

  • Best practice to monitor 10gR3 OSB performance using JMX API?

    Hi guys,
    I need some advice on the best practice to monitor 10gR3 OSB performance using JMX API.
    Jus to show I have done my home work, I managed to get the JMX sample code from
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/jmx_monitoring/example.html#wp1109828
    working.
    The following is the list of options I am think about:
    * Set up: I have a cluster of one 1 admin server with 2 managed servers, which managed server runs an instance of OSB
    * What I try to achieve:
    - use JMX API to collect OSB stats data periodically as in sample code above then save data as a record to a
         database table
    Options/ideas:
    1. Simplest approach: Run the modified version of JMX sample on the Admin Server to save stats data to database
    regularly. I can't see problems with this one ...
    2. Use WLI to schedule the Task of collecting stats data regularly. May be overkill if option 1 above is good for production
    3. Deploy a simple web app on Admin Server, say a simple servlet that displays a simple page to start/stop and configure
    data collection interval for the timer
    What approach would you experts recommend?
    BTW, the caveats os using JMX in http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/jmx_monitoring/concepts.html#wp1095673
    says
         Oracle strongly discourages using this API in a concurrent manner with more than one thread or process. This is because a reset performed in
         one thread or process is not visible to another threads or processes. This caveat also applies to resets performed from the Monitoring Dashboard of
         the Oracle Service Bus Console, as such resets are not visible to this API.
    Under what scenario would I be breaking this rule? I am a little worried about its statement
         discourages using this API in a concurrent manner with more than one thread or process
    Thanks in advance,
    Sam

    Hi Manoj,
    Thanks for getting back. I am afraid configuring aggregation interval from Dashboard doesn't solve problem as I need to collect stats data of endpoint URI or in hourly or daily basis, then output to CSV files so line graphs can be drawn for chosen applications.
    Just for those who may be interested. It's not possible to use SQL to query database tables to extract OSB stats for a specified time period, say 9am - 5pm. I raised a support case already and the response I got back is 'No'.
    That means using JMX API will be the way to go :)
    Has anyone actually done this kind of OSB stats report and care to give some pointers?
    I am thinking of using 7 or 1 days as the aggregation interval set in Dashboard of OSB admin console then collects stats data using JMX(as described in previous link) hourly using WebLogic Server JMX Timer Service as described in
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jmxinst/timer.html instead of Java's Timer class.
    Not sure if this is the best practice.
    Thanks,
    Regards,
    Sam

Maybe you are looking for

  • Cannot enable anywhere access in Server 2012 Essentials R2

    Hi all, I have recently installed & setup Windows Server 2012 Essentials R2 on Lenovo S20. Everything is going great except for Anywhere Access! I previously had Server Essentials 2012 running on a HP Microserver but the hardware desperately needed u

  • REUSE_ALV_GRID_DISPLAY Not Displaying All Rows

    Hi, I am using the FM " REUSE_ALV_GRID_DISPLAY " to display the content of an itab. Before calling the FM, the itab contains 10,170 rows, but the FM is displaying 10,047 rows. This is happening only when number of rows exceed 10,000. In goggle, I hav

  • Extremely slow internet using wifi.

    Hi guys, First post here so be gentle. After a week or so of using Arch I started noticing some strange things happening so far: - Pacman's package list downloading from the repos happens at regular speed (around 700Kb/s), then followed by a 30 secs

  • Wacky error: USB headphone sound crackles in everything BUT mpd.

    Here's a weird error for you all. Though it hasn't come from any recent upgrade or anything I've noticed that the sound output of my 3.5 mm --> USB adapter crackles consistently at a volume loud enough to be annoying, and the odd thing is that this d

  • Keynote for iOS not on my Iphone 5s

    Hey folks Looking at the iPhone 5s on the Apple website it looks like Keynote and pages apps come with the iPhone 5s. Is that right? I don't have them preinstalled and when I look them up on the app store I have to pay for them? Any thought here? Wit