Parsing jrockit flight recorder files programmatically

Hi all,
i am trying to develop a small/custom application to process the .jfr files from multiple jrockit JVM (the JRMC is not friendly enough
when processing multiple files and can't automate some typical issue/problem checking)
i refer to the API document here: http://docs.oracle.com/cd/E15289_01/apirefs.40/e26998/com/jrockit/mc/flightrecorder/FlightRecording.html
e.g.
FlightRecording recording = FlightRecording.createFromFile(new File("path_to_recording.jfr"));
//more code below
i add several .jar files in the classpath (jars in folder missioncontrol/plugins) for compilation.
When i try to run the application, i get the following error.
can anybody help to show me how to setup the environment/classpath so as to run an application for reading the .jfr file?
thank you.
Begin task: Starting reading eventsReading chunk
Parsing events
java.lang.ExceptionInInitializerError
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
     at java.lang.Class.newInstance0(Class.java:355)
     at java.lang.Class.newInstance(Class.java:308)
     at com.jrockit.mc.flightrecorder.provider.bcel.BCELUtilities.createEventClassLoader(BCELUtilities.java:37)
     at com.jrockit.mc.flightrecorder.provider.EventType.<clinit>(EventType.java:45)
     at com.jrockit.mc.flightrecorder.provider.Producer.createEventType(Producer.java:99)
     at com.jrockit.mc.flightrecorder.internal.parser.synthetic.EventTypeFactory.create(EventTypeFactory.java:29)
     at com.jrockit.mc.flightrecorder.internal.parser.synthetic.ProducerFactory.create(ProducerFactory.java:135)
     at com.jrockit.mc.flightrecorder.internal.parser.synthetic.ProducerFactory.createProducers(ProducerFactory.java:101)
     at com.jrockit.mc.flightrecorder.internal.parser.binary.MetadataParser.read(MetadataParser.java:37)
     at com.jrockit.mc.flightrecorder.internal.parser.binary.MainParser.read(MainParser.java:70)
     at com.jrockit.mc.flightrecorder.internal.parser.binary.MainParser.read(MainParser.java:49)
     at com.jrockit.mc.flightrecorder.provider.RepositoryBuilder.createRepository(RepositoryBuilder.java:63)
     at com.jrockit.mc.flightrecorder.provider.RepositoryBuilder.build(RepositoryBuilder.java:52)
     at com.jrockit.mc.flightrecorder.internal.JRockitFileProvider.createRepositoryFromFile(JRockitFileProvider.java:26)
     at com.jrockit.mc.flightrecorder.spi.FileProvider.createRepository(FileProvider.java:43)
     at com.jrockit.mc.flightrecorder.FlightRecording.<init>(FlightRecording.java:69)
     at com.jrockit.mc.flightrecorder.FlightRecording.createFromFile(FlightRecording.java:108)
     at test.FileParser.main(FileParser.java:18)
Caused by: java.lang.NullPointerException
     at com.sun.org.apache.bcel.internal.classfile.ClassParser.<init>(ClassParser.java:101)
     at com.jrockit.mc.flightrecorder.provider.bcel.Repository.lookupClass(Repository.java:34)
     at com.jrockit.mc.flightrecorder.provider.bcel.EventClassLoader.<clinit>(EventClassLoader.java:52)
     ... 22 more
Edited by: user12050693 on Nov 15, 2012 1:10 AM

I had the same problem today, so I went deeper and found out that there's a problem in retrieving the resource stream, it can be overridden by loading your class (and all reflected JRockit classes) with class loader like this:
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
public class CorrectedClassLoader extends URLClassLoader {
    public CorrectedClassLoader(URL[] urls, ClassLoader parent) {
        super(urls, parent);
    public CorrectedClassLoader(URL[] urls) {
        super(urls);
    @Override
    public InputStream getResourceAsStream(String name) {
        InputStream is = super.getResourceAsStream(name);
        if (is == null && name.startsWith("/")) {
            name = name.substring(1);
            is = super.getResourceAsStream(name);
        return is;
I don't know why the system class loader won't find the resources with "/" prefix but this solved my problem.

Similar Messages

  • APIs for Parsing JRA Recording Files (Any documentation?)

    Hi,
    I have a JRF recording file with me and using which i need to generate custom report using any scripting language like PERL or Ruby etc without using JRocket Mission Control. here in my custom script i can use any APIs provided by JRocket to parse JRA recording file and get different statistics data.
    So here i want to know what all APIs does JRockit provides for parsing JRA recordings and getting different statistics data from JRF recordings which can be consumed by some other scripting language and NOT through JRockit Mission Control.
    Please share any documentation link or document having detail of available APIs from JRockit for parsing JRA recordings and getting different statistics data.
    Thanks,
    Piyush

    Just in addition to my previous comment.
    I have JRA flight recording files with me for parsing.
    Thanks,
    Piyush

  • Error parsing recording file

    Hi,
    I am trying to open JRockit recorded xml file with JRA tool. Getting message ' Error parsing recording file'.
    Thanks
    ranga

    For older versions of JRockit, you had to use exactly the same version of JRockit when you created the recording as when you opened it.
    With more recent versions (R26.0 and later iirc) it is sufficient if the JRA reader version is >= the version of JRockit producing the recording. Or in other words, make sure you are running the latest version of JRockit on your developer workstation.
    -- Henrik

  • Trying to read a recorded file that display the x-axis recorded time stamp?

    How do I read a recorded file with (XY) data, meaning I want to plot the x-time recorded data and be able to scroll back and forth.

    Hi Gina,
    If I understand your question correctly, it sounds like you are trying to plot some data that you have saved in a file. I am assuming that this data is in the form of X and Y values.
    If this is correct, the easiest solution would be to use an XY-Graph in LabVIEW. I would start by using LabVIEW's File I/O VIs to load the data into an array or even a string indicator. You can then parse the data that you need and separate it into two arrays, one for X values and one for Y values. You can then bundle these two arrays together and feed the resulting cluster into an XY-Graph.
    I have attached an example that may help to point you in the right direction when it comes to the actual programming.
    I hope this helps!
    Matthew C
    Applications E
    ngineer
    National Instruments
    Attachments:
    Example.zip ‏61 KB

  • Parsing Huge Fixed length files

    Hi All,
    I have a requirement to parse a fixed lenght file which is of size 100MB. I have 1.7 million records in that file where each and every record is of length 41. When I am trying to load the file using the LineNumberReader and using the substring it's throwing java.lang.OutMemoryError. I tried with the -Xmx1500M, it's the same. I am also using the reflection API to populate the java beans with the parsed values.
    I am thinking a way that I read a chunk of data from the file and parse it, read the next chunk parse it etc... Is there a way like this in java 1.5 or 1.6? I heared about the nio package in JDK1.5. I am looking at it If that can helpful to me.
    If any body have an idea or best practice how can we deal huge fixed lenght files in java, please suggest me.
    Thank you.

    krishna2581 wrote:
    I realised that I forgot to mention few points thats why reposted any problem with that?The problem is that if I see only one of your posts, and somebody else sees only the other one, we may end up wasting time duplicating each others' work in answering you. Either continue in your original thread--edit the first post if nobody has replied--or if you must start a new thread, provide a link to it from the original so that the discussion is all in one place.

  • Blocked thread with no events does not show up in Flight Recording

    When there is no event in a thread and the thread is blocked during the entire duration of a flight recording, the thread does not show up in the flight recording. How to check the state of such a thread from the flight recording?

    Hi,
    I am not sure I understand the question correctly, but events (like Java Blocked) are only saved to file when the thread is not longer blocked. So if you have an event that goes on during the whole recording it won't show up. It's a known limitation of flight recorder.
    If you are really desperate to find out the state of the thread you could look at the Method Profiling events that samples the thread.
    1) In the Event Types remove all the events that are checked.
    2) Check the Method Profiling Sample.
    3) Go to Events-> Threads. Select the thread you are interested in
    4) Right click and select Operative Set -> Set Selection
    5) Go to Events -> Log and check Show only Operative Set
    6) Click on an event in the log and look at Event Attributes below. There is a field called Thread State which will tell you the state thread.
    That's the best that you could do.
    Erik

  • Enable Flight Recorder

    Hello,
    I am searching for the solution of the below warning where it is not clear to me, where exactly the parameter should be stored.
    in Step 6.3.4 "Enable Flight Recorder" I don't know where the lines should be stored in (path/file)
    jstartup/recorder = java -classpath ../j2ee/cluster/bootstrap/launcher.jar
    com.sap.engine.offline.OfflineToolStart com.sap.engine.flightrecorder.core.Collector
    ../j2ee/cluster/bootstrap -node %nodeID% %startTime% -bz $(DIR_GLOBAL) –exitcode
    %exitcode%
    Error description in setup wizard in SMD:
    The profile parameter jstartup/recorder could not be checked in the Java profile of <host>/<SID>/<abap instance number> [CI] (full host name)
    Any hint will be highly appreciated.
    Thank you in advance,
    Best regards,
    Rastislav

    Thank you for answer,
    Just to be correct, does it has to be visible via RZ10 or only on OS level in file for the J2EE Instance profile, because by the setup wizard in SMD it is looking for the instance profile XX and by the name its looking for the ABAP instance profile, where this parameter is already stored (only on OS level, not visible through SAP).
    Thanks,
    Rastislav

  • Activate flight recorder

    Hello,
    I'm configuring solution manager (SOLMAN_SETUP) and in the step activate flight recorder, the customizong documentation says:
    Use
    On the managed system the flight recorder needs to be enabled by adding a parameter to the J2EE instance profile.
    Requirements
    The managed system is a J2EE based system or a dual stack with ABAB and Java. Skip this check in all other cases.
    Default Settings
    Activities
    Set the following profile parameter:
    jstartup/recorder = java -classpath ../j2ee/cluster/bootstrap/launcher.jar com.sap.engine.offline.OfflineToolStart com.sap.engine.flightrecorder.core.Collector ../j2ee/cluster/bootstrap -node %nodeID% %startTime% -bz $(DIR_GLOBAL) u2013exitcode %exitcode%
    On a dual stack system you can use transaction RZ10 to maintain the profile parameter, on a J2EE only system you need to enter the parameter manually to the J2EE instance profile in the file system.
    Attention: As this parameter exceeds one line in transaction RZ10, please ensure the line breaks and that no additional characters (like a space) are added to the parameter when you insert the string.
    The problem is that the system is not a dual stack, it is only ABAP, and I have installed the Diagnostic agent DAA. So, how can I add the profile parameter? How do I add the parameter in the J2EE instance profile if there isn't a Java instance?

    Hi,
    You can get an overview about flight recorder from the below link:
    http://help.sap.com/saphelp_sm32/helpdata/de/56/a945412c98f323e10000000a155106/content.htm
    For more details, you might be intersted  in reading about E2E Exception Analysis documents or SAP Course E2E100.
    Rajeev

  • SolMan Diagnotics - Flight Recorder

    For the setup of the Root Cause Analysis in SolMan Diagnostics, we need to "enable Flight Recorder" by
    adding "jstartup/recorder = ..." to the instance profile of the managed system.
    No issue with doing this BUT does anyone have an insight into what the "Flight Recorder" is?   And where we can see any of its results in the SMD?
    We've searched all over the place and can't find any background info.
    TIA ... Bart

    The Flight Recorder is used in the analysis of system shutdowns.
    It contains all the startup framework log files from the instance's work folder as well as the work folder of the message server and enqueue server. It also collects the default traces from all nodes so can be useful in analysis of issues relating to EP, BI or other J2EE web based apps

  • Enable Flight Recorder During Wily Install&Config

    Dear Experts,
    for the installation of the wily e2e tools we follow the "root cause analysis installation and upgrade guide".
    In Step 6.3.4 "Enable Flight Recorder" we don't know where to put these lines in.
    @ "Config Tool -> Instance -> Parameters" doesn't work...
    Its not clear too, if those 4 lines are 1 parameter or not?!
    Unfortunately it's not described very well. Can anyone help us?
    Thx a lot...
    EDIT Was already standing in the instance.properties file...
    Edited by: Timm Funke on Feb 7, 2008 3:19 PM

    I am facing the exact same issue.  Can anyone tell me where i should set up the jstarup/recorder parameter?
    I will appreciate your help.
    Thank you.

  • Diffrence between JRA recording and Flight recording?

    The latest jrockit has two recording options JRA and Flight recording. What is the difference?
    Thanks
    Manoj

    Hi Manoj,
    In the latest version (R28.x) you can only make flight recordings. JRA was the predecessor to Flight Recorder, used by R27.x and earlier releases.
    The main differences are
    * Flight Recorder can always be turned on (and we recommend you have it on) so you can flush the last x minutes of data to disk when you run into problems.
    * Flight Recorder can record information higher up in the stack, e.g database qúeries, EJB calls, webservices etc
    * Flight Recorder has more information about the JVM, e.g exception profiling and more detailed GC-data.
    * Flight Recorder has less overhead (<1% with the default settings) and there are more ways to configure it so you only record what you need.
    * Flight Recorder has a better GUI for viewing the recorded data, a GUI that is continously improved upon.
    Best regards
    Erik

  • UCCX: Silent monitoring is not working and recorded file is also not playing

    Hi,
    Running UCM 8.5 cluster with UCCX 8.5.
    In CSD, silent monitoring is not working.
    Windows XP OS is running on supervisor desktop. when i select the agent
    then the silent monitoring icon will highlighted once i click on the icon,
    after 5-7 seconds i am getting an error "Silent monitoring session has
    failed".
    Not able to playback the recorded files:
    I can able to record and the file size is 2.6mb for approximate 3min
    recording.When i tried to play from supervisor record viewer it is playing
    but no voice is coming. And i downloaded using play & save option and
    tried to play the .wav file but i can't hear any voice.
    Problem is while playing back the recorded file. I can able to see the
    recorded files in the UCCX.
    Please help me out!!!
    Thanks & Regards,
    Krishna

    It's likely the same problem: CAD is not forwarding packets to CSD or the CCX recording service. Two common causes for this are:
    The phone is not spanning to the PC port or does not allow PC Port VLAN Access. Change these options to true on the phone's configuration in CUCM.
    The NIC of the agent's PC running CAD is not processing 802.1q-tagged Ethernet frames. It must not drop these and pass them into the Windows NDIS stack for CAD to get them. Google is your friend here; this commonly requires registry changes to make the NIC process the packets.

  • How to create a New Excel File programmatically

    Hi !
    I am documenting acquired data continuously in an excel file, what I need to do is to create a new excel file automatically when the size of the previous file exceeds a certain limit lets say 1MB.
    I have tried using the simple 'Create/Open File' function and the 'Write to Spreadsheet File' function to create the new excel file. I does create a file but when I open the file it says the format of the file is not what you have opened it with.
    Also when the new file is created, three new worksheet are to be added programmatically with pre-defined worksheet name and also Column headers for each of the worksheet are to be added.
    I am also using 'Labview Report Generation Toolkit for Office'.
    Regards,
    Reeves
    Solved!
    Go to Solution.

    @ Aldo A
    Thanks for the reference to tutorial, I didn't know about them. They are useful in general but unfortunately they don't answer the problem of creating an altogether new excel file programmatically.
    @ ben64
    The template thing simplifies the issue of formatting the new file. But I am still working on the new excel file creation challenge.
    Let me put my problem in a different way.
    Certain data is being acquired continually and is being written to a certain excel file, when the size of the file exceeds lets say 1MB the program should start saving the data in a NEW FILE instead of the previous file.
    I have attached the VI to explain what I am trying to achieve here.
    Reeves
    Attachments:
    New Microsoft Office Excel Worksheet.zip ‏30 KB

  • How can i transfer the radio recording files from my Ipad to Computer

    how can i transfer the radio recording files from my Ipad to Computer ?

    I was hopeful I could use home sharing to sync my iTunes libraries,
    Unfortunately, you can only stream content to your iOS devices via home sharing (not sync it).
    I'd have a check through the following user tip instead:
    Recovering your iTunes library from your iPod or iOS device

  • Recorded Files extracted from UCCX 8.5 using sftp is only 1Kb

    Hi All,
    I have configured CCX agent recording using Cisco Desktop Workflow Administrator. When I am making calls to the agent I can see the files getting created on the server. I am also able to view these files on the Supervisor Record Viewer.
    The downloaded files are in RAW format and are of 1Kb in size. When I try to convert these RAW files to WAV, it gives an error that the recording file is empty. I have also tried to save these files in WAV using the Supervisor Record viewer. The files can be opened using a media player but I am not able to hear anything. The WAV shows the right audio duration as well.
    Please reply with your valuable suggestions.
    Thank you.
    Joseph Chirayath.

    OK - I don't see any packets except broadcast/mcast in that capture that aren't too or from your PC.
    What vendor/model NIC is this? It may not be enabled for promiscuous monitoring.
    Also do you definately have the PC plugged into the PC port of the phone for network access? You said 'I spanned the ports and ran wireshark.', but you don't need to SPAN anything for this; the phone should send copies of it's packets out the PC port and your PC should see them in the capture.
    And have you reset the phone since span/voice vlan access were enabled (if this was done recently)
    Aaron

Maybe you are looking for

  • In iTunes  a bunch of songs show up under the wrong artist no matter what I do

    My iTunes library has an odd glitch - there's a bunch of songs that show up under the group "a-ha" despite having nothing to do with a-ha. They don't seem to have anything else in common, either. None of them has an album artist listed and they are a

  • How do I change default page that appears after a bad/malformed URL?

    First of all, this is not a traditional malware/adware issue. Whenever I enter a malformed or bad URL, like http://blah, Firefox defaults to the homepage of my spouse's old workplace (a large, corporate law firm). While this is a personal computer, a

  • Web page links do not work

    When I click on a hyperlink on a web page nothing happens. In fact I'm have to use the Safari browser to send this query.

  • Who has Office 2003 installed? Need your help

    http://bugs.winehq.org/show_bug.cgi?id=25460 In Word/Excel File->Properties dialog. When I type something in a text box and press TAB, the next text box becomes active (as expected). But before that the tab symbol is inserted into the first text box.

  • Hey...help me out

    hey i am running the following code if(o==b2) fbalance.setVisible(true); fwelcome.setVisible(false); if(o==b8) String stracc=tacc.getText(); String strid=tid.getText(); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getCo