Just An Application

March 27, 2011

“No MIDlet-<n> registration” ?

Filed under: Java, JME, Meta, MIDlets, MIDP, Push Registration — Tags: , , , , — Simon Lewis @ 9:36 am

This is another in the occasional series of meta or recursive posts prompted by the appearance of a specific query in the list of search terms used by people who have ended up here, despite the fact that I have not written about it.

In this case the query is the gnomic

No MIDlet-<n> registration

It looks as though it is probably an error message and it turns out that it is.

Like the subject of this post, it originates in the company formerly known as SUN‘s MIDP implementation.

If you do this at runtime

    PushRegistry.registerConnection("socket://:8888", "xper.midlet.Lamiel", "*")

but the only thing in the JAD and/or JAR manifest of your MIDlet suite is this

    MIDlet-1: UsefulMIDlet, UsefulMIDletIcon.png, xper.midlet.Colgrevance

and you are using the TCFKAS MIDP implementation then you will get a ClassNotFoundException with the message

    No MIDlet-<n> registration

even if the MIDlet suite JAR contains the class xper.midlet.Lamiel

Why ?

Because, as it says, in the documentation

The named MIDlet MUST be registered in the application descriptor or the JAR manifest with a MIDlet-<n> record.

Adding something like this

    MIDlet-2: PushableMIDlet, PushableMIDletIcon.png, xper.midlet.Lamiel

to the JAD and/or JAR manifest of the MIDlet suite in the example above would fix the problem.

The same problem, but not the same error message, occurs with static registration.

If the JAD and/or JAR manifest of the MIDlet suite only specifies these attributes

    MIDlet-1: UsefulMIDlet, UsefulMIDletIcon.png, xper.midlet.Colgrevance
    MIDlet-Push-1: socket://:8888, xper.midlet.Lamiel, *

then the MIDlet suite will not install.

As before, the second MIDlet needs to be registerd

    MIDlet-1: UsefulMIDlet, UsefulMIDletIcon.png, xper.midlet.Colgrevance
    MIDlet-2: PushableMIDlet, PushableMIDletIcon.png, xper.midlet.Lamiel
    MIDlet-Push-1: socket://:8888, xper.midlet.Lamiel, *

Note that the ordinals of the

    MIDlet-<n>

and

    MIDlet-Push-<n>

attributes do not have to match, they identify the attributes not the MIDlets.


Copyright (c) 2011 By Simon Lewis. All Rights Reserved.

Create a free website or blog at WordPress.com.

%d bloggers like this: