I think there's a big bug. Too many MIDlets dont work: also Sun's examples. I post here a Sun's sample, a very simple MIDlet with an http connection: This doesnt work on a Nokia 7650.

I've found this code here:
http://wireless.java.sun.com/midp/ttips/httpthrds/

/**********BEGIN CODE******************/
import java.io.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.*;

// Simple class that connects to a given URL and
// prints out the response code and any headers
// that are sent back. Shows how to use background
// threads to make HTTP connections while keeping the
// user interface alive.

public class HttpLogger extends MIDlet {

private Display display;

private Command exitCommand =
new Command( "Exit", Command.EXIT, 1 );
private Command okCommand =
new Command( "OK", Command.OK, 1 );
private Command cancelCommand =
new Command( "Cancel", Command.CANCEL, 1 );

private URLEntry mainForm;

// Standard MIDlet stuff....

public HttpLogger(){
}

protected void destroyApp( boolean unconditional )
throws MIDletStateChangeException {
exitMIDlet();
}

protected void pauseApp(){
}

protected void startApp()
throws MIDletStateChangeException {
if( display == null ){
initMIDlet();
}
}

private void initMIDlet(){
display = Display.getDisplay( this );
mainForm = new URLEntry();
display.setCurrent( mainForm );
}

public void exitMIDlet(){
notifyDestroyed();
}

// Utility routine to display exceptions.

void displayError( Throwable e, Displayable next ){
Alert a = new Alert( "Exception" );
a.setString( e.toString() );
a.setTimeout( Alert.FOREVER );
display.setCurrent( a, next );
}

// Simple entry form for entering the URL to
// connect to.

class URLEntry extends TextBox
implements CommandListener {

URLEntry(){
super( "Enter URL:", "java.sun.com",
100, 0 );
addCommand( exitCommand );
addCommand( okCommand );
setCommandListener( this );
}

public void commandAction( Command c,
Displayable d ){
if( c == exitCommand ){
exitMIDlet();
} else if( c == okCommand ){
try {
HttpConnection conn =
(HttpConnection)
Connector.open( "http://" +
getString() );
display.setCurrent(
new Logger( this, conn ) );
}
catch( IOException e ){
displayError( e, this );
}
}
}
}

// Simple form that contains a single string item.
// The string item is updated with status messages.
// When constructed, it starts a background thread
// that makes the actual HTTP connection. Displays
// a Cancel command to abort the current connection.

class Logger extends Form
implements Runnable, CommandListener {
private Displayable next;
private HttpConnection conn;
private StringItem text =
new StringItem( null, "" );

Logger( Displayable next,
HttpConnection conn ){
super( "HTTP Log" );

this.next = next;
this.conn = conn;

addCommand( cancelCommand );
setCommandListener( this );

append( text );

Thread t = new Thread( this );
t.start();
}

// Handle the commands. First thing to do
// is switch the display, in case closing/
// the connection takes a while...

public void commandAction( Command c,
Displayable d ){
display.setCurrent( next );

try {
conn.close();
}
catch( IOException e ){
displayError( e, next );
}
}

// Do the connection and processing on
// a separate thread...

public void run(){
update( "Connecting to " + conn.getURL() );

try {
int rc = conn.getResponseCode();
update( "Response code: " + rc );
update( "Response message: " +
conn.getResponseMessage() );

String key;

for( int i = 0;
( key =
conn.getHeaderFieldKey( i ) )
!= null;
++i ){
update( key + ": " +
conn.getHeaderField( i ) );
}
}
catch( IOException e ){
update( "Caught exception: " +
e.toString() );
}

removeCommand( cancelCommand );
addCommand( okCommand );
}

// Update the string item with new information.
// Only do it if we're actually visible.

void update( String line ){
if( display.getCurrent() != this ) return;

String old = text.getText();
StringBuffer buf = new StringBuffer();

buf.append( old );
if( old.length() > 0 ){
buf.append( '\n' );
}

buf.append( line );
text.setText( buf.toString() );
}
}
}
/********************END CODE*****************************/
rgds
Antonio Terreno