問題タブ [btrace]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
133 参照

btrace - btrace で、バイト配列を読み取り可能な形式で出力するにはどうすればよいですか?

アノテーションbtraceを使用してメソッド戻り値の byte[] 値を検査するために使用したい。@Return

バイト配列は、実際には utf8 を使用してエンコードされた通常の文字列です。

クラスは以下のようなものです。

試してみprintArrayましたが、Objetc[] のタイプのみを受け入れ、byte[] のタイプでは機能しません。の場合print、'[B@4fbc7b65' のような内部オブジェクト ID を出力するだけです。

問題を解決できる他の方法はありますか?

0 投票する
1 に答える
434 参照

java - 指定されたメソッドが呼び出されたときに、btrace は何も出力しませんでした

btrace の使い方を学んでいます。そのために、次のコードを含む spring-boot プロジェクトを作成しました。

次に、 を使用してプロジェクトを開始し、mvn spring-boot:runその後、次のように btrace スクリプトを作成しました。

ご覧のとおり、このスクリプトはjava.io.File#createNewFileが呼び出されたときに何かを出力する必要があります。これはまさに上記のコントローラーが行うことです。次に、次のコードを使用して、実行中の spring-boot プロジェクトに btrace をアタッチしました。

30716 は、実行中の spring-boot プロジェクトの PID です。次に、にアクセスしてみhttp://localhost:8080/testFileました。実行中の spring-boot プロジェクトから、次のような追加の出力が得られました。

が出力されることを期待していましたNew file is being createdが、そうではありませんでした。なんで?私は何か間違ったことをしましたか?

0 投票する
1 に答える
1156 参照

java - I got an error("Handler dispatch failed; nested exception is java.lang.NoSuchFieldError: runtime") when I tried to trace a spring project using btrace

As I mentioned in the title,I tried to using btrace to trace the execution of a restful api and got this error:"Handler dispatch failed; nested exception is java.lang.NoSuchFieldError: runtime" when I invoked the restful api.And before I start the btrace process,this restful api works well,once I start the btrace process,this restful api keeps throwing the error everytime ths api is called.

some information:

Restful API(java code):

btrace test class code:

I wonder if this has something to do with the btrace version? Hope someone can save me,THANKS!