motorola l6 IOException

Hi im developing a application that communicate with a php server. Im using a motorola L6 as test, but the application doesn't work, when i try to establish the http connection i receive a IOException from the run method. I dont now why, also is the same in a motorola pebl u6. This is only in a real test, because in the wtk simulatorall work fine, also in the palmsim simulator. Plis help me, here is the code of the comunication part, the exception is in the public void run() method:midlet.setAlarm("Error al correr el thread:"+e.toString()) and is a java.io.IOException;

/*

* Comunicacion.java

*

* Created on April 12, 2007, 11:11 AM

*

* To change this template, choose Tools | Template Manager

* and open the template in the editor.

*/

import java.io.*;

import javax.microedition.io.*;

/**

*

* @author DANNIEL

*/

publicclass Comunicacionimplements Runnable{

private Thread t;

private PassW midlet;

private String url="http://www.tmspan.com/midlet/passp.php",nombre="",password="";

/** Creates a new instance of Comunicacion */

public Comunicacion(PassW m){

midlet=m;

}

publicvoid conectar(String n, String p){

nombre=n;password=p;

t=new Thread(this);

try{

t.start();

}catch(Exception e){

midlet.setAlarm("Error al iniciar el thread:"+e.toString());

}

}

publicvoid run(){

try{

procesaRes();

}catch(Exception e){

midlet.setAlarm("Error al correr el thread:"+e.toString());

//System.err.println("Error:"+e.toString());

}

}

privatevoid procesaRes()throws IOException{

InputStream in=null;

OutputStream out=null;

StringBuffer respuesta=new StringBuffer();

HttpConnection conn=null;

String data="nombre="+nombre+"&password="+password;

System.out.println(data);

try{

conn=(HttpConnection) Connector.open(url);

conn.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.0");

conn.setRequestProperty("Content-Language","es-ES");

conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");

conn.setRequestProperty("Content-Length",Integer.toString(data.length()));

conn.setRequestMethod(HttpConnection.POST);

out=conn.openOutputStream();

out.write(data.getBytes());

//out.flush();

if(conn.getResponseCode() == HttpConnection.HTTP_OK){

int ch;

in=conn.openInputStream();

while( (ch = in.read()) != -1){

respuesta.append((char) ch);

}

midlet.setRespuesta(respuesta.toString());

}

else midlet.setAlarm("Servidor dice:"+conn.getResponseMessage());

// System.out.println(conn.getResponseMessage());

}catch(IOException e){

midlet.setAlarm("Error de conexion:"+e.toString());

// System.err.println("Error: " + e.toString());

}finally{

if(out!=null)out.close();

if(in!=null) in.close();

if(conn !=null) conn.close();

}

}

}

[5824 byte] By [locho0424a] at [2007-11-27 1:21:00]
# 1
have you tried with:conn.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.1");because your MOTO are CLDC 1.1?
suparenoa at 2007-7-11 23:58:26 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
Mmmm no, thanks i will try if this work
locho0424a at 2007-7-11 23:58:26 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
Hi again, i tried by changing conn.setRequestProperty("User-Agent","Profile/MIDP-2.0 Configuration/CLDC-1.1"); but i still have the IOException in the run method, i dont now what can be, plis help me
locho0424a at 2007-7-11 23:58:26 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
have you tried with decommenting the out.flush() ?
suparenoa at 2007-7-11 23:58:26 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
Yeah, of course. Also yesterday i install my application on a palm tx with IMB j9 vm and all work fine, the program open the connection and send and receive data from the php server, fine. But in motorola l6 i receive the exception when i tried to send the data.
locho0424a at 2007-7-11 23:58:26 > top of Java-index,Java Mobility Forums,Java ME Technologies...