2009-01-23 8 views
1

J'ai des problèmes pour déboguer un script beanshell tout ce que je reçois tout le temps est:Comment faire pour déboguer un script beanshell?

Exception invoquant la méthode de l'objet importé. : at Line: 194: dans le fichier: évaluation inline de: `` import java.lang.reflect.InvocationTargetException; import java.util.Arrays; je . . . '': migrateModels (modèles, apiManager, isSAPRetailImportCondition, isSAPAFSCondition)

Appelée de méthode: initMissingImportSources: à la ligne: -1: dans le fichier:: exception cible: 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) 

Je suis en train de récupérer la trace complète de la pile avec ce code

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

Est-il possible de récupérer l'exception cause?

Merci beaucoup.

Répondre

1

Que faites-vous vraiment "ExceptionUtils.getFullStackTrace()"? Êtes-vous sûr d'imprimer l'exception imbriquée?

1

Merci beaucoup pour la réponse. Oui, le getFullStackTrace provient de la communauté Apache et devrait fonctionner. J'ai trouvé le problème. Le point est ici que je n'ai pas eu le script complet dans un appel de méthode. Ceci est important, seulement alors vous êtes capable de l'entourer d'un essai et de voir l'exception. J'espère que cela aidera aussi les autres à l'avenir. Je vois l'exception maintenant. J'avais plusieurs méthodes qui s'appelaient.

Questions connexes