soot-oss / soot

Soot - A Java optimization framework
GNU Lesser General Public License v2.1
2.85k stars 705 forks source link

soot.SootResolver$SootClassNotFoundException when ... #1859

Open lvyahui8 opened 2 years ago

lvyahui8 commented 2 years ago

Steps to reproduce: 1.) ...

Files used to reproduce: ...

Soot version:

trunk

Command line:

-w -cp D:\work\http-proxy\test-server\lib -pp -process-dir D:\work\http-proxy\test-server\lib -process-jar-dir D:\work\http-proxy\test-server\lib -main-class org.lyh.http.proxy.client.TestClientApp org.lyh.http.proxy.client.TestClientApp

Max Memory:

3499MB

Stack trace:

soot.SootResolver$SootClassNotFoundException: couldn't find class: org.lyh.http.proxy.client.TestClientApp (is your soot-class-path set properly?)
    at soot.SootResolver.bringToHierarchyUnchecked(SootResolver.java:264)
    at soot.SootResolver.bringToHierarchy(SootResolver.java:240)
    at soot.SootResolver.bringToSignatures(SootResolver.java:310)
    at soot.SootResolver.bringToBodies(SootResolver.java:350)
    at soot.SootResolver.processResolveWorklist(SootResolver.java:187)
    at soot.SootResolver.resolveClass(SootResolver.java:152)
    at soot.Scene.loadClass(Scene.java:1004)
    at soot.Scene.loadClassAndSupport(Scene.java:991)
    at soot.Scene.loadNecessaryClass(Scene.java:1796)
    at soot.Scene.loadNecessaryClasses(Scene.java:1808)
    at soot.Main.run(Main.java:254)
    at soot.Main.main(Main.java:142)
    at io.github.lvyahui8.owlet.SootCallGraphTest.main(SootCallGraphTest.java:51)

image

jpstotz commented 2 years ago

Your screen shot shows hat TestClientApp is a Java source code but your class path only contains the test-server\lib folder.

Class files of compiled Java source code usually is saved in the target/classes (Maven) or build/classes/java (Gradle) directory. If you don't add the directory where the compiled class files are located Soot can not find it.