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
208 stars 106 forks source link

ERROR - ERROR MutationSupporter - HttpServlet cannot be resolved to a type #358

Open juliamanfrindias opened 2 years ago

juliamanfrindias commented 2 years ago

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:

$ 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/teste/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
[1] INFO ProjectConfiguration - Version of the JVM used: 1.8.0_312
[1] INFO main - Java version of the JDK used to run tests: 1.8.0_312
[1] INFO main - The compliance of the JVM is:  8
[3] INFO main - command line arguments: [-mode  jKali  -location  /home/julia/mestrado/teste/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]
[5] INFO AstorMain - Running Astor on a JDK at /usr/lib/jvm/java-8-openjdk-amd64/jre
[13] INFO main - Source folders: [/home/julia/mestrado/teste/Bugs/Chart-1/src]
[14] INFO main - Source Test folders: []
[558] INFO AstorCoreEngine - ---- Creating spoon model
[588] INFO MutationSupporter - Creating model,  Code location from working folder: /home/julia/mestrado/teste/Bugs/Chart-1/src
[589] INFO MutationSupporter - building model: /home/julia/mestrado/teste/Bugs/Chart-1/src, compliance level: 8
[661] INFO MutationSupporter - Classpath (Dependencies) for building SpoonModel: null
[8625] ERROR MutationSupporter - Problem compiling the model with compliance level 8
[8625] ERROR MutationSupporter - HttpServlet cannot be resolved to a type at /home/julia/mestrado/teste/Bugs/Chart-1/src/org/jfree/chart/servlet/DisplayChart.java:71
spoon.compiler.ModelBuildingException: HttpServlet cannot be resolved to a type at /home/julia/mestrado/teste/Bugs/Chart-1/src/org/jfree/chart/servlet/DisplayChart.java:71
    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: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)
[8627] INFO MutationSupporter - Recompiling with compliance level 8
[8627] INFO MutationSupporter - building model: /home/julia/mestrado/teste/Bugs/Chart-1/src, compliance level: 8
[8665] INFO MutationSupporter - Classpath (Dependencies) for building SpoonModel: null
spoon.compiler.ModelBuildingException: HttpServlet cannot be resolved to a type at /home/julia/mestrado/teste/Bugs/Chart-1/src/org/jfree/chart/servlet/DisplayChart.java:71
    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: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)
[12162] ERROR MutationSupporter - Error compiling: HttpServlet cannot be resolved to a type at /home/julia/mestrado/teste/Bugs/Chart-1/src/org/jfree/chart/servlet/DisplayChart.java:71
[12482] ERROR MutationSupporter - Astor continues when model build fails. Classes created: 656
[12663] INFO AstorCoreEngine - Number of CtTypes created: 656
[13092] INFO AstorCoreEngine - Test retrieved from classes: 0
[13093] INFO MutationSupporter - Creating model,  Code location from working folder: /home/julia/mestrado/teste/Bugs/Chart-1/src
[13093] INFO MutationSupporter - building model: /home/julia/mestrado/teste/Bugs/Chart-1/src, compliance level: 8
[13132] INFO MutationSupporter - Classpath (Dependencies) for building SpoonModel: null
[16277] ERROR MutationSupporter - Problem compiling the model with compliance level 8
[16277] ERROR MutationSupporter - HttpServlet cannot be resolved to a type at /home/julia/mestrado/teste/Bugs/Chart-1/src/org/jfree/chart/servlet/DisplayChart.java:71
spoon.compiler.ModelBuildingException: HttpServlet cannot be resolved to a type at /home/julia/mestrado/teste/Bugs/Chart-1/src/org/jfree/chart/servlet/DisplayChart.java:71
    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.faultlocalization.cocospoon.CocoFaultLocalization.initModel(CocoFaultLocalization.java:162)
    at fr.inria.astor.core.faultlocalization.cocospoon.CocoFaultLocalization.searchSuspicious(CocoFaultLocalization.java:51)
    at fr.inria.astor.core.solutionsearch.AstorCoreEngine.calculateSuspicious(AstorCoreEngine.java:903)
    at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:119)
    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)
