9 Replies Latest reply on Nov 27, 2013 10:28 AM by user601671

    Running Java app with custom javaagent and enable flight recorder throws NullPointerException

    user601671

      Java application (Running two thread with client and server socket read\write calls) with custom java agent (custonAgent.jar) (Getting the class bytes and writing bytes to disk using FileOutputStream in ClassFileTransformer 's transform method) and enable the flight recorder with -XX:+UnlockCommercialFeatures -XX:+FlightRecorder throws the java.lang.NullPointerException at oracle.jrockit.jfr.jdkevents.IoTracer.fileWriteBegin(IoTracer.java:260)”.

       

      Execute the Appliction with -javaagent (E.g. java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder -javaagent:C:\test\SampleAgent.jar <Main Class name>)

       

      java.lang.NullPointerException

      at oracle.jrockit.jfr.jdkevents.IoTracer.fileWriteBegin(IoTracer.java:260)

      at sun.misc.IoTrace.fileWriteBegin(Unknown Source)

      at java.io.FileOutputStream.write(FileOutputStream.java:342)

      at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)

      at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:282)

      at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:125)

      at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:135)

      at java.io.OutputStreamWriter.write(OutputStreamWriter.java:220)

      at java.io.PrintWriter.write(PrintWriter.java:456)

      at java.io.PrintWriter.write(PrintWriter.java:473)

      at java.io.PrintWriter.print(PrintWriter.java:603)

      at java.io.PrintWriter.println(PrintWriter.java:739)

      .......

      at java.lang.Thread.run(Thread.java:744)