SpoonLabs / astor

Automatic program repair for Java with generate-and-validate techniques :v::v:: jGenProg (2014) - jMutRepair (2016) - jKali (2016) - DeepRepair (2017) - Cardumen (2018) - 3sfix (2018)
https://hal.archives-ouvertes.fr/hal-01321615/document
GNU General Public License v2.0
207 stars 106 forks source link

Exception in thread "main" java.lang.Exception: Error Loading Engine: java.lang.NullPointerException #234

Closed crimsonfan closed 4 years ago

crimsonfan commented 4 years ago

First of all, thanks for your works. I'm a college student and I'm doing some experiments on your work for my research. I followed your tutorial option 1 and met this problems image I have do compile test by maven in examples folder too. I need some suggestions to solve this.

Thanks again.

martinezmatias commented 4 years ago

HI @crimsonfan Thanks for reporting the issue. Could you send me the command line that are you using to launch Astor? Thanks Matias

crimsonfan commented 4 years ago

Thanks for your reply. Here sir.

image

martinezmatias commented 4 years ago

Thanks. Just to be sure: is the "astor.jar" that one with dependencies (i.e., when you run maven it generates the jar astor-1.0.0-SNAPSHOT-jar-with-dependencies.jar )?

crimsonfan commented 4 years ago

Yes. image I changed it name to astor.jar for short.

crimsonfan commented 4 years ago

Dear @martinezmatias,

Do I need to alter the astor.properties? I thought it's be fine if I fill the arguments in command promt

Thanks

martinezmatias commented 4 years ago

Hi @crimsonfan

Do I need to alter the astor.properties?

it's inside the jar. But you can override any property by using the arguments -parameters (see here: https://github.com/SpoonLabs/astor/blob/master/docs/arguments.md#astor-parameters)

BTY: the log seems it's not correctly finding the JVM to run the test. Using the previously mentioned -parameters pass the location of the JVM (where the java executable is located) using the key jvm4testexecution(e.g., -parameters jvm4testexecution:/home/jvm/java8/bin)

crimsonfan commented 4 years ago

Dear @martinezmatias,

I followed your guides but it said that my jdk folder is invalid: image This is my java and javac version: image image Did I do something wrong in java confirguration?

Many thanks.

crimsonfan commented 4 years ago

Dear @martinezmatias,

I solved it.

Thanks a lot.

martinezmatias commented 4 years ago

Hi @crimsonfan Cool! great! Which was the problem? How could you solve it? Regards Matias

crimsonfan commented 4 years ago

Dear @martinezmatias, I wonder if there is any problems with -jvm4testexecution, when I used it to locate the java8/bin, it didn't reconized the path as jdk folder (JDK folder invalid). And when I didn't use that parameter, the astor chose to run on jre path. So I tried to alter the astor's selection by checking JAVA_HOME, Path in System properties but it was no use. Then I chose to uninstall the jre. The astor had to choose the jdk path as the only option and run. ... my solution somehow is unreasonable and not logical. But that's all I can do.