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
BlackBerry Development Advisor
Posts: 15,723
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: invalid jar

Please try the following:

 

1.  Use a link that contains the jar file name.

2.  Remove the :8080 port from the URL (requires the JAR to be accessable on port 80).

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: invalid jar

I spent forever trying to fool a cold fusion server on one hosting company into faking the mime type.

I've got an auto-dispatch page that replies using the PROFILE header, NOT JUST the UA header as

this points to an APPLICATION, not a device. This has worked quite well for picking things

like icon size and other info. I'd have to see if I ended up using the UA information for software

version as I also pick cod files based on specific platform.

 

So, i have some tools for this Smiley Happy

 

 

I used wget, and the first link not work,

 

$ wget -O ~/xxx -S -v --header "profile: $bbprof" --user-agent="$ua" "http://un
kasoft.com/demos/t/bodytrainer.jad"
--11:16:50--  http://unkasoft.com/demos/t/bodytrainer.jad
           => `/home/Administrator/xxx'
Resolving unkasoft.com... 74.52.138.149
Connecting to unkasoft.com[74.52.138.149]:80... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Date: Fri, 19 Sep 2008 15:12:16 GMT
 3 Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.8e DAV/2 mod_jk/1.2.22
PHP/5.2.2 SVN/1.4.3 mod_python/3.3.1 Python/2.4.4 mod_perl/2.0.2 Perl/v5.8.8
 4 Last-Modified: Wed, 17 Sep 2008 10:04:55 GMT
 5 ETag: "7b0002-1d7-999cdfc0"
 6 Accept-Ranges: bytes
 7 Content-Length: 471
 8 Keep-Alive: timeout=5, max=100
 9 Connection: Keep-Alive
10 Content-Type: text/vnd.sun.j2me.app-descriptor

100%[====================================>] 471           --.--K/s

11:16:50 (4.49 MB/s) - `/home/Administrator/xxx' saved [471/471]

 

 

$ wget -O ~/xxx -S -v --header "profile: $bbprof" --user-agent="$ua" "http://ad
onfly.mobi:8080/bodytrainer/ap?id=1&loc=es_ES"
--11:16:07--  http://adonfly.mobi:8080/bodytrainer/ap?id=1&loc=es_ES
           => `/home/Administrator/xxx'
Resolving adonfly.mobi... 75.125.215.242
Connecting to adonfly.mobi[75.125.215.242]:8080... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Server: Apache-Coyote/1.1
 3 Set-Cookie: JSESSIONID=126CEF22B331DF079329BDD867D5B4D7; Path=/bodytrainer
 4 Content-Length: 0
 5 Date: Fri, 19 Sep 2008 15:11:33 GMT
 6 Connection: keep-alive

    [ <=>                                 ] 0             --.--K/s

11:16:07 (0.00 B/s) - `/home/Administrator/xxx' saved [0/0]

 

$ echo $bbprof
http://www.blackberry.net/go/mobile/profiles/uaprof/8100/4.2.1.rdf
$ echo $ua
BlackBerry7130e/4.1.0 Profile/MIDP-2.0Configuration/CLDC-1.1 VendorID/105

New Developer
Posts: 8
Registered: ‎09-12-2008
My Device: Not Specified

Re: invalid jar

are that points requirements for blackberry devices?

 

 

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: invalid jar

If that first link you posted is complete, it returns a zero lenght result even with the ua and prof I posted.

Is it more selective than that?

This has nothing to do with BB or Rim.

New Developer
Posts: 8
Registered: ‎09-12-2008
My Device: Not Specified

Re: invalid jar

first link is ok:

 

C:\Users\javi>wget -U "BlackBerry8800/4.2.1 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/133" "h
ttp://adonfly.mobi:8080/bodytrainer/ap?id=1&loc=es_ES" -qO-
Manifest-Version: 1.0
MIDlet-Vendor: Unkasoft
MIDlet-Version: 1.0.0
MIDlet-1: bodytrainer,icon.png,com.unkasoft.j2me.games.bodytrainer.BodyTrainerMIDlet
MicroEdition-Configuration: CLDC-1.0
Created-By: Unkasoft
MIDlet-Name: bodytrainer
MicroEdition-Profile: MIDP-2.0
MIDlet-Jar-URL: http://adonfly.mobi:8080/bodytrainer/ap?p=71&tr=121
MIDlet-Jar-Size: 121120
MIDlet-Install-Notify: http://adonfly.mobi:8080/bodytrainer/ap?tr=121&t=0
MIDlet-Delete-Notify: http://adonfly.mobi:8080/bodytrainer/ap?tr=121&t=1

 

if you get a 0 lenght response is due to UA send is not compatible with application:

 

C:\Users\javi>wget -U "TEST" "http://adonfly.mobi:8080/bodytrainer/ap?id=1&loc=es_ES"
--18:15:21--  http://adonfly.mobi:8080/bodytrainer/ap?id=1&loc=es_ES
           => `ap@id=1&loc=es_ES.1'
Resolving adonfly.mobi... done.
Connecting to adonfly.mobi[75.125.215.242]:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0

    [ <=>                                 ] 0             --.--K/s

18:15:22 (0.00 B/s) - `ap@id=1&loc=es_ES.1' saved [0/0]

 

 

 

New Developer
Posts: 8
Registered: ‎09-12-2008
My Device: Not Specified

Re: invalid jar

we solved the problem adding "&rim_read_the_standard_please.jar" at the of URL

 

final url look like this:

http://j2meserver.com:8080/service/ap?id=1&param2=4&jarname.jar

 

when blackberry device finds dot jar, index of bounds excepction is not thrown and application works fine.

 

thanks for your time, i hope this post can be useful for people with same problem.