astor
astor copied to clipboard
HELP - Error: The main class fr.inria.main.evolution.AstorMain could not be found or loaded
I installed astor via option 2, but I couldn't run the test examples, so I tried to install via option 1 and I can't run it either.
I ran the command: java -cp astor.jar fr.inria.main.evolution.AstorMain -mode jkali -location <> ......
And I got the following error in response: Error: The main class fr.inria.main.evolution.AstorMain could not be found or loaded
I do not know what to do. I can't get out of this.
Eu instalei o astor pela opção 2, mas não consegui executar os exemplos de teste, então tentei a instalção pela opção 1 e também não consigo executar.
Rodei o comando: java -cp astor.jar fr.inria.main.evolution.AstorMain -mode jkali -location <>......
E obtive como resposta o seguinte erro:
Erro: Não foi possível localizar nem carregar a classe principal fr.inria.main.evolution.AstorMain
Hi @juliamanfrindias
Could you check if:
- the jar name is "astor.jar" (Usually, after building the project, the name has the version at the end)
- you run the command in the same folder where the jar is located (after building, the jar is usually put in target folder)
Regards Matias
Thanks for the feedback! This bug has been fixed. I was running the command from inside the Astor folder instead of the target folder
Now when I run the command inside the target folder, using the example Math-issue-280 at location:
java -cp astor-1.1.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ - bintestfolder /target/test-classes/ -location /home/astor/Documents/A3/astor/examples/Math-issue-280/
Returns the expected response:
Astor Output:
general stats:
EXECUTION_IDENTIFIER=
TOTAL_TIME=143,384
NR_GENERATIONS=200
But I'm only getting this successful answer for the example Math-issue-280.
When I run the command, using the example math_20 at location:
java -cp astor-1.1.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ - bintestfolder /target/test-classes/ -location /home/astor/Documents/A3/astor/examples/math_20/
Returns an error:
ERROR AstorCoreEngine - Initial run of test suite fails
The same error is returned when I run the command, using the example math_50v2 in location:
java -cp astor-1.1.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ - bintestfolder /target/test-classes/ -location /home/astor/Documents/A3/astor/examples/math_50v2/
Error return for math_50v2 example:
ERROR AstorCoreEngine - Initial run of test suite fails
When I run the command using the lang_63 example:
java -cp astor-1.1.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ - bintestfolder /target/test-classes/ -location /home/astor/Documents/A3/astor/examples/lang_63/
Returns the error:
22:04:49.451 [main] ERROR MutationSupporter - Problem compiling the model with compliance level 8
22:04:49.452 [main] ERROR MutationSupporter - Syntax error on token "enum", Identifier expected at /home/astor/Documentos/A3/astor/examples/lang_63/src/main/java/org/apache/commons/lang/enum/Enum.java:17
spoon.compiler.ModelBuildingException: Syntax error on token "enum", Identifier expected at /home/astor/Documentos/A3/astor/examples/lang_63/src/main/java/org/apache/commons/lang/enum/Enum.java:17
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:635)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:617)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:116)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:97)
at fr.inria.astor.core.manipulation.MutationSupporter.buildModel(MutationSupporter.java:85)
at fr.inria.astor.core.manipulation.MutationSupporter.buildSpoonModel(MutationSupporter.java:240)
at fr.inria.astor.core.solutionsearch.AstorCoreEngine.initModel(AstorCoreEngine.java:776)
at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:113)
at fr.inria.main.evolution.AstorMain.run(AstorMain.java:173)
at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:233)
at fr.inria.main.evolution.AstorMain.main(AstorMain.java:204)
spoon.compiler.ModelBuildingException: Syntax error on token "enum", Identifier expected at /home/astor/Documentos/A3/astor/examples/lang_63/src/main/java/org/apache/commons/lang/enum/Enum.java:17
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:635)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:617)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:116)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:97)
at fr.inria.astor.core.manipulation.MutationSupporter.buildModel(MutationSupporter.java:85)
at fr.inria.astor.core.manipulation.MutationSupporter.buildSpoonModel(MutationSupporter.java:253)
at fr.inria.astor.core.solutionsearch.AstorCoreEngine.initModel(AstorCoreEngine.java:776)
at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:113)
at fr.inria.main.evolution.AstorMain.run(AstorMain.java:173)
at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:233)
at fr.inria.main.evolution.AstorMain.main(AstorMain.java:204)
22:04:51.504 [main] ERROR MutationSupporter - Error compiling: Syntax error on token "enum", Identifier expected at /home/astor/Documentos/A3/astor/examples/lang_63/src/main/java/org/apache/commons/lang/enum/Enum.java:17
22:04:51.618 [main] ERROR MutationSupporter - Astor continues when model build fails. Classes created: 77
And when I run the command for example lang_39:
java -cp astor-1.1.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ - bintestfolder /target/test-classes/ -location /home/astor/Documents/A3/astor/examples/lang_39/
It doesn't return any answer, it just runs for a while and then finishes without giving any answer. This is what appeared on the console:
[astor@julia-note target]$ java -cp astor-1.1.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test / -binjavafolder /target/classes/ -bintestfolder /target/test-classes/ -location /home/astor/Documents/A3/astor/examples/lang_39/
[astor@julia-note target]$
Hi @juliamanfrindias I'd suggest to create one Github issue per problem. Otherwise it will be quite a mess to reply all of them. Thanks Matias
Of course!