2 Replies Latest reply: Jan 18, 2011 2:39 AM by 831998 RSS

    J2ME and reflection

    843849
      I'm trying to use Javassist to instrument CLDC programs, but, I'm getting a lot of problems with the Verifying process.
      Anyone knows how to use Javassist for J2ME???

      If you already used another reflection api successfully please tell me.

      Thank you in advance.
        • 1. Re: J2ME and reflection
          782681
          According to Wikipedia, CLDC lacks _"...java.lang.reflect package and any of its classes... Methods on java.lang.Class which obtain Constructors or Methods or Fields..."_

          If needed, [click here to find more noteworthy limitations vis-a-vis J2SE runtime|http://en.wikipedia.org/wiki/CLDC#Noteworthy_limitations_vis-a-vis_J2SE_runtime] (absence of Serializable etc).

          One approach to instrument CLDC/MIDP programs ( MIDlets ) was presented at [MEDD'2008|https://developerdays.dev.java.net/nonav/Jan2008/abstracts.html#LT4] conference. As far as I understand, this approach is based on code injection technique and is targeted at application testing. If you're interested, [click here to take a look at presentation slides (pdf)|http://download.java.net/mobileembedded/developerdays/2008/LT-4-MIDletInstumenting-final.pdf].
          • 2. Re: J2ME and reflection
            831998
            Hello all,

            I am trying to use javassist on existing J2ME application. However, I get preverification failure errors when including the javassist.jar into my project.

            Any help to resolve this would be much appreciated.