i am trying to invoke a servlet from a midlet
both residing on my computer but i get an exception
javax.microedition.io.ConnectionNotFoundException: TCP open
The connection string "http://localhost:8080/servlets-examples/servlet/HelloServlet"
works pretty well in the mozilla browser but fails in the midlet
what could be the problem and how can i solve it?

Recommended Answers

All 2 Replies

Read my other reply here

well,it seems i provided a limited information
but i think this will make more clarification
i placed the HelloServlet in the directory C:\apache-tomcat-5.5.29\webapps\servlets-examples\WEB-INF\classes
and i specified the url connection string in the midlet as http://localhost:8080/servlets-examples/servlets/HelloServlet
By the way i am using windows vista and i have even tried to turn off the firewall
but i still get an exception
javax.microedition.io.ConnectionNotFoundException: TCP open
at com.sun.midp.io.j2me.socket.Protocol.connect(+99)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+52)
at com.sun.midp.io.j2me.socket.Protocol.openPrim(+108)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+14)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+8)
at com.sun.midp.io.j2me.http.Protocol.connect(+73)
at com.sun.midp.io.j2me.http.Protocol.streamConnect(+57)
at com.sun.midp.io.j2me.http.Protocol.startRequest(+12)
at com.sun.midp.io.j2me.http.Protocol.sendRequest(+38)
at com.sun.midp.io.j2me.http.Protocol.sendRequest(+6)
at com.sun.midp.io.j2me.http.Protocol.openInputStream(+9)
at InvokeSampleMIDlet1.invokeServlet(+61)
at InvokeSampleMIDlet1.startApp(+23)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.