这段代码编译能通过,可是执行的时候Exception in thread "main"java.lang.NoClassDefFoundError: org/apache/commons/lo
gging/LogFactory,原来我没有引用LogFactory类,那位高手知道哦org.apache.commons.logging这个jar.还有LogFactory在这段代码里面到底起了什么作用,还是不是这个错误?import org.apache.commons.beanutils.*;class MyClass{ private String name;
private int age;
}public class Test2{
public static void main(String[] args){
try{
MyClass mc = new MyClass();
//PropertyUtils.getProperty(mc,"name");
BeanUtils.getProperty(mc,"name");
}catch(Exception e){
e.printStackTrace();
}
}
}