×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    3

    907 invalid JAR duplicate definition for 'c' in c

    I have an application which is produced using Netbeans and the Sun Wireless toolkit.

    The jar downloads fine into a Nokia device (N95)

    This program has also been running succesfully running on various Blackberry devices such as the Storm and others by downloading the jar/jad files over the air via a web page.

    I recently made some minor changes and now I get the following message when trying to download the application via a web browser. I reversed the changes but the problem remains.

    "907 invalid JAR duplicate definition for 'c' in c" (This was on a BB 8310 curve)

    I also get a very similar message when attempting to convert the JAD and JAR file to an ALX/COD file using a third party utility (Jar 2 ALX from Brandon Swift Creations) so it confirms that something is wrong with my JAD/JAR.

    What else has changed.

    I installed windows 7.0 and installed Netbeans 6.8 with Wireless toolkit version 2.5.2 as before.

    Now it gets really interesting.

    I copied my source to an old system running Netbeans 5.0 with WTK 2.2 and the jar files it produced were OK and loaded on the Blackberry OK. However I deleted the project and recreated it on the Netbeans 5.0/WKT 2.2 system. The new jar files that the new project created no longer worked on the Blackberry.

    Any ideas ?

    This is the JAD

    MIDlet-1: Aircraft Data,/icon.png,AircraftData.AircraftData
    MIDlet-2: Airport Data,/icon.png,AirportData.AirportData
    MIDlet-3: Flight Planning,/icon.png,FlightPlanning.FlightPlanning
    MIDlet-4: Navigation,/icon.png,Navigation.Navigation
    MIDlet-5: Weight & Balance,/icon.png,WeightBalance.WeightBal
    MIDlet-6: Online Weather,/icon.png,Airmet.GetAirmet
    MIDlet-Info-URL: http://www.aviatorcalc.com
    MIDlet-Jar-Size: 226905
    MIDlet-Jar-URL: AviatorCalc.jar
    MIDlet-Name: AviatorCalc
    MIDlet-Vendor: Bob Rathbone
    MIDlet-Version: 3.41
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0


    Bob Rathbone

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: 907 invalid JAR duplicate definition for 'c' in c

    This is a uniquely BlackBerry problem, since it's occuring when the JAR is converted to a BB COD file. You might want to check out the BlackBerry Developer Zone.

    Does the problem disappear if you don't obfuscate the application?

    Graham.

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    3

    Re: 907 invalid JAR duplicate definition for 'c' in c

    I have also posted on the Blackberry forum.
    I will try not obfuscating to see if this makes a difference.

    By the way I don't convert the over the air distribution to cod. It is a normal jad and jar file that I distribute.
    I guess the Blackberry does the conversion during the download.

    I have another smaller program of about 60K which downloads (or converts to COD) without problem.

    Many thanks for replying.

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: 907 invalid JAR duplicate definition for 'c' in c

    The BlackBerry always downloads a COD - JARs are converted by the BlackBerry servers, which process pretty much all traffic on the way to your phone.

    My first guess is that the obfuscator is massively overloading names in the classes, and this is confusing the JAR to COD conversion.

  5. #5
    Registered User
    Join Date
    Dec 2003
    Posts
    3

    Re: 907 invalid JAR duplicate definition for 'c' in c

    Further testing shows that this seems to be associated with the obfuscator in netbeans 6.8. If I switch off the obfuscator then it converts fine. However my jar file is of course nearly twice the size.

    I will see if I can set net beans up with another obfuscator

  6. #6
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: 907 invalid JAR duplicate definition for 'c' in c

    I'm not a NetBeans user, so I can't tell you how to fix this. However, I suspect the obfuscator is proguard, and switching to an older version of proguard is sometimes helpful (especially if you're using a beta version of proguard). It is also possible to change the proguard options to reduce the level of name-overloading, which might fix your problem. You'll need to spend some time reading through the proguard docs (and the Ant docs, if you're not familiar with Ant scripts), unless NetBeans has some simple option for this. It might be worth posting a question about controlling obfuscation in NetBeans in the Tools and SDKs board (or the NetBeans user forum, you'll need to Google to find that).

    Graham.

Similar Threads

  1. Error loading connection when obfuscation high?
    By ejakkk in forum Mobile Java General
    Replies: 8
    Last Post: 2009-06-26, 12:54
  2. need information about j2me polish
    By rathikathangaraj in forum Mobile Java General
    Replies: 4
    Last Post: 2007-12-19, 09:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •