Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Java2ME ServerSocketConnection: ConnectionNotFoundException

Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

I'm using Java2ME (MIDP2.0) to establish server connections on my device. However, I'm having trouble using the method to construct a ServerSocketConnection instance. I use the following code:

ServerSocketConnection serv = (ServerSocketConnection)"socket://:80");

I get the following ConnectionNotFoundException: "Cannot create socket, //:80". I do not think this is a security issue: for one, because I don't get a SecurityException, and secondly because I explicitly ask for permission to use ..Connector.socket, ..Connector.http, and ..Connector.serversocket in the JAD file. I haven't tried signing the midlet suite yet, as this would take quite some time and I'm actually just testing some code. I've also tried using another port (and using "serversocket://:80" instead of "socket://:80", more out of desperation); also, I have tried entering "localhost" and "" in front of the port number, but all to no avail. I have been able to successfully use this method to construct SocketConnection instances, however. Can this be because my particular device (HTC Touch Cruise, JBED build 20080428.2.1) simply does not support server socket connections?

Thanks in advance,

Uh oh, we're definitely being carded. Here, show him this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
    Bookmark Topic Watch Topic
  • New Topic