在stackoverflow中有這樣一句話: The reflection layer wraps any exception in an InvocationTargetException
, which lets you tell the difference between an exception actually caused by a failure in the reflection call (maybe your argument list wasn't valid, for example) and a failure within the method called
翻譯一下就是: 反射層將所有的異常都包裝在一個InvocationTargetException 中,能使你區分異常的實際上是反射層的引起的一個調用失敗(例如參數列表無效)和調用方法內部的錯誤
大概意思就是這樣,嗯*~*
所以,我查看了invoke參數和調用的方法的參數是否一致,發現一致后,再檢查調用方法內部,有個空指針異常(比較低級的錯誤。。)
問題解決。bingo~