[16278] INFO MutationSupporter - Recompiling with compliance level 8
[16278] INFO MutationSupporter - building model: /home/julia/mestrado/teste/Bugs/Chart-1/src, compliance level: 8
[16310] INFO MutationSupporter - Classpath (Dependencies) for building SpoonModel: null
spoon.compiler.ModelBuildingException: HttpServlet cannot be resolved to a type at /home/julia/mestrado/teste/Bugs/Chart-1/src/org/jfree/chart/servlet/DisplayChart.java:71
    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.faultlocalization.cocospoon.CocoFaultLocalization.initModel(CocoFaultLocalization.java:162)
    at fr.inria.astor.core.faultlocalization.cocospoon.CocoFaultLocalization.searchSuspicious(CocoFaultLocalization.java:51)
    at fr.inria.astor.core.solutionsearch.AstorCoreEngine.calculateSuspicious(AstorCoreEngine.java:903)
    at fr.inria.main.evolution.AstorMain.createEngine(AstorMain.java:119)
    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)
[19193] ERROR MutationSupporter - Error compiling: HttpServlet cannot be resolved to a type at /home/julia/mestrado/teste/Bugs/Chart-1/src/org/jfree/chart/servlet/DisplayChart.java:71
[19384] ERROR MutationSupporter - Astor continues when model build fails. Classes created: 656
Classpath [, /home/julia/mestrado/teste/astor_bkp/target/astor-2.0.0-jar-with-dependencies.jar, /home/julia/mestrado/teste/Bugs/Chart-1/tests/./output_astor/AstorMain-Chart-1//bin//default]
[27365] INFO AstorCoreEngine - Setting up the max to 142800 milliseconds (142 sec)
[27366] INFO AstorCoreEngine - ---- Initial suspicious size: 0
[27367] INFO main - Total ModPoint created: 0
[27367] INFO main - Creating program variant #1, [Variant id: 1, #gens: 0, #ops: 0, parent:-]
[27367] ERROR AstorCoreEngine - [warning] Any modification point in variant
[27367] ERROR AstorCoreEngine - Variant with any gen
[27367] WARN ConfigurationProperties - ----------------------------
[27368] INFO ConfigurationProperties - ---Configuration properties
[27368] INFO ConfigurationProperties - p:lastJUnitVersion= ./examples/libs/junit-4.11.jar
[27368] INFO ConfigurationProperties - p:alternativecompliancelevel= 8
[27368] INFO ConfigurationProperties - p:ignoredTestCases= 
[27368] INFO ConfigurationProperties - p:workingDirectory= /home/julia/mestrado/teste/Bugs/Chart-1/tests/./output_astor
[27368] INFO ConfigurationProperties - p:manipulatesuper= false
[27368] INFO ConfigurationProperties - p:validation= process
[27368] INFO ConfigurationProperties - p:jvm4testexecution= /usr/lib/jvm/java-8-openjdk-amd64/bin/
[27368] INFO ConfigurationProperties - p:operatorspace= suppression
[27368] INFO ConfigurationProperties - p:diffcontext= 0
[27368] INFO ConfigurationProperties - p:binjavafolder= /target/classes
[27368] INFO ConfigurationProperties - p:synthesis_depth= 3
[27368] INFO ConfigurationProperties - p:gzoltartestpackagetoexclude= junit.framework
[27368] INFO ConfigurationProperties - p:skipfitnessinitialpopulation= false
[27368] INFO ConfigurationProperties - p:evosuiteresultfolder= evosuite
[27368] INFO ConfigurationProperties - p:flthreshold= 0.5
[27368] INFO ConfigurationProperties - p:regressionforfaultlocalization= true
[27369] INFO ConfigurationProperties - p:collectonlyusedmethod= false
[27369] INFO ConfigurationProperties - p:preservelinenumbers= true
[27369] INFO ConfigurationProperties - p:tmax2= 142800
[27369] INFO ConfigurationProperties - p:tmax1= 10000
[27369] INFO ConfigurationProperties - p:probagenmutation= false
[27369] INFO ConfigurationProperties - p:nomodificationconvergence= 100
[27369] INFO ConfigurationProperties - p:diff_type= relative
[27369] INFO ConfigurationProperties - p:targetelementprocessor= statements
[27369] INFO ConfigurationProperties - p:srctestfolder= /src/test/
[27369] INFO ConfigurationProperties - p:forceExecuteRegression= false
[27369] INFO ConfigurationProperties - p:clusteringfilename= clustering.csv
[27369] INFO ConfigurationProperties - p:logtestexecution= false
[27369] INFO ConfigurationProperties - p:evo_buggy_class= true
[27369] INFO ConfigurationProperties - p:numberExecutions= 1
[27369] INFO ConfigurationProperties - p:maxnumbersolutions= 1000000
[27369] INFO ConfigurationProperties - p:evo_affected_by_op= true
[27369] INFO ConfigurationProperties - p:population= 1
[27369] INFO ConfigurationProperties - p:considerzerovaluesusp= false
[27369] INFO ConfigurationProperties - p:maxCombinationVariableLimit= false
[27369] INFO ConfigurationProperties - p:savesolution= true
[27369] INFO ConfigurationProperties - p:javacompliancelevel= 8
[27369] INFO ConfigurationProperties - p:uniqueoptogen= false
[27369] INFO ConfigurationProperties - p:gzoltarpackagetonotinstrument= junit.framework
[27369] INFO ConfigurationProperties - p:projectIdentifier= 
[27369] INFO ConfigurationProperties - p:modificationpointnavigation= weight
[27369] INFO ConfigurationProperties - p:stopfirst= true
[27369] INFO ConfigurationProperties - p:multipointmodification= false
[27369] INFO ConfigurationProperties - p:elementsToMutate= 10
[27369] INFO ConfigurationProperties - p:jsonoutputname= astor_output
[27369] INFO ConfigurationProperties - p:evoDSE= false
[27369] INFO ConfigurationProperties - p:bintestfolder= /target/test-classes
[27369] INFO ConfigurationProperties - p:testbystep= false
[27370] INFO ConfigurationProperties - p:version-location= ./math-version/
[27370] INFO ConfigurationProperties - p:reintroduce= PARENTS:ORIGINAL
[27370] INFO ConfigurationProperties - p:executorjar= ./lib/jtestex7.jar
[27370] INFO ConfigurationProperties - p:maxGeneration= 200
[27370] INFO ConfigurationProperties - p:max_synthesis_step= 10000
[27370] INFO ConfigurationProperties - p:projectinfocommand= com.github.tdurieux:project-config-maven-plugin:info
[27370] INFO ConfigurationProperties - p:maxVarCombination= 1000
[27370] INFO ConfigurationProperties - p:maxtime= 120
[27370] INFO ConfigurationProperties - p:evosuitejar= ./lib/evosuite-master-1.0.4-SNAPSHOT.jar
[27370] INFO ConfigurationProperties - p:jvmversion= 1.8.0_312
[27370] INFO ConfigurationProperties - p:commandTrunk= 50000
[27370] INFO ConfigurationProperties - p:faultlocalization= CoCoSpoon
[27370] INFO ConfigurationProperties - p:resetmodel= true
[27370] INFO ConfigurationProperties - p:maxsuspcandidates= 1000
[27370] INFO ConfigurationProperties - p:mode= jKali
[27370] INFO ConfigurationProperties - p:learningdir= 
[27370] INFO ConfigurationProperties - p:jvm4evosuitetestexecution= /usr/lib/jvm/java-8-openjdk-amd64/bin
[27370] INFO ConfigurationProperties - p:filterfaultlocalization= true
[27370] INFO ConfigurationProperties - p:mutationrate= 1 
[27370] INFO ConfigurationProperties - p:pathToMVNRepository= 
[27370] INFO ConfigurationProperties - p:resourcesfolder= /src/main/resources:/src/test/resources:
[27370] INFO ConfigurationProperties - p:runjava7code= false
[27370] INFO ConfigurationProperties - p:timezone= America/Los_Angeles
[27370] INFO ConfigurationProperties - p:evoRunOnBuggyClass= true
[27370] INFO ConfigurationProperties - p:compiler= fr.inria.astor.core.manipulation.bytecode.compiler.SpoonClassCompiler
[27370] INFO ConfigurationProperties - p:limitbysuspicious= true
[27370] INFO ConfigurationProperties - p:logsattemps= true
[27370] INFO ConfigurationProperties - p:dependenciespath= /home/julia/mestrado/teste/astor_bkp/astor/examples/libs/junit-4.4.jar
[27370] INFO ConfigurationProperties - p:packageToInstrument= org.apache.commons
[27370] INFO ConfigurationProperties - p:skipfaultlocalization= false
[27370] INFO ConfigurationProperties - p:scope= package
[27370] INFO ConfigurationProperties - p:transformingredient= false
[27370] INFO ConfigurationProperties - p:fitnessfunction= fr.inria.astor.core.solutionsearch.population.TestCaseFitnessFunction
[27370] INFO ConfigurationProperties - p:maxnumvariablesperingredient= 10
[27371] INFO ConfigurationProperties - p:parsesourcefromoriginal= true
[27371] INFO ConfigurationProperties - p:pvariantfoldername= variant-
[27371] INFO ConfigurationProperties - p:savespoonmodelondisk= false
[27371] INFO ConfigurationProperties - p:srcjavafolder= /src/java/
[27371] INFO ConfigurationProperties - p:populationcontroller= fr.inria.astor.core.solutionsearch.population.TestCaseBasedFitnessPopulationController
[27371] INFO ConfigurationProperties - p:ignoreflakyinfl= false
[27371] INFO ConfigurationProperties - p:cleantemplates= true
[27371] INFO ConfigurationProperties - p:applyCrossover= false
[27371] INFO ConfigurationProperties - p:maxmodificationpoints= 1000
[27371] INFO ConfigurationProperties - p:duplicateingredientsinspace= false
[27371] INFO ConfigurationProperties - p:metid= 0
[27371] INFO ConfigurationProperties - p:continuewhenmodelfail= true
[27371] INFO ConfigurationProperties - p:saveall= false
[27371] INFO ConfigurationProperties - p:seed= 0
[27371] INFO ConfigurationProperties - p:savecompletepatched= true
[27371] INFO ConfigurationProperties - p:resetoperations= false
[27371] INFO ConfigurationProperties - p:processoutputinfile= false
[27371] INFO ConfigurationProperties - p:location= /home/julia/mestrado/teste/Bugs/Chart-1
[27371] INFO ConfigurationProperties - p:probabilistictransformation= true
[27371] INFO ConfigurationProperties - p:overridemaxtime= true
[27371] INFO ConfigurationProperties - p:outputjsonresult= true
[27371] INFO ConfigurationProperties - p:allpoints= true
[27371] INFO ConfigurationProperties - p:antipattern= false
[27371] INFO ConfigurationProperties - p:bugId= 280
[27372] INFO ConfigurationProperties - p:evosuitetimeout= 120
[27372] INFO ConfigurationProperties - p:maxtimefactor= 10
[27372] INFO ConfigurationProperties - p:nrPlaceholders= 1
[27372] INFO ConfigurationProperties - p:forcesubprocesskilling= false
[27372] INFO ConfigurationProperties - ----------------------------
[27372] INFO AstorCoreEngine - Time Repair Loop (s): 0.0
[27373] INFO AstorCoreEngine - generationsexecuted: 1
[27373] WARN AstorCoreEngine - ----SUMMARY_EXECUTION---
[27373] WARN AstorCoreEngine - End Repair Search: NOT Found solution
[27373] WARN AstorCoreEngine - Number suspicious:1
[27373] INFO AstorMain - Time Total(s): 27.365

How do I solve this?

brojackvn commented 1 month 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?

monperrus commented 1 month ago

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

brojackvn commented 1 month ago

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.

brojackvn commented 1 month ago

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

monperrus commented 1 month ago

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.

brojackvn commented 1 month ago
Screenshot 2024-10-08 at 16 40 04

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.

monperrus commented 1 month ago

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.

brojackvn commented 1 month ago
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.

monperrus commented 1 month ago

In which jar file can you find SqlMapClientImpl?

brojackvn commented 1 month ago

I confirmed that it is included in 'ibatis-sqlmap-2.3.4.726.jar' and ensured the project successfully compiles and tests on Maven.