How to to programmatically create diagnostic profile : Please , Help!

Hi,
I already opened a question about that , but since I got a wrong answer ( I think , or i did something wrong ..) , and , since it is very
important for me :
May I have a full example showing how to create diagnostic profile programmatically ?
I tried many ways to do that , but nothing works !
Among the things i did was ( for example ) , something like this :
DiagnosticProfileBean bean=new DiagnosticProfileBean();
// setting the bean ..
bean.setLatency(latency);
               bean.setThroughput(throughput);
               String profileName="EyalProfile";
               //DataAggregation d;
               bean.setProfileName(profileName);
               bean.setApplicationId("com.oracle.training.jms@defaultserver");
               //bean.setApplicationId("Application");
               bean.setState(true);
               bean.setStageObjectName(this.stageObjectIn);
               bean.setServerId("defaultserver");
.... and so on ..
     try {
          dataServiceName =ObjectName.getInstance("com.bea.wlevs:Name=DataServiceFactory,Type=DataServiceFactory,Application=com.oracle.cep.training.jms");
          //     DataServiceFactoryMBeanImpl dsfmb=     (DataServiceFactoryMBeanImpl) MBeanServerInvocationHandler.newProxyInstance(connection,dataServiceName, "com.bea.wlevs:Name=DataServiceFactory,Type=DataServiceFactory,Application=com.oracle.cep.training.jms", ObjectName.class, false);
          } catch (Exception e) {
     throw new RuntimeException(e);
     DataServiceFactoryMBean dataServiceFactory=null;
     DiagnosticProfileBean bean=new DiagnosticProfileBean();
     try {
          dataServiceFactory=(DataServiceFactoryMBean) MBeanServerInvocationHandler.newProxyInstance(connection, dataServiceName, DataServiceFactoryMBean.class, false);
               // dataServiceFactory=(DataServiceFactoryMBean) MBeanServerInvocationHandler.newProxyInstance(connection, dataServiceName, DataServiceFactoryMBean.class, false);
it all works fine untul now , but when the program runs this :
          dataServiceFactory.createDiagnosticProfileMBean(bean, bean.getServerId());
I got the "InstanceNotFoundException " ..
It seems that the problem related to the connection object , but I'm not sure about it.
The connection was created in 2 different ways , neither of them worked.
1. ..
connector = JMXConnectorFactory.newJMXConnector(serviceUrl, env);
                         connector.connect(env);
                         connection = connector.getMBeanServerConnection();
2.
MBeanServer connection =ManagementFactory.getPlatformMBeanServer();
Does anyone have a clue about it??
Example ( that works ..) will be appriciated !
If someone has anothar way that works, it is OK to.just something to create a profile ..
Again, it very important for me, i'm stuck because of that .
Thanks.

Hi
my project includes many files, but a attached thre relevant parts here :
// connect to server ( like in the examples )
env.put(JMXConnectorFactory.DEFAULT_CLASS_LOADER, com.bea.core.jmx.remote.provider.msarmi.ServerProvider.class.getClassLoader());
                         env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_CLASS_LOADER, com.bea.core.jmx.remote.provider.msarmi.ServerProvider.class.getClassLoader());
                         JMXServiceURL serviceUrl = new JMXServiceURL("MSARMI", "localhost", port, "/jndi/jmxconnector");
                         env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,     "com.bea.core.jmx.remote.provider");
                         System.setProperty("mx4j.remote.resolver.pkgs", "com.bea.core.jmx.remote.resolver");
                         connector = JMXConnectorFactory.newJMXConnector(serviceUrl, env);
                         connector.connect(env);
                         connection = connector.getMBeanServerConnection();
and then :getting MonitorRuntimeMBean object..
monitorMBean = (MonitorRuntimeMBean)MBeanServerInvocationHandler.newProxyInstance(connection, monitorName, MonitorRuntimeMBean.class, false);
and then :
ObjectName thruputObject = monitorMBean.monitorAvgThroughput(stageObjectIn, (new Long(averageThroughputInterval)).longValue(), (new Long(averageThroughputInterval)).longValue());
               ProbeRuntimeMBean probeAvgThroughput = (ProbeRuntimeMBean)MBeanServerInvocationHandler.newProxyInstance(connection, thruputObject, ProbeRuntimeMBean.class, false);
               listener = new AverageThroughputJMXNotificationListener(stageName,connection );
