3 Replies Latest reply on Oct 14, 2003 7:51 AM by vc

    java.lang.ClassFormatError

    vc Newbie

      Hello,

      We are currently trying to change method modifiers. The modification process seems to be successful, however we have big problems to use the modified classes, usually we've got the following message:

      java.lang.ClassFormatError: HelloWorld (Arguments can't fit into locals)

      Has anybody experience with such error? Thank you in advance.

      Best regards VC

        • 1. Re: java.lang.ClassFormatError
          Shigeru Chiba Expert

          That exception means some methods take too many
          parameters than expected. How did you change?

          • 2. Re: java.lang.ClassFormatError
            vc Newbie

            We've just change method and field modifiers, basically from 'private' or 'protected' to 'public', then we've used the javassist's loader to load the modified class and instantiated an object out of this modified class. During the instantiation we'got the error message described before. We're using javassist version 2.6.

            Thank you VC

            • 3. Re: java.lang.ClassFormatError
              vc Newbie

              Hello,

              The problem seems to be discovered! As we've mentioned before we've changed method modifiers to 'public', however we've omitted to add other modifiers like 'static' that were there originally. The consequence was the already mentioned message 'java.lang.ClassFormatError'.

              Best regards, VC