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
Posts: 35
Registered: ‎09-11-2008
My Device: Not Specified
Accepted Solution

Registering MIDlets with the PushRegistry

Mark & anyone else that can help,

   I am trying to run the DynamicPushRegistry example found here:

 

How To - Register a MIDlet with the PushRegistry
Article Number: DB-00390

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800429/How_To_...

 

However, when I compile this and try to execute this on my BlackBerry 8310, I get the following error:

 

"javax.microedition.ConnectionNotFoundException: socket://:5000 does not support push"

 

I tried switching the protocol from

"PushRegistry.registerConnection("socket://:5000......" to "PushRegistry.registerConnection("sms://:5000....) and got the following different error displayed on my BlackBerry:

 

"java.lang.ClassNotFoundException: Midlet 'text.javax.microedition.midlet.DynamicPushRegistry' is not in current suite"

 

Related to this, I am interested in trying out the static PushRegistry example and was reading the following:

 

How To - Create an auto-start MIDlet using the PushRegistry
Article Number: DB-00385

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800429/How_To_...

 

It says, "After the modified JAD file has been added to the project, the COD file must be recompiled for auto-registration with the PushRegistry to be applied to the MIDlet." Pardon my ignorance, but how is one to "recompile" the COD file in the JDE without changing the JAD file that has just been modified? I must be missing something. I am currently running version BlackBerry version 4.2.2.170. Any help with these questions would be greatly appreciated. Thanks.

Highlighted
BlackBerry Development Advisor
Posts: 15,814
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Registering MIDlets with the PushRegistry

Regarding the socket error, has this BlackBerry been setup on a BlackBerry Enterprise Server (required for push connections)?

 

The ClassNotFoundException is probably caused by specifying an incorrect package and/or class name.  Please verify the name you have entered in the JAD file.

 

Please make sure that the JAD file has been added to the project.  This ensures that it is not modified when the application is built.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
New Developer
Posts: 35
Registered: ‎09-11-2008
My Device: Not Specified

Re: Registering MIDlets with the PushRegistry

Mark,

   Thanks for the hints Mark. That fixed the problems.

-J

New Developer
Posts: 35
Registered: ‎09-11-2008
My Device: Not Specified

Re: Registering MIDlets with the PushRegistry

Mark,

   Is there any way to manually compile my MIDlets and edit my JAD file, using Eclipse instead of the BlackBerry JDE and still get my PushRegistry to work? I have been trying this with no success. Upon loading my application through the Blackberry Desktop Manager, I do not get the normal PushRegistry permission prompts at installation and my application does not work. I am developing my MIDlets in eclipse, and then manually compiling the COD files and generating the ALX files. I then edit the JAD file appropriately to reflect the PushRegistry functionality. What am I doing wrong? Thanks.

-J

New Developer
Posts: 9
Registered: ‎05-22-2009
My Device: Not Specified

Re: Registering MIDlets with the PushRegistry

Make sure your push registry look like this:

 

MIDlet-Push-1: sms://:50234, com.test.midlet.MyMIDlet, *

 

If you are developing a MIDlet suite, this MIDlet should be the FIRST midlet featuring the index of "1".  I also use Eclipse to compile mine to via the JDE plugin (sometimes I even use the Wireless toolkit).  Afterwards run the rapc with the jar file AND jad file using the -midlet options.  This should produce the COD file and a NEW jad file.  This should work. :-)

 

Let me know.

New Developer
Posts: 9
Registered: ‎09-01-2008
My Device: Not Specified

Re: Registering MIDlets with the PushRegistry

Hi,

 

I am getting the same error on the simulator - "ConnectionNotFoundException: socket://:5000 does not support push".

I am using JDE/Simulator 4.1.

I am using static registration and using deviceside=true in the jad. Does the simulator also need Enterprise Activation before allowing socket push?

 

Thanks,

Debashis