我在调试 beanshell 脚本时遇到了麻烦,但我一直得到的是:

异常调用导入的对象方法。 :在第 194 行:在文件中:内联评估:``import java.lang.reflect.InvocationTargetException;导入 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));
    }

是否有可能检索导致异常?

非常感谢。

最佳答案

你“ExceptionUtils.getFullStackTrace()”到底在做什么?您确定它正在打印嵌套异常吗?

关于debugging - 如何调试beanshell脚本?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/475025/

10-12 05:54