[Soot-list] class resolving problem

Jochen Huck jochen.huck at student.kit.edu
Fri Nov 12 07:34:45 EST 2010


Hi,

I've got a problem with soots class resolver. Runnig my analysis I get 
following Exception:

    Exception in thread "main" java.lang.RuntimeException: This
    operation requires resolving level BODIES but
    org.apache.lucene.store.FSIndexInput is at resolving level SIGNATURES
    If you are extending Soot, try to add the following call before
    calling soot.Main.main(..):
    Scene.v().addBasicClass(org.apache.lucene.store.FSIndexInput,BODIES);


I can solve the problem for this class adding (1) 
Scene.v().addBasicClass("org.apache.lucene.store.FSIndexInput", 
SootClass.BODIES); before calling soot.Main.main(...) (I run soot in 
whole-program mode already)

The thing is that after inserting the code line above soot will complain 
about another RuntimeException for another class. If I add code to solve 
the problem for this class it will find another one and so on.
I want to write a script that runs the analysis for many projects and 
therefore it is very annoying to insert code by hand waiting for the 
next error and again doing the same thing for the next error and so on. 
I already read https://svn.sable.mcgill.ca/wiki/index.cgi/ClassResolver 
and so i decided to write a loop that adds all the classes (with 
statements like (1)) found in the projects bin directory. Then no 
RuntimeException occurs but I get another Exception:

         Exception in thread "main" java.lang.NullPointerException
         at 
soot.JastAddInitialResolver.resolveFromJavaFile(JastAddInitialResolver.java:103)
         at soot.JavaClassSource.resolve(JavaClassSource.java:57)
         at soot.SootResolver.bringToHierarchy(SootResolver.java:194)
         at soot.SootResolver.bringToSignatures(SootResolver.java:219)
         at soot.SootResolver.bringToBodies(SootResolver.java:260)
         at soot.SootResolver.processResolveWorklist(SootResolver.java:135)
         at soot.SootResolver.resolveClass(SootResolver.java:124)
         at soot.Scene.tryLoadClass(Scene.java:394)
         at soot.Scene.loadBasicClasses(Scene.java:959)
         at soot.Scene.loadNecessaryClasses(Scene.java:1018)
         at soot.Main.run(Main.java:167)
         at soot.Main.main(Main.java:141)
         at analysis.MainAnalysis.main(MainAnalysis.java:35)
         at test.ToolChain.main(ToolChain.java:118)
         at test.ToolChainExample.main(ToolChainExample.java:36)

Any advice how to solve this?

Thanks,

Jochen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20101112/54be2bba/attachment.html 


More information about the Soot-list mailing list