5 Replies Latest reply: Aug 27, 2009 10:11 AM by 807581 RSS

    syncronization error afer obfuscating jar file

    807581
      hi.
      i am working with the MEP application. the application works fine before obfuscating the application.
      once i obfuscate the jar file, it gives me a error in synchronization
      the error is
      1251287045162 Thread[Sync Thread,6] [INFO] [HTTP 1] getHeaderField( Content-Type ) = application/vnd.syncml+xml
      dq: incompatible class: org.kxml2.io.KXmlParser
           at jd.a(+346)
           at jd.a(+5)
           at gx.a(+3)
           at as.a(+7)
           at as.a(+353)
           at c.b(+41)
           at c.a(+28)
           at fm.f(+12)
           at bj.a(+99)
           at sample.Midlet.d(+93)
           at sample.Midlet.run(+34)
      SyncMLEventReader: null
      1251287045334 Thread[Sync Thread,6] [INFO] [HTTP 1] Closing input stream
      Readed:
      1251287045412 Thread[Sync Thread,6] [INFO] [HTTP 1] Entering closed state
      kq:
      Please check URL
      http://172.29.120.50:8080/sync

      Error Details:
      java.lang.NullPointerException
           at as.a(+566)
           at c.b(+41)
           at c.a(+28)
           at fm.f(+12)
           at bj.a(+99)
           at sample.Midlet.d(+93)
           at sample.Midlet.run(+34)
      midlet.getSynchronizeTask
      ey:
      Please check URL
      http://172.29.120.50:8080/sync

      Error Details:
      java.lang.NullPointerException
           at bj.a(+179)
           at sample.Midlet.d(+93)
           at sample.Midlet.run(+34)
      Caused by:
      kq:
      Please check URL
      http://172.29.120.50:8080/sync

      Error Details:
      java.lang.NullPointerException
           at as.a(+566)
           at c.b(+41)
           at c.a(+28)
           at fm.f(+12)
           at bj.a(+99)
           at sample.Midlet.d(+93)
           at sample.Midlet.run(+34)
      ERROR in SYNC


      please help....
        • 1. Re: syncronization error afer obfuscating jar file
          807581
          Hi,

          I'm not sure which environment you're using or what obfuscator, but you need to make sure that you don't obfuscate the following two classes:

          org.kxml2.io.KXmlSerializer
          org.kxml2.io.KXmlParser

          If you're using NetBeans, then right-click on the project, open the properties, select the obfuscation panel. Then throw the obfuscation slider all the way to "High" and then add this in the "Addition obfuscation settings" box:
          -keep public class org.kxml2.io.KXmlSerializer
          -keep public class org.kxml2.io.KXmlParser
          The SGMP client runtime looks these classes up dynamically by name, so you can't obfuscate them.
          • 2. Re: syncronization error afer obfuscating jar file
            807581
            Thanks ...it worked
            • 3. Re: syncronization error afer obfuscating jar file
              807581
              Thanks it worked ...
              But i would like to share with you that ...
              i am using netbeans 6.5, and jdk 6

              i have build the complete application using netbeans 6.5 , but when increase the obfuscation level of the application and add the two lines
              -keep public class org.kxml2.io.KXmlSerializer
              -keep public class org.kxml2.io.KXmlParser to the additional settings. it give s me the following error




              {color:#ff0000}Expanding: C:\Documents and Settings\SShete\My Documents\NetBeansProjects\vtms_test_lwuit_Backup\build\obfuscated.jar into C:\Documents and Settings\SShete\My Documents\NetBeansProjects\vtms_test_lwuit_Backup\build\obfuscated
              C:\Documents and Settings\SShete\My Documents\NetBeansProjects\vtms_test_lwuit_Backup\nbproject\build-impl.xml:459: Error while expanding C:\Documents and Settings\SShete\My Documents\NetBeansProjects\vtms_test_lwuit_Backup\build\obfuscated.jar
              java.io.FileNotFoundException: C:\Documents and Settings\SShete\My Documents\NetBeansProjects\vtms_test_lwuit_Backup\build\obfuscated.jar (The system cannot find the file specified)
              BUILD FAILED (total time: 21 seconds){color}


              so what i have done is , i have opened the same project using wtk2.5.2 toolkit and then made changes to the default.pro file of proguard.jar.
              this proguard.jar is placed in c:\WTK\bin

              the changes to be made in defualt.pro are
              -keep public class org.kxml2.io.KXmlSerializer
              -keep public class org.kxml2.io.KXmlParser
              -dontoptimize

              again restart wtk toolkit.
              and now the application gets obfuscated and syncronizes properly..
              • 4. Re: syncronization error afer obfuscating jar file
                807581
                Thanks for the additional information. I haven't tried NB 6.5 yet, so I haven't seen this issue.
                • 5. Re: syncronization error afer obfuscating jar file
                  807581
                  I take that back - I am using NB 6.5.1 and I haven't seen this problem with either WTK 2.5.2 or 3.0