When i done i use:
probeAvgThroughput .terminate();
ofcource , i just cut the relevant parts , but I'm sure that what I'm doing is right.
My question is not about the latency but about AvgThroughput which shows wrong numbers each time i reconnect to thr server .
The numbers get smaller each time i reconnect ( I described it in my previuos post ).
My questions are very simple :
*1. How to add a profile via api ? ( DiagnosticProfile )*
*2.How to get DataAggregationMBean ?*
*3. How to get DataServiceFactoryMBean 'and then use it to add profile?*
PLEASE , I JUST WANT A GOOD EXAMPLE OF DOING THOSE THINGS !!!
If there is no answer to those, just tell me , because it's been to much time trying to figure it out.
Having my code , and asking why do I need this , does not contribute to my quetions ..
I'm sure you ( the oracle company team ) wants to help , but the mosy helpfull help is via GOOD  examples.
Thanks.

Similar Messages

  • How to to programmatically create diagnostic profile ?

    Hi,
    I'm trying to create a diaganostic profile programmatically .
    I didn't see any example like this. My purpose is to create a profile like in the ' Visualizer ' tool.
    I'm trying to use these lines:
    Application a=new ApplicationImpl(myApp);
    DiagnosticProfileManagerImpl diagnosticProfileManagerImpl=new DiagnosticProfileManagerImpl(a);
    probeNames=new ObjectName;
    diagnosticProfileManagerImpl.createDiagnosticProfile(profileName, probeNames);
    I got a NullPointerException .
    Any ideas? examples ?

    Hi again ..
    I think I know where is the problem but I don't know how to solve it:
    i use these lines to make a connection :
         env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,     "com.bea.core.jmx.remote.provider");
                             System.setProperty("mx4j.remote.resolver.pkgs", "com.bea.core.jmx.remote.resolver");
                             connector = JMXConnectorFactory.newJMXConnector(serviceUrl, env);
                             connector.connect(env);
                             connection = connector.getMBeanServerConnection();
    and you suggested to use this :
                             connection=ManagementFactory.getPlatformMBeanServer();
    I think there is inconsistency in the typs of the connection mbean.
    Neither of of them works fine:
    The first one works fine for getting troughput , averageLatency and so on ,
    BUT, when i try to terminate ( unregister from the mbean server ),
    and than re-connect again, the numbers i'm getting are wrong.
    In the second type (ManagementFactory.getPlatformMBeanServer() ) , when I want to use as a profile creator ( like in the 'Visualizer' tool - which works fine )
    I don't know which of the types to use.
    What is your recommendation to to use : for temintinag the probeRuntime, and for making a profile .
    again, neither of them works all the way!
    Plz help.

  • My ebay toolbar and the ebay logo that was in my system tray at the bottom have both disappeared when I installed FireFox??? How do I get them back? Please help.

    my ebay toolbar and the ebay logo that was in my system tray at the bottom have both disappeared when I installed FireFox??? How do I get them back? Please help.

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 
    Regards
    TD 

  • I need to create Buttons dynamically Please Help

    I am currently developing a card game. I represent my cards as buttons. But as the player draws more cards from the deck I have to generate buttons dynamically at run-time. I could use arrays of buttons and store new buttons inside that arrays of buttons. But the only problem is I need ActionListener for each of my buttons. How do you create ActionListener for each different dynamically created buttons? Please Help.

    Here is my code. I just do not understand how to create those functions dynamically that functions different each time.
    Here is my code please take a look.
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class run108{
    JButton setbutton;
    JButton ButtonUp;
    JButton ButtonDeal;     
    JButton slot1;
    JButton slot2;
    JButton slot3;
    JButton slot4;
    JButton slot5;
    JButton slot6;
    JButton slot7;
    cards[] card = new cards[55];
    public static void main(String[] argv)
         run108 startgui = new run108();
         startgui.createframe();     
    void createframe()
         //Standard of way of creating Frame
         JFrame frame = new JFrame("108");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setLocation(300,200);// Tells the startup position;
         //Adding Panels to the framework
         JPanel panelA = new JPanel();
         panelA.setBackground(Color.white);
         panelA.setLayout(new BoxLayout(panelA,BoxLayout.Y_AXIS));
         JPanel panelB = new JPanel();
         JPanel panelC = new JPanel();
         //Adding buttons with card images
         JLabel label1 = new JLabel("       Set of Cards");
         panelA.add(label1);
         ImageIcon pic1 = new ImageIcon("cards/backd.png");
         setbutton = new JButton(pic1);          
        panelA.add(setbutton);
        ImageIcon picdeal = new ImageIcon("cards/deal.png");
         ButtonDeal = new JButton(picdeal);
         panelA.add(BorderLayout.CENTER, ButtonDeal);
        ButtonDeal.addActionListener(new DealListener());
         JLabel label2 = new JLabel("       Your Target");
         panelA.add(label2);
         ButtonUp = new JButton(pic1);          
        panelA.add(BorderLayout.CENTER, ButtonUp);
        frame.add(BorderLayout.WEST,panelA);
        // Adds 7 initial card slots.
         ImageIcon pic2 = new ImageIcon("cards/backc.png");
         slot1 = new JButton(pic2);
        panelB.add(slot1);          
        slot1.addActionListener(new Slot1Listener());
        slot2 = new JButton(pic2);
        panelB.add(slot2);
        slot2.addActionListener(new Slot2Listener());
         slot3 = new JButton(pic2);
        panelB.add(slot3);
        slot3.addActionListener(new Slot3Listener());
         slot4 = new JButton(pic2);
        panelB.add(slot4);
        slot4.addActionListener(new Slot4Listener());
         slot5 = new JButton(pic2);
        panelB.add(slot5);
        slot5.addActionListener(new Slot5Listener());
         slot6 = new JButton(pic2);
        panelB.add(slot6);
        slot6.addActionListener(new Slot6Listener());
         slot7 = new JButton(pic2);
        panelB.add(slot7);
        slot7.addActionListener(new Slot7Listener());
        frame.add(BorderLayout.CENTER,panelB);
        // This has to be added @ the end to show the components
        //that were added after on. If it is placed before the components
        //the components shall not appear since they sit on the frame
         frame.setSize(600,500);
         frame.setVisible(true);
    class DealListener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot1Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot2Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot3Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot4Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot5Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot6Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    class Slot7Listener implements ActionListener
         public void actionPerformed(ActionEvent event){}
    }

  • ITunes wont open for me. it keeps saying "the Disc "untitled playlist" cannot be read. An unknown error occurred (-69)." don't know how to get it to work. Please help

    iTunes wont open for me. it keeps saying "the Disc "untitled playlist" cannot be read. An unknown error occurred (-69)." don't know how to get it to work. Please help

    It is likely a hardware failure
    http://support.apple.com/kb/TS3694?viewlocale=en_US#error1

  • TS4605 Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Well, iCloud has nothing to do with this.
    Do you have the built-in backup function Time Machine running on your Mac?
    See: http://support.apple.com/kb/ht1427

  • I recently bought a dbx hardware compressor and am not quite sure how to use it in logic express 9. I hav a focusrite saffire 6 usb audio interface and am not dont how to use it in logic. Please help???

    I recently bought a dbx hardware compressor and am not quite sure how to use it in logic express 9. I hav a focusrite saffire 6 usb audio interface and am not dont how to use it in logic. Please help???

    MUYconfundido wrote:
    Pancenter,
    Thanks for the response, but I do not have a midi interface. I am using a midi to usb connector cable, thus bypassing the need for a Midi interface.
    The Mac reads the USB cable as a midi device, but not the keyboard that I am trying to use as a controller. I have tried it with my korg sp 300 and with my Nord Electro 2.
    Thoughts?
    Thanks,
    Tristan
    Tristan...
    This is what you have, correct?
    http://www.alesis.com/usbmidicable
    This from Alesis..
    "The AudioLink Series USB cable receives and outputs MIDI signal thanks to its internal interface. The USB-MIDI Cable connects plug-and-play to your Mac or PC for an all-in-one USB-MIDI solution."
    Notice, -internal interface-. What you have is a simple USB MIDI Interface. Most MIDI interfaces are USB.
    My point is (was), MIDI OUT of the Korg goes to the connector marked MIDI IN on the Alesis, those new to MIDI often get this wrong.
    pancenter-

  • I just updated my iPod touch and all my pictures are gone!!! How do I get them back? Please help!!!

    I just updated my iPod touch 4th generation to iOS 6.0.1 and all my pictures are gone!!! Everything else is there but my pictures! How do I get them back? Please help!!!

    If the photos were i your iPod's Camera Roll album (taken by or saved to the iPod you can:
    - If your PhotoStream is on you can get the last 30 days worth back. See that topic here:
    iOS: Importing personal photos and videos from iOS devices to your computer
    - Or you can restore from backup if you backed up when the photos were on the iPod.
    If the photos were synced to the iPod then you have to get them from where you got them the first time.

  • I accidentally remove 'Profile' Please help me to recover

    Name: iPhone
    Software Version: 5.0.1
    S/N: JF133K88DZZ
    I accidentally remove the 'Profile' please help me to recover.

    I have the same problem as above. I have also tried answering the security question, which is my birthdate, but I am getting the following error message " The authentication information provided does not match our records. Please verify your personal information and try again".
    I have checked everywhere to get the "sent message" as well. Please help me to get back my old Apple ID!

  • How to acess Database in I18N? Please help.

    How to acess Database in I18N? Please help.

    I have tried to overide the getContents() method of ListResourceBundle class but it returning an error at run time saying null Pointer exception.
    Here are the 2 codes resp.
    import java.util.*;
    public class Test1
         static String string ;
         public static void main(String args[])
    Locale locale = Locale.ENGLISH;
    ResourceBundle myResources =
    ResourceBundle.getBundle("MyResources", locale);
    string = myResources.getString("HelpKey");
    System.out.println(string);
    import java.util.*;
    import java.sql.*;
    public class MyResources extends ListResourceBundle
         static String[][] s3= null;
    String s6= null;
         String s7= null;
    public Object[][] getContents()
    Object[][] obj= (Object[][])dataBase();
              for(int i= 0; i< obj.length;++i){
                   for(int j = 0;j<obj.length;++j){
                        System.out.println("GGGGGGGG obj["+i+"]["+j+"]"+obj[i][j]);
              //s6=(String)obj[0][0];
         //     s6= obj[0][0].toString();
              //s7=obj[1][0].toString();
    Object[][] contents = { {s6},{s7}};
         return contents;
         private static String[][] dataBase()
         {           try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection con=DriverManager.getConnection("jdbc:odbc:DSN");
                   PreparedStatement stat= con.prepareStatement("Select Value,Key from Table1 where Key= ?");
                   String s1= "HelpKey";
                   stat.setString(1,s1);
                   ResultSet rs= stat.executeQuery();
                   while(rs.next())
                        String s2= (String)rs.getString("Key");
                        String s4= (String)rs.getString("Value");
                        String[][] s3 ={{s2},{s4}};
              catch(Exception e)
              e.printStackTrace();
         return s3;

  • HT1386 I have been trying to sync my iPhone and its not syncing. I've synced it before but now it has gone away. How can I re-sync it? Please help.

    I have been trying to sync my iPhone and its not syncing. I've synced it before but now it has gone away. How can I re-sync it? Please help.

    you did enable Music syncing in iTunes, yes?

  • How do I get PBS again?  Please help!!!

    I was able to get PBS when I first got Apple TV after putting in a code, but my cable company recently changed their channel lineup, and I can no longer get PBS on Apple TV.  I used to get PBS on channel 314 on my TV, but after speaking with my cable company, I now get it on channel 198, but I can't get anything at PBS on Apple TV. All I get when I go there is the "downloading circle" and nothing happens.  The cable company can't help, and I've written to PBS several times with no reply.  I thought maybe I could get a different code and start over, but I don't know how to do that.  Can anyone help, please.  PBS is one
    of the main reasons I bought Apple TV.  Thanks. 

    I don't know who vaszandrew is, but I (diamond2277) wrote How do I get PBS again?  Please help!!! 
    It got printed and I lost my page so I started over again, and the one above with my question showed             (dated May 2, 9:56 am) as if it were an answer to vasndrew.
    After I wrote, it occurred to me that maybe if I disconnect my Apple TV and reconnect it, I will get PBS, and it worked.  Now I don't need an answer.  Thanks to anyone who was going to answer!  I have to remember my usual answer to technical problems, UNPLUG, AND START AGAIN.

  • My iphone 4 screen turns into blue, and i can't do anything because my power button is broken. How to fix my iphone back? Please help me

    my iphone 4 screen turns into blue, and i can't do anything because my power button is broken. How to fix my iphone back? Please help me

    I am having the SAME exact problem! Except instead of lock button broken it's my home button so I can't do the whole "put in recovery mode" deal. My screen only says "tap the home button 3 times" and it has my screen locked until I hit the home button but since it is broken I can't get in my phone at all. I have all of my work info in my phone so I'm screwed and can't get any help. PLEASE let me know if you find a way around this...!!!
    Thanks!

  • TS3694 How do i fix error 3194? please help!

    How do i fix error 3194? please help!

    iOS of your iPhone could be modified / hacked. No one will be able to support you in this Forum.

  • My Ipod doesen't work when I try to connect it on my iTunes! How can I solve this problem? Please help me

    My Ipod doesen't work when I try to connect it on my iTunes! How can I solve this problem? Please help me

    Itunes doesen't see the ipod and it is all dark!

Maybe you are looking for