Open juliamanfrindias opened 2 years ago
Hi @juliamanfrindias, I’ve just encountered this error. I know it’s been a long time, but were you able to resolve this issue?
this is maybe because the classpath of the program under repair is not set, see option -dependencies
reference: https://github.com/SpoonLabs/astor/blob/master/docs/getting-starting.md
Thank you for you response, @monperrus .
These programs use Maven/Gradle to manage their dependencies. So we have to extract and list them all in the --dependencies argument.
Hi @monperrus , I have encountered this error, although Maven (Java 8) can compile the source code, but Spoon cannot. Do you know what the problem might be?
---- Creating spoon model Creating model, Code location from working folder: /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java building model: /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java, compliance level: 8 Classpath (Dependencies) for building SpoonModel: null Problem compiling the model with compliance level 8 SqlMapClientImpl cannot be resolved to a type at /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java/com/alibaba/druid/support/ibatis/SqlMapClientImplWrapper.java:36 spoon.compiler.ModelBuildingException: SqlMapClientImpl cannot be resolved to a type at /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java/com/alibaba/druid/support/ibatis/SqlMapClientImplWrapper.java:36 at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:649) at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:631) at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:118) at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:99) 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:887) at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:96) at fr.inria.main.evolution.AstorMain.run(AstorMain.java:160) at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:222) at fr.inria.main.evolution.AstorMain.main(AstorMain.java:193) Recompiling with compliance level 8 building model: /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java, compliance level: 8 Classpath (Dependencies) for building SpoonModel: null spoon.compiler.ModelBuildingException: SqlMapClientImpl cannot be resolved to a type at /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java/com/alibaba/druid/support/ibatis/SqlMapClientImplWrapper.java:36 at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:649) at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:631) at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:118) at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:99) 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:887) at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:96) at fr.inria.main.evolution.AstorMain.run(AstorMain.java:160) at fr.inria.main.evolution.AstorMain.execute(AstorMain.java:222) at fr.inria.main.evolution.AstorMain.main(AstorMain.java:193) Error compiling: SqlMapClientImpl cannot be resolved to a type at /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java/com/alibaba/druid/support/ibatis/SqlMapClientImplWrapper.java:36 Astor continues when model build fails. Classes created: 1055 Number of CtTypes created: 1055 Running chosen test detection strategy: CLASSLOADER NoClassDefFoundError: class com.alibaba.druid.util.OracleUtils NoClassDefFoundError: class com.alibaba.druid.util.DruidWebUtils NoClassDefFoundError: class com.alibaba.druid.support.ibatis.IbatisUtils
These programs use Maven/Gradle to manage their dependencies. So we have to extract and list them all in the --dependencies argument.
yes.
I have encountered this error, although Maven (Java 8) can compile the source code, but Spoon cannot. Do you know what the problem might be?
it seems there is the wrong Java version flag set for Spoon.
I used Java 8 to run the experiment. Is there anything wrong with that? or Is there any argument that I have missed?
Thank you.
Reading again the error quickly:
SqlMapClientImpl cannot be resolved to a type at /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java/com/alibaba/druid/support/
It seems that the dependency containing SqlMapClientImpl is not in the --dependencies
jar files.
INFO main - command line arguments: [-mode jgenprog -loglevel INFO -srcjavafolder /experiment/regminer4apr/druid/RegressionBug-21/src/src/main/java -srctestfolder /experiment/regminer4apr/druid/RegressionBug-21/src/src/test/java -binjavafolder target/classes -bintestfolder target/test-classes -location /experiment/regminer4apr/druid/RegressionBug-21//src -dependencies /experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/geronimo-jta_1.1_spec-1.1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/opencsv-2.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/calcite-druid-1.13.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/slf4j-api-1.7.9.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/javasimon-core-4.1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/j2objc-annotations-1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/odps-sdk-core-0.18.3-public.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/aspectjrt-1.8.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/odps-jdbc-1.6.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-aop-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/ST4-4.0.8.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jackson-mapper-asl-1.9.13.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/antlr4-runtime-4.7.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-io-2.4.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/janino-2.7.6.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-expression-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/tagsoup-0.9.7.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/mchange-commons-java-0.2.3.4.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/mysql-connector-java-5.1.45.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/guava-22.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/dom4j-1.6.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/fastjson-1.2.36.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/derby-10.12.1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/calcite-linq4j-1.14.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/odps-sdk-commons-0.17.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/quartz-2.2.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/mybatis-spring-1.3.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-dbcp2-2.1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/joda-time-2.8.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/xml-apis-1.0.b2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/junit-4.12.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-math3-3.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jboss-logging-3.3.0.Final.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-logging-1.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jmh-generator-annprocess-1.19.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/simple-jndi-0.11.4.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-tx-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/animal-sniffer-annotations-1.14.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/hibernate-jpa-2.1-api-1.0.0.Final.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/javasimon-jdbc41-4.1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/javasimon-javaee-4.1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-dao-2.0.8.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/proxool-cglib-0.9.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-ibatis-2.0.8.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/hibernate-c3p0-5.1.0.Final.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/snappy-java-1.1.1.6.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/protobuf-java-3.1.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/tools-1.8.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/hibernate-commons-annotations-5.0.1.Final.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/javax.servlet-api-3.1.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/javax.json-1.0.4.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/dubbo-2.5.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-webmvc-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jackson-annotations-2.6.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/aggdesigner-algorithm-6.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-test-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/log4j-core-2.5.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/avatica-core-1.9.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jmh-core-1.19.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/proxool-0.9.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jandex-2.0.0.Final.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-codec-1.6.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/postgresql-42.1.4.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/log4j-1.2.17.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/tomcat-jdbc-8.0.32.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/javassist-3.20.0-GA.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/httpclient-4.2.5.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/httpcore-4.2.4.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/mybatis-3.4.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/calcite-core-1.14.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/xercesImpl-2.6.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/classmate-1.3.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jackson-core-2.6.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/antlr4-4.7.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-dbutils-1.6.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jcabi-log-0.15.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/gson-2.2.4.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/log4j-api-2.5.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-jdbc-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/xmlParserAPIs-2.6.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/nutz-1.r.55.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jackson-core-asl-1.9.13.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jopt-simple-4.6.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/aopalliance-1.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-web-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jconsole-1.8.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/hamcrest-core-1.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jtds-1.3.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/netty-3.2.5.Final.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/antlr-2.7.7.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/error_prone_annotations-2.0.18.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/org.abego.treelayout.core-1.0.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/c3p0-0.9.2.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-pool2-2.4.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/ibatis-sqlmap-2.3.4.726.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-beans-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-context-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/tbdatasource-2.0.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/h2-1.4.191.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-2.5.6.SEC03.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jaxen-1.1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/javasimon-spring-4.1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/hibernate-core-5.1.0.Final.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/avatica-metrics-1.9.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jackson-databind-2.6.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/bonecp-spring-0.8.0.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/esri-geometry-api-2.0.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-pool-1.5.4.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/kylin-jdbc-2.0.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jta-1.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/xalan-2.6.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/antlr-runtime-3.5.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-lang-2.4.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-lang3-3.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/tomcat-juli-8.0.32.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jcabi-aspects-0.20.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jsr305-3.0.1.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/bonecp-0.8.0.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/c3p0-0.9.1.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-compiler-2.7.6.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/bcprov-jdk15on-1.52.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jcl-over-slf4j-1.7.21.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/odps-sdk-udf-0.17.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jboss-common-1.2.1.GA.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/ojdbc6-11.2.0.3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/javacsv-2.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/jdom-1.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/icu4j-58.2.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/slf4j-log4j12-1.7.9.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/calcite-example-csv-1.13.0.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-core-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/xom-1.0b3.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/spring-orm-4.2.5.RELEASE.jar:/experiment/regminer4apr/druid/RegressionBug-21/src/target/dependencies/commons-dbcp-1.4.jar:/opt/astor/external/lib/hamcrest-core-1.3.jar:/opt/astor/external/lib/junit-4.12.jar -javacompliancelevel 8 -maxgen 1000000 -maxtime 30 -stopfirst true]
I used the command mvn dependency:copy-dependencies -DoutputDirectory=...
to generate all the dependencies of the project. However, when I ran the command again with the added dependencies, the same error still appeared.
In which jar file can you find SqlMapClientImpl?
I confirmed that it is included in 'ibatis-sqlmap-2.3.4.726.jar' and ensured the project successfully compiles and tests on Maven.
I ran this command in astor, using the defects4j's Bug Charts:
java -cp /home/julia/mestrado/teste/astor_bkp/target/astor-2.0.0-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jKali -location /home/julia/mestrado/ test/Bugs/Chart-1 -maxtime 120 -mode statement -package org.apache.commons -jvm4testexecution /usr/lib/jvm/java-8-openjdk-amd64/bin/ -srcjavafolder /src/java/ -srctestfolder /src /test/ -binjavafolder /target/classes -bintestfolder /target/test-classes -flthreshold 0.5 -stopfirst true -faultlocalization CoCoSpoon -allpoints true -dependencies /home/julia/mestrado/teste/astor_bkp/astor/examples/libs/junit- 4.4.jar
And I had this error:
How do I solve this?