[Soot-list] Soot exception: There is no main class set!

Eric Bodden eric.bodden at ec-spride.de
Mon Jun 18 06:33:11 EDT 2012


Hi again.

When Soot says that your main class has no main method than that's the
case. Are you sure the signature is correct and also that Soot is
picking up the correct class?

Eric

On 18 June 2012 12:03, Harsha vardhan Rajendran
<harshavardhan.rajendran at gmail.com> wrote:
> Hello Eric,
>
>    Actually I did try using he -main-class flag option. But I end up with an
> error saying that "Main-class has no main method!" (But it does).
>
> Here's what I did:
>
> java -Xmx2048m -cp
> ../build/jar/bianlian.jar:../code/lib/polyglotclasses-1.3.5.jar:../code/lib/jasminclasses-nightly.jar:../code/lib/log4j-1.2.15.jar:../code/lib/sootclasses-nightly.jar
> server.blockify.Blockifier Main -main-class server.blockify.Blockifier
>
> The error I got:
>
> Warning: java.dyn.InvokeDynamic is a phantom class!
> Warning: Main is a phantom class!
> Exception in thread "main" java.lang.RuntimeException: Main-class has no
> main method!
> at soot.Scene.setMainClass(Scene.java:146)
> at soot.Scene.setMainClassFromOptions(Scene.java:1216)
> at soot.Scene.getMainClass(Scene.java:176)
> at soot.EntryPoints.application(EntryPoints.java:65)
> at soot.EntryPoints.all(EntryPoints.java:95)
> at soot.Scene.getEntryPoints(Scene.java:702)
> at soot.Scene.getReachableMethods(Scene.java:749)
> at
> soot.jimple.toolkits.callgraph.CallGraphBuilder.<init>(CallGraphBuilder.java:59)
> at
> soot.jimple.toolkits.callgraph.CHATransformer.internalTransform(CHATransformer.java:42)
> at soot.SceneTransformer.transform(SceneTransformer.java:39)
> at soot.Transform.apply(Transform.java:89)
> at soot.RadioScenePack.internalApply(RadioScenePack.java:57)
> at
> soot.jimple.toolkits.callgraph.CallGraphPack.internalApply(CallGraphPack.java:47)
> at soot.Pack.apply(Pack.java:114)
> at soot.PackManager.runWholeProgramPacks(PackManager.java:417)
> at soot.PackManager.runPacks(PackManager.java:336)
> at soot.Main.run(Main.java:198)
> at soot.Main.main(Main.java:141)
> at
> server.blockify.Blockifier.blockifyFromCmdLineWithArgs(Blockifier.java:147)
> at server.blockify.Blockifier.main(Blockifier.java:399)
>
> Thanks
> Harsha
>
> On Mon, Jun 18, 2012 at 2:46 AM, Eric Bodden <eric.bodden at ec-spride.de>
> wrote:
>>
>> Hi Harsha.
>>
>> This may help:
>> http://www.sable.mcgill.ca/soot/tutorial/usage/
>>
>> Search for main-class.
>>
>> Eric
>>
>> On 18 June 2012 11:43, Harsha vardhan Rajendran
>> <harshavardhan.rajendran at gmail.com> wrote:
>> > Hello Marc,
>> >
>> >     Thank you so much for your reply. I have taken over this project
>> > from an
>> > earlier student and hence am finding my way through it. So, this is how
>> > soot
>> > is invoked:
>> >
>> > java -Xmx2048m -cp
>> >
>> > ../build/jar/bianlian.jar:../code/lib/polyglotclasses-1.3.5.jar:../code/lib/jasminclasses-nightly.jar:../code/lib/log4j-1.2.15.jar:../code/lib/sootclasses-nightly.jar
>> > server.blockify.Blockifier HelloWorld
>> >
>> > Blockifier and HelloWorld are two classes as you very well understand.
>> > And
>> > what do you mean "path for the parsing". Parsing of what to be precise?
>> >
>> > Thanks
>> > Harsha
>> >
>> >
>> > On Fri, Jun 15, 2012 at 5:24 AM, Marc-Andre Laverdiere-Papineau
>> > <marc-andre.laverdiere-papineau at polymtl.ca> wrote:
>> >>
>> >> Namaste Harsha,
>> >>
>> >> I had this a few times. There are two methods that can allow you to set
>> >> starting points for your interprocedural analyses, one is setting a
>> >> main
>> >> class, the others are setting arbitrary entry points, and they conflict
>> >> each other.
>> >>
>> >> I think another cause of it is that the path for the parsing needs to
>> >> be
>> >> repeated in the class path. It took me a while to understand that one
>> >> :$
>> >>
>> >> If that's not helping, would you please reply with the details of how
>> >> you are invoking Soot?
>> >>
>> >> --
>> >> Marc-André Laverdière-Papineau
>> >> Étudiant au doctorat - PhD Student
>> >>
>> >> On 06/15/2012 08:11 AM, Harsha vardhan Rajendran wrote:
>> >> > Hello ,
>> >> >
>> >> >       I have been playing around with Soot and keep getting the
>> >> > following error. I was wondering if you could please help me out? I
>> >> > have
>> >> > set everything in the proper classpath, but still it says that there
>> >> > is
>> >> > no main class set.
>> >> >
>> >> >
>> >> > 2012-06-15 05:03:24,088 DEBUG server.blockify.Blockifier -
>> >> > Initializing
>> >> > SOOT ...
>> >> > Soot started on Fri Jun 15 05:03:24 MST 2012
>> >> > Warning: java.dyn.InvokeDynamic is a phantom class!
>> >> > Warning: Main is a phantom class!
>> >> > *Exception in thread "main" java.lang.RuntimeException: There is no
>> >> > main
>> >> > class set!*
>> >> > at soot.Scene.getMainClass(Scene.java:179)
>> >> > at soot.EntryPoints.application(EntryPoints.java:65)
>> >> > at soot.EntryPoints.all(EntryPoints.java:95)
>> >> > at soot.Scene.getEntryPoints(Scene.java:702)
>> >> > at soot.Scene.getReachableMethods(Scene.java:749)
>> >> > at
>> >> >
>> >> >
>> >> > soot.jimple.toolkits.callgraph.CallGraphBuilder.<init>(CallGraphBuilder.java:59)
>> >> > at
>> >> >
>> >> >
>> >> > soot.jimple.toolkits.callgraph.CHATransformer.internalTransform(CHATransformer.java:42)
>> >> > at soot.SceneTransformer.transform(SceneTransformer.java:39)
>> >> > at soot.Transform.apply(Transform.java:89)
>> >> > at soot.RadioScenePack.internalApply(RadioScenePack.java:57)
>> >> > at
>> >> >
>> >> >
>> >> > soot.jimple.toolkits.callgraph.CallGraphPack.internalApply(CallGraphPack.java:47)
>> >> > at soot.Pack.apply(Pack.java:114)
>> >> > at soot.PackManager.runWholeProgramPacks(PackManager.java:417)
>> >> > at soot.PackManager.runPacks(PackManager.java:336)
>> >> > at soot.Main.run(Main.java:198)
>> >> > at soot.Main.main(Main.java:141)
>> >> > at
>> >> >
>> >> >
>> >> > server.blockify.Blockifier.blockifyFromCmdLineWithArgs(Blockifier.java:147)
>> >> > at server.blockify.Blockifier.main(Blockifier.java:399)
>> >> >
>> >> >
>> >> > --
>> >> > Regards
>> >> > Harsha vardhan R.
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > Soot-list mailing list
>> >> > Soot-list at sable.mcgill.ca
>> >> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>> >> >
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> Soot-list mailing list
>> >> Soot-list at sable.mcgill.ca
>> >> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>> >
>> >
>> >
>> >
>> > --
>> > Regards
>> > Harsha vardhan R.
>> >
>> >
>> > _______________________________________________
>> > Soot-list mailing list
>> > Soot-list at sable.mcgill.ca
>> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>> >
>>
>>
>>
>> --
>> Eric Bodden, Ph.D., http://bodden.de/
>> Head of Secure Software Engineering Group at EC SPRIDE
>> Principal Investigator in Secure Services at CASED
>> Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
>> Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt
>
>
>
>
> --
> Regards
> Harsha vardhan R.
>



-- 
Eric Bodden, Ph.D., http://bodden.de/
Head of Secure Software Engineering Group at EC SPRIDE
Principal Investigator in Secure Services at CASED
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt


More information about the Soot-list mailing list