• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Socket doubt

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,

I Am new to J2ME world.

I Have written a code (Socket Client) which asks for server and port name at the starting.
connects to that web server
makes the request
waits & gets the response
finally displays it...

When I entered valid server & port name I got this Exception:
java.lang.SecurityException: Target port denied to untrusted applications
at com.sun.midp.io.j2me.socket.Protocol.connect(+62)
at com.sun.midp.io.ConnectionBaseAdapter.openPrim(+52)
at com.sun.midp.io.j2me.socket.Protocol.openPrim(+108)
at javax.microedition.io.Connector.openPrim(+233)
at javax.microedition.io.Connector.open(+15)
at javax.microedition.io.Connector.open(+6)
at SocketMIDlet.run(+88)


Why Am I getting this Exception?
Is there any way to get around this?

Thanks in Advance...
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya it looks like you are trying to access a secured port with an untrusted application
There are two possible solutions according to me:

1,Sign your application with a digital signature from thawte or some site like that.

2,use another port that is not used by any os services or another applications.

The second one worked for me,but its stupid.

Regards Syam
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi girish
i am also trying to get the response from the webserver by sending the request from the browser in j2me
but i am not all getting any response from the webserver.
my code is working in emulator and im able to get the response from the webserver.

im not all getting any exception or expected output in the mobile but the connection is getting established.
can you tell me how your sending the request from your application to the server
Thanks a lot
 
Girish Nagaraj
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I Am using socket to connect to the server.
 
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic