Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
juliamanfrindias opened this issue Jun 6, 2022 · 0 comments

Comments

@juliamanfrindias
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant