• 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
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

ConnectionNotFoundException

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

i am new to j2me and i am trying to open httpConnection and check the status when i try it on the emulator it works realy great but when i run it on my sonyericsson k500i it takes a long time trying to connect to the url and then exception thrown "ConnectionNotFoundException "

here is my code :



can any one help me ?? i am using midp 2.0

thanx in advance
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
It seems to work fine. Apparantly what I feel the reason behind the exception is at the http open connection line. The connection is opened in READ_WRITE mode. But the server may not give u the WRITE access permission. So better to open it READ mode. Let me know what happens?

Debojit
 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx for you replay, i'll let you know as soon as i can. but it seems that i finish the work today and i am going home so i'll send the replay tomorow

thanx again
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


i think you haven't used the way of sending request

try adding

hc.setRequestMethod(HttpConnection.POST)

or whatever your servlet accepts.

 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,thanx for your replays, i tried both solutions and i still have the same problem with the same exception !!!


any other ideas to do ??


thanx for replay again

i realy need to know what is the problem to stay working in the company that i am working in now please help!!!


 
sailesh sirari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

if your code is working fine on emulator i think

u should call that connection on seperate thread and put a timer also if

possible ,

try to call the connection inside run() or on a seperate class then make a

thread of that class inside your event or whatever logic u have

try this thread concept and see if it helps.
 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again , i did the Thread thing and i still have the same problem !!!


here is the MIDlet class Code :



here is the Thread Class code :






thanx for help, more ideas realy important

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

Is there any more ideas or what ?? any one say something please!!


thanx in advance
 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

no one replay on this problem any more ! is that mean that there is no more solution to send ?? however i read in some article that i must check the internet access protocolof my phone but i did not know what are these settings that i sould make ??
i have sonyericsson k500i. please can any one help ?? not only n the internet settings but in the whole problem

thanks in advance
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you haven't set which Internet Profile the phone should use for Java HttpConnections.

To do this, from the phone's main menu, select 'Connectivity, 'Settings for Java'. The Internet Profile you use will need to be associated with an appropriate 'Data Account'.

You may be better of creating a new Internet Profile and Data account from scratch. A good resource for the settings you will need is http://www.taniwha.org.uk/gprs.html .

Cheers,
James
 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
thanx for your replay, i find out that the connection cann't be made using the wab gprs but it works fine when i use the web gprs.
so is there any way to make it work through the wab by editting the settings from the j2me application ?!!


thanx in advance and thanx again for your replay.
 
Get off me! Here, read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic