4 Replies Latest reply on Nov 15, 2005 12:01 PM by Dominik Bernhard

    Problem with java.lang.VerifyError

    Brennan Spies Newbie

      Hi all,

      I'm working on code that dynamically parses input records based on XML configuration...I'm having a problem with a thrown java.lang.VerifyError from Class newInstance() after calling CtClass.toClass(). The error is this:

      java.lang.VerifyError: (class: com/sbc/bac/load/cebav/account/DailyAccountLineBeanXCRS5011Record, method: parseLine signature: (Ljava/lang/String;)Ljava/lang/Object;) Register 3 contains wrong type
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
      at java.lang.Class.getConstructor0(Unknown Source)
      at java.lang.Class.newInstance0(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      at com.sbc.bac.load.records.DynamicFileParserFactory.generateDynamicRecord(DynamicFileParserFactory.java:110)

      The Record interface that this class extends just defines 1 method:
      public Object parseLine(String line);

      There is an abstract 'glue class' that implements Record here--all this does
      is have an empty parseLine() method, a getSeparator(), and two protected HashMap's. I am replacing the body of the parseLine() method with the code:

      String curToken;
      java.text.DateFormat df;
      java.util.StringTokenizer st = new java.util.StringTokenizer($1, getSeparator());
      com.sbc.bac.load.cebav.account.DailyAccountLineBean bean = (com.sbc.bac.load.cebav.account.DailyAccountLineBean)newBean();

      throw new com.sbc.bac.load.error.RecordException("Number of input records is less than configured records.");

      curToken = st.nextToken();
      curToken = curToken.trim();


      if((df = (java.text.DateFormat)dateCache.get("yyyyMMdd"))==null)
      dateCache.put("yyyyMMdd", df = new java.text.SimpleDateFormat("yyyyMMdd"));
      bean.setProcessDate(new java.sql.Date(df.parse(curToken).getTime()));


      Does anybody have an idea of what could be happening here? If I write out a class file from CtClass, then decompile it with JAD, the code compiles on Eclipse just fine.