我有以下非常简单,有目的错误的java类:
import java.io.InputStream;
import java.util.*;
public class ArrayListError{
public ArrayListError(){
}
public static void makeArray(int i){
ArrayList list = new ArrayList(i);
}
public static void main(String[] args)
{
System.out.println("Enter a number to create arrayList:");
Scanner scanner =new Scanner(System.in);
int i= scanner.nextInt();
makeArray(i);
}
}
在evosuite cygwin上运行时(java -jar evosuite-20120511.jar -setup c:/ Users / Eliezer \ Shindler / Desktop / myclasses) 我明白了:
线程“main”java.lang.ExceptionInInitializerError中的异常 at de.unisb.cs.st.evosuite.setup.ScanProject.main(ScanProject.java:578) 引起:com.thoughtworks.xstream.converters.ConversionException:无法构造de.unisb.cs.st.evosuite.callgraph.DistanceTransformer $ ClassEntry,因为它没有no-args构造函数:无法构造de.unisb.cs。 st.evosuite.callg raph.DistanceTransformer $ ClassEntry,因为它没有no-args构造函数 ----调试信息---- 消息:无法构造de.unisb.cs.st.evosuite.callgraph.Distanc eTransformer $ ClassEntry,因为它没有no-args构造函数 cause-exception:com.thoughtworks.xstream.converters.reflection.ObjectAcces sException cause-message:无法构造de.unisb.cs.st.evosuite.callgraph.Distanc eTransformer $ ClassEntry,因为它没有no-args构造函数 class:java.util.HashSet required-type:de.unisb.cs.st.evosuite.callgraph.DistanceTransformer $ Clas sEntry 路径:/set/de.unisb.cs.st.evosuite.callgraph.DistanceTransformer $ ClassEntry
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall er.java:89)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A bstractReferenceUnmarshaller.java:63)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm arshaller.java:76)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm arshaller.java:60)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionCon verter.readItem(AbstractCollectionConverter.java:71)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.p opulateCollection(CollectionConverter.java:68)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.u nmarshal(CollectionConverter.java:61)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall er.java:82)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A bstractReferenceUnmarshaller.java:63)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm arshaller.java:76)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm arshaller.java:60)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller .java:137)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarsh al(AbstractTreeMarshallingStrategy.java:33)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
at de.unisb.cs.st.evosuite.utils.Utils.readXML(Utils.java:301)
at de.unisb.cs.st.evosuite.callgraph.Hierarchy.readFromDefaultLocation(H ierarchy.java:113)
at de.unisb.cs.st.evosuite.setup.TestTaskGenerator.<clinit>(TestTaskGene rator.java:57)
... 1 more
引起:com.thoughtworks.xstream.converters.reflection.ObjectAccessException:无法构造de.unisb.cs.st.evosuite.callgraph.DistanceTransformer $ ClassEnt ry,因为它没有no-args构造函数 在com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProv ider.newInstance(PureJavaReflectionProvider.java:71) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv erter.instantiateNewInstance(AbstractReflectionConverter.java:308) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv erter.unmarshal(AbstractReflectionConverter.java:161) 在com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall er.java:82) ......还有19个
我不明白这一点 - 任何人都可以请求帮助 - 我多年来一直在努力解决这个问题。有关evosuite文档的信息,请访问www.evosuite.org/documentation
答案 0 :(得分:0)
我认为这是一个内部的evosuite错误,由于某种原因,在cygwin中运行它。