new CreditAnxietyCause[] 这么些的话不符合语法的规则哦。

解决方案 »

  1.   

    java.lang.ClassCastException: [Ljp.co.nec_lease.imart.model.common.object.CreditAnxiety;
    at jp.co.nec_lease.imart.model.creditanxiety.data.CreditAnxietyLogDBDAO.fetchWithDetail(CreditAnxietyLogDBDAO.java:452)
    -----------------------------
    代码如下:
    ----------------------
     CreditAnxietyLog[] oCreditAnxietyLogList = (CreditAnxietyLog[]) vector.toArray(new CreditAnxiety[0]);
      
    ---------------------------
    什么地方出错
      

  2.   

    CreditAnxietyLog[] oCreditAnxietyLogList = (CreditAnxietyLog[])vector.toArray();
    直接这样写试一试!!
      

  3.   

    API:
    public synchronized Object[] toArray(Object a[]) {
            if (a.length < elementCount)
                a = (Object[])java.lang.reflect.Array.newInstance(
                                    a.getClass().getComponentType(), elementCount); System.arraycopy(elementData, 0, a, 0, elementCount);        if (a.length > elementCount)
                a[elementCount] = null;        return a;
        }
      

  4.   

    @param a the array into which the elements of the Vector are to
         * be stored, if it is big enough; otherwise, a new array of the
         *  same runtime type is allocated for this purpose.
      

  5.   

    its meaning is that if your parameter Vector isn't long enough,it doesn't matter,method toArray will create a new Vector to replace the old one,and the new Vector's size is just fit for the need.