I am having trouble accessing a servlet through my imlet. the exception is thrown when I try to open the inputstream. There are no problems with my SIM as I can send/receive sms, make calls etc with the imlet. I can also create a GPRS connection when the SIM is in my phone.
Here's the code i am using to access the servlet
InputStream dis = null;
DataOutputStream dos = null;
HttpConnection c = null;
InputStream is = null;
String url = "http://193.118.193.73:16000/ModuleServlet?status=okay"
c = (HttpConnection)Connector.open( url );
is = c.openInputStream(); // the exception is thrown here.
Here is the excpetion that is thrown :
java.io.IOException
at com.sun.cldc.io.j2me.socket.PrivateOutputStream.write(+58)
at java.io.DataOutputStream.write(+10)
at java.io.OutputStream.write(+8)
at com.sun.midp.io.j2me.http.Protocol.connect(+406)
at com.sun.midp.io.j2me.http.Protocol.openInputStream(+64)
at example.rs232demo.RS232Demo.connect(+36)
at example.rs232demo.RS232Demo.startApp(+20)
at javax.microedition.midlet.Main.main(+157)
This is an ongoing problem and i really need it sorted .
Hi, I had the same problem trying to open an input stream using GPRS a while ago...
An IOException will be thrown if an error occurs while trying to open a connection over GPRS. Firstly, make sure the SIM you are using is activated for GPRS - check with your network provider.
Then double check your GPRS network settings are correct:
1. APN
2. Username
3. Password
4. etc...
Then also, since you are trying to open HTTP connection, your HTTP configuration settings need to be setup seperately from the bearer settings.
got it sorted. it was sim card related. the sims worked fine in mobiles over gprs but just don't work in the n12. got a new set of sims sim and it worked fine.
thanks for the help.
what is your "a new set of sims sim"?
2004-11-11, 05:36#4