Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
aaargh
Posts: 28
Registered: ‎01-05-2009
My Device: Not Specified

Invalid JAR when installing MIDlet

I've got a JAD/JAR that installs fine on a BB Storm 9500 and I'm trying to install it on a BB Curve 8310.

 

It fails with a '907 Invalid JAR' error, furthermore it refers to 2 COD files (which I never made, I just tried to install a jad/jar, I have no clue where the COD's are coming from) with the error message: <name application>-1.cod data section too large: 69256 bytes.  it also complains about <name application>-2.cod with the same error, only the size is 65176. The whole app is about 660kbyte and installs fine on hundreds of other phones, even Samsung and LG crap.

 

A few questions: 

1) Where are the COD's coming from

2) Why does this app run fine on the Storm but not on the Curve

3) What's the data section mentioned and how can I control the size of it ? 

 

A second attempt at installing crashed the browser with a java.lang.outOfMemoryException, a third attempt crashed the phone with an error 523.

 

The phone's version is reported as 4.2.2.173 (platform 2.5.0.32) 

Please use plain text.
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Invalid JAR when installing MIDlet

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Invalid JAR when installing MIDlet

To summarize what you will find in that link, the extra COD files are generated by the RAPC compiler. There are hard COD file limitations in the exection environment, so your files are broken up into chunks that will run. Each compiler-generated chunk will named with your base project name and an extension like -1 -2, etc. These chunks are globbed together into one big COD file, which is actually just a ZIP archive.

 

For OTA distribution, you'll need to unzip this archive to extract the individual COD files. Simply rename the file to a ZIP extension, then extract all.

 

For distribution, you will deploy all of the individual COD files and the JAD file.

 

 

Please use plain text.
New Developer
aaargh
Posts: 28
Registered: ‎01-05-2009
My Device: Not Specified

Re: Invalid JAR when installing MIDlet

To summarize what you will find in that link, the extra COD files are generated by the RAPC compiler. 

 

What RAPC compiler ? I'm building a normal JAD/JAR, not a COD. Hence my question: where do the COD's come from since I didn't provide any.

 

 Simply rename the file to a ZIP extension, then extract all.

 

That would leave me with a directory full of (obfuscated) .class files and some images. 

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Invalid JAR when installing MIDlet

From the BlackBerry deployment guide:

 

The BlackBerry JDE provides tools for converting existing MIDlets that are in the form of .jad and .jar

files into .cod files for use on a BlackBerry device. Visit www.blackberry.com/knowledgecenterpublic/ to read

article DB-00055, which provides information about recompiling MIDlets.

Please use plain text.
New Developer
aaargh
Posts: 28
Registered: ‎01-05-2009
My Device: Not Specified

Re: Invalid JAR when installing MIDlet

I've got the whole COD insanity working, at least so far that the application installs now. However, after installation, there is no application to be found in the menu. It *is* listed in the list of installed applications, but there's no way to actually start it.

 

Any clues on I'm doing wrong ? 

Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Invalid JAR when installing MIDlet

If you device has a "Downloads" folder, look there.

 

Please use plain text.
New Developer
aaargh
Posts: 28
Registered: ‎01-05-2009
My Device: Not Specified

Re: Invalid JAR when installing MIDlet

It doesn't have a downloads folder, it doesn't have any folders. All previously installed applications live in the main menu.
Please use plain text.
Developer
RexDoug
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Invalid JAR when installing MIDlet

That's a new one for me.

 

If you have not set an application icon for the HomeScreen, then you should at least get a default icon that looks like a DOS command window. When you roll over this icon, it would display your app name on the status line.

 

 

 

Please use plain text.
New Developer
aaargh
Posts: 28
Registered: ‎01-05-2009
My Device: Not Specified

Re: Invalid JAR when installing MIDlet

If you have not set an application icon for the HomeScreen, then you should at least get a default icon that looks like a DOS command window.

 

I tried removing the icon, thinking it could be the wrong size or file format but that doesn't help. I also tried it on a BB 8820 and I get the exact same result. 

Please use plain text.