2 Replies Latest reply on Jun 21, 2004 10:52 AM by Shigeru Chiba

    javassist gen codes works decompiled only !

    Bernard Sirius Newbie

      I consistently get the following error when I try to run some javassist generated code:

      java.lang.VerifyError: (class: fractals/psychos/core/system/transfer/ApplicationInfo, method: saveData signature: (Lfractals/psychos/core/system/entity/Application; Lnet/sf/hibernate/Session;)V) Incompatible argument to function...
      ...

      I've looked into the decompiled version of that class (I use dj's JAD utility for that: a great tool IMO), and here's what I get:

      public void saveData(Application application, Session session)
      throws HibernateException
      {
      System.out.println("saving data...");
      ...

      which looks fairly standard.
      And indeed when use the decompiled class as input to plain javac, everything's working fine. But this somehow makes javassist a lot less needed...

      I'd be glad to send the incriminated bytecodes to anyone interested.

      any idea?

        • 1. Re: javassist gen codes works decompiled only !
          Bernard Sirius Newbie

          I have more: I generate several classes using Javassist, all with that same signature which seems to cause so much trouble: guess what ? Some load successfully, others don't... I try to find out what makes them so different.

          Now I have streamlined my tests to the maximum, and the problem seems to lie right in the very heart of the class bytecodes:

          Class.forName ( "fractals.psychos.core.system.transfer.AddressData" ).newInstance ();
          System.out.println ( "successfully instanciated AddressData" );
          Class.forName ( "fractals.psychos.core.system.transfer.DomainData" ).newInstance ();
          System.out.println ( "successfully instanciated DomainData" );
          Class.forName ( "fractals.psychos.core.system.transfer.UserData" ).newInstance ();
          System.out.println ( "successfully instanciated UserData" );
          Class.forName ( "fractals.psychos.core.system.transfer.UserInfo" ).newInstance ();
          System.out.println ( "successfully instanciated UserInfo" );

          Class.forName ( "fractals.psychos.core.media.transfer.ArticleData" ).newInstance ();
          System.out.println ( "successfully instanciated ArticleData" );
          Class.forName ( "fractals.psychos.core.media.transfer.ArticleInfo" ).newInstance ();
          System.out.println ( "successfully instanciated ArticleInfo" );

          .... etc

          But it stops here, i.e. the class loader has a problem with the ArticleInfo class. Always the same problem: it's about the saveData ( Article, Session ) method. Note that the previous class, which loads successfully, has the exact same method.

          Well, I don't know, but it looks like a Javassist bug, doesn't it ?

          Oh, and I've tried that with both the 2.6 and the 3.0beta versions. No difference.


          • 2. Re: javassist gen codes works decompiled only !
            Shigeru Chiba Expert

            First, I would like to see the rest of this error message:

            java.lang.VerifyError: (class: fractals/psychos/core/system/transfer/ApplicationInfo, method: saveData signature: (Lfractals/psychos/core/system/entity/Application; Lnet/sf/hibernate/Session;)V) Incompatible argument to function...
            ...

            And the class file generated by Javassist.
            Could you show a URL to that class file?