您的位置:程序门 -> java -> eclipse



请教一下各位高手, 为什么我在用 propertyutils.getpropertytype 的时候会出现java.lang.noclassdeffounderror 的错误? 谢谢!!!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


请教一下各位高手, 为什么我在用 propertyutils.getpropertytype 的时候会出现java.lang.noclassdeffounderror 的错误? 谢谢!!!
发表于:2007-08-04 23:42:37 楼主
请教一下各位高手,   为什么我在用   propertyutils.getpropertytype   的时候会出现java.lang.noclassdeffounderror   的错误?   谢谢!!!

import   java.lang.reflect.invocationtargetexception;
import   java.util.arraylist;
import   org.apache.commons.beanutils.propertyutils;

public   class   test   {

public   static   void   main(string[]   args)
{
chapter   chapter   =   new   chapter();
        //   下面将出个这个name属性的类型,string
     
      chapter.setname( "xxxxxxxxxx ");

        arraylist   chapters   =   new   arraylist();
        chapters.add(chapter);
               
        book   book2   =   new   book();
        book2.setchapters(chapters);
               
        class   type2   =   null   ;
       
        system.out.println( "here ");
try   {
type2   =   propertyutils.getpropertytype(book2,   "chapters[0].name ");
}   catch   (illegalaccessexception   e)   {
//   todo   auto-generated   catch   block
e.printstacktrace();
}   catch   (invocationtargetexception   e)   {
//   todo   auto-generated   catch   block
e.printstacktrace();
}   catch   (nosuchmethodexception   e)   {
//   todo   auto-generated   catch   block
e.printstacktrace();
}
 
       
system.out.println(type2.getname());
}
}


输出的显示是:
here
exception   in   thread   "main "   java.lang.noclassdeffounderror:   org/apache/commons/collections/fasthashmap
at   org.apache.commons.beanutils.propertyutils. <clinit> (propertyutils.java:208)
at   test.main(test.java:30)
发表于:2007-12-22 02:30:221楼 得分:0
顶,,,,,,,我也想知道..


快速检索

最新资讯
热门点击