2010-11-20 6 views
0

Ich verwende BTrace 1.2 und folgte Benutzerhandbuch von BTrace website. Ich habe keine Probleme mit BTRACE auf Programme mit Befehl:NullPointerException beim Starten einer Anwendung mit BTrace Agent

btrace <pid> AllMethods.class 

aber wenn ich versuche Anwendung zu starten mit BTRACE Mittel entweder:

java -javaagent:btrace-agent.jar=noServer=true,debug=true,script=AllMethods.class,scriptOutputFile=out.trace test/Test 

oder

btracer AllMethods.class test/Test 

ich NullPointerException auf SimpleFileOutput:

btrace DEBUG: debugMode is true 
btrace DEBUG: unsafeMode is false 
btrace DEBUG: dumpClasses is false 
btrace DEBUG: stdout is false 
btrace DEBUG: probe descriptor path is . 
btrace DEBUG: initial script is AllMethods.class 
btrace DEBUG: scriptOutputFile not specified. defaulting to AllMethods.class.btrace 
btrace DEBUG: java.lang.NullPointerException 
java.lang.NullPointerException 
at com.sun.btrace.agent.TraceOutputWriter$SimpleFileOutput.<init>(TraceOutputWriter.java:46) 
at com.sun.btrace.agent.TraceOutputWriter.fileWriter(TraceOutputWriter.java:185) 
at com.sun.btrace.agent.Main.loadBTraceScript(Main.java:334) 
at com.sun.btrace.agent.Main.parseArgs(Main.java:267) 
at com.sun.btrace.agent.Main.main(Main.java:117) 
at com.sun.btrace.agent.Main.premain(Main.java:101) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:323) 
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338) 
btrace DEBUG: parsed command line arguments 
btrace DEBUG: noServer is true, server not started 

Ich habe BTRACE_HOME Pfad konfiguriert. Vermisse ich einen Trick? Ich habe auch mit Release 1.1.3 versucht, ohne Glück.

Bitte helfen.


EDIT Wenn ich debug=false und stdout=true gesetzt und von scriptOutputFile=out.trace Ausgabe Konsole loszuwerden funktioniert gut.

Antwort

1

Es stellt sich heraus, der Pfad zu scriptOutputFile muss absolut sein, so dass scriptOutputFile=out.trace zu scriptOutputFile=./out.trace das Problem behoben.

Verwandte Themen