2009-01-23 35 views
1

我有麻煩調試一個beanshell腳本,我所有的時間都是:如何調試一個beanshell腳本?

異常調用導入的對象方法。 :在行:194:在文件中:內聯評估:import java.lang.reflect.InvocationTargetException; import java.util.Arrays;一世 。 。 。 '':migrateModels(機型,apiManager,isSAPRetailImportCondition,isSAPAFSCondition)

從方法調用:initMissingImportSources:在行:-1:在文件: 目標異常:java.lang.reflect.InvocationTargetException

at bsh.BshMethod.invoke(Unknown Source) 
at bsh.BshMethod.invoke(Unknown Source) 
at bsh.Name.invokeLocalMethod(Unknown Source) 
at bsh.Name.invokeMethod(Unknown Source) 
at bsh.BSHMethodInvocation.eval(Unknown Source) 
at bsh.BSHPrimaryExpression.eval(Unknown Source) 
at bsh.BSHPrimaryExpression.eval(Unknown Source) 
at bsh.BSHBlock.evalBlock(Unknown Source) 
at bsh.BSHBlock.eval(Unknown Source) 
at bsh.BshMethod.invokeImpl(Unknown Source) 
at bsh.BshMethod.invoke(Unknown Source) 
at bsh.BshMethod.invoke(Unknown Source) 
at bsh.This.invokeMethod(Unknown Source) 
at ImportSourceMigration.initMissingImportSources(BeanShell Generated via ASM (www.objectweb.org)) 
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:585) 
at bsh.Reflect.invokeMethod(Unknown Source) 
at bsh.Reflect.invokeObjectMethod(Unknown Source) 
at bsh.Name.invokeMethod(Unknown Source) 
at bsh.BSHMethodInvocation.eval(Unknown Source) 
at bsh.BSHPrimaryExpression.eval(Unknown Source) 
at bsh.BSHPrimaryExpression.eval(Unknown Source) 
at bsh.BSHBlock.evalBlock(Unknown Source) 
at bsh.BSHBlock.eval(Unknown Source) 
at bsh.BSHBlock.eval(Unknown Source) 
at bsh.BSHTryStatement.eval(Unknown Source) 
at bsh.Interpreter.eval(Unknown Source) 
at bsh.Interpreter.eval(Unknown Source) 
at bsh.Interpreter.eval(Unknown Source) 
at bsh.servlet.BshServlet.evalScript(Unknown Source) 
at bsh.servlet.BshServlet.doGet(Unknown Source) 

我想使用此代碼

try { 
     migration.initMissingImportSources(); 
    } catch (java.lang.Throwable e) { 
     print(ExceptionUtils.getFullStackTrace(e)); 
    } 

有檢索導致異常的可能性檢索完整的堆棧跟蹤?

非常感謝。

回答

1

你是什麼「ExceptionUtils.getFullStackTrace()」真的在做什麼?你確定它正在打印嵌套異常嗎?

1

非常感謝您的回覆。是的,getFullStackTrace來自Apache公共應用程序,並應該工作。我發現了這個問題。重點是在這裏,我沒有在一個方法調用完整的腳本。這很重要,只有這樣你才能用try catch包圍它並查看異常。希望對未來的其他人也有所幫助。我現在看到了這個例外。我有幾種方法互相呼叫。

相關問題