Javax.microedition.io.ConnectionNotFoundException: TCP open

i am running my application this connecting to my local servers's web pages but when i try to connect to other internet servers then i am getting following error plz help me in solving this problem.....
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)
Uncaught exception java/lang/NullPointerException.
at com.sun.midp.io.j2me.http.Protocol.sendRequest(+6)
at com.sun.midp.io.j2me.http.Protocol.getResponseCode(+8)
at QuoteRetriever.run(+43)

s there any embeded database for j2me?RMS is the database for j2me.
You can either use RMS or Files to store your application data. Please note Not all devices support File system access and files written by your application can also be seen by user while he explores the file system.
RMS is supported by all MIDP devices. RMS data cannot be seen in file system. You can set access setting while creating the recordstore.
As you have solved your problem, please mark this question as answered.
Atul

Similar Messages

  • "javax.microedition.io.ConnectionNotFoundException: TCP open" Exception

    Dear All,
    I get "javax.microedition.io.ConnectionNotFoundException: TCP open" exception in J2ME program written by netbean with WTK2.0.
    I found out the exception got when I submit the URL to internet address (e.g. www.yahoo.com or www.google.com).
    However, the exception does not exist when I submit the URL to the host in intranet (e.g. 10.X.X.X)
    Do anyone of you have similar problem and could teach me how to submit the URL without the exception to internet address.
    Regrads and Thanks,
    Kelvin

    Hmm, try starting the thread from outside the constructor.
      (new Thread(new Connection(ipDb.getNextRecord()))).start(); Probably not the best practice to start threads in constructors. Also, it's highly likely that the device will only do 1 single network connection at a time anyway, even if you use multiple threads. This will be why it locks up the app, because the one internal OS thread that handles all the network IO is blocked, none of the other connection threads can do anything.

  • Javax.microedition.io.ConnectionNotFoundException: socket open: failed

    I am deploying my java midlet application in several phones and few of them faces the following exception when I tried establishing a Socket connection:
    javax.microedition.io.ConnectionNotFoundException: socket open: failed
    Does anyone have any suggestion to this?
    Please help as this is urgent. Thanks you.

    I think your request is not reaching to the server, or reaching but server is not responding plz chk the server settings
    Regards
    @rjun

  • HttpConnection - javax.microedition.io.ConnectionNotFoundException: TCP ope

    Hello all
    I am trying to connect to the www and I keep getting this message.
    Here's the code snippet.
    public void run(){
       DataInputStream in = null;  
       HttpConnection conn = null;
      try{  
       if (listWhatToDo.getSelectedIndex() == 0){
         conn = (HttpConnection)Connector.open("http://www.daimi.au.dk/~fah/resources/pvc/j2me-runservice.png");
         int length = (int)conn.getLength();
         byte[] data = null;
         if (length !=-1){
           data = new byte[length];
           in = new DataInputStream(conn.openInputStream());
           in.readFully(data);
    // and so on.It is a link to the address of a .png file on a web page which I found yesterday and I know still exists!
    My firewall also comes up with the message saying that the emulator is try to connect (I am fairly certain that everytime of the XXX times I have tried running the code, I have allowed it to connect. Unless I am confusing "Yes" with "No").
    The emulator then seems to think about it but then always comes back with the message shown in the title and a length variable of -1.
    What's the problem?
    Cheers
    Dan

    Sorry ignore me. I'm a plumb.
    Although my Firewall was allowing the emulator to communicate with the internet site it wasn't allowing incoming from the internet. - it took me while to think of that one. What a wally.
    Hope this serves as a lesson to anyone else who has the same problem.
    Sorry
    Dan

  •   javax.microedition.io.ConnectionNotFoundException 

    Hi,
    I'm using j2me wireless toolkit 1.0.3 for testing a small program.. it is working fine for http connection.. but when i'm using socket connection.. i'm getting the following error.. with all the devices.. i would b thankful to u if i u can advice me to rectify it...
    javax.microedition.io.ConnectionNotFoundException: The requested protocol does not exist Socket://jabber.org:5222
    regards
    Sato.

    Hi try it with "socket" so without the capital "S"!

  • Network error : Connection cannot found : TCP Open in J2ME

    Hi all,
    I am using Wireless Toolkit 2.5, when the application tries to connect IIS server, it won't work. the error is:
    IOException javax.microedition.io.ConnectionNotFoundException: TCP open
    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.closeOutputStream(+4)
         at com.sun.midp.io.BaseOutputStream.close(+14)
         at HttpInputOutputStreamNet.getGrade(+190)
         at HttpInputOutputStreamNet.startApp(+8)
         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(+116)
    but, file in localhost and ip address of the server works well, that is url with ip address for the server works but the host name not works. The url's www.something.com and http://www.javacourses.com/hello.txt works fine.
    May anybody help this problem

    Jaime,
    Hay un ejemplo que tenemos en el web que te puede servir. Se llama Reconnect TCP Connection y creo que te puede ayudar en este caso.
    Saludos,
    Nestor S.
    Nestor
    National Instruments

  • RecordStoreFile.class under javax.microedition.rms.*

    Hi, I am developing an application program for Nokia Series 40.
    My program requires me to access file system, but Nokia Series 40 doesn't provide additional APIs (JSR 75).
    I assume that I may use RecordStoreFile class under javax.microedition.rms.* to open system directory, but somehow it doesn't allow me to use it. I get an error message saying 'The type RecordStoreFile is not visible...'
    What can I do?

    The recordstore is not meant to be used this way (and can't be used this way). If you can't access the filesystem by some JSR, or Nokia api, you simply cannot do that at all.

  • Javax.microedition.lcdui.TextField.setChars exception

    Hi
    I am developing an application for Mobile Banking for my College Project the program need to send an SMS with the Name and PIN no. I am using Sun WTK 2.3 the program compiles and preverifies correctly but when the Submit button is pressed an Illegal exception is thrown.
    java.lang.IllegalArgumentException
         at javax.microedition.lcdui.TextField.setChars(+105)
         at javax.microedition.lcdui.TextField.setString(+27)
         at CheckBal.commandAction(+157)
         at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
         at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
         at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
         at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(+47)
         at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+250)
    This is the code.....
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import java.io.IOException.*;
    import javax.microedition.io.*;
    import javax.wireless.messaging.*;
    public class CheckBal extends MIDlet implements CommandListener
    private Form form;
    private Command exit;
    private Command submit;
    private Display display;
    TextField t1;
    TextField t2;
    public CheckBal()
    display = Display.getDisplay(this);
    exit = new Command("Exit", Command.EXIT, 1);
    submit = new Command("Submit", Command.OK, 1);
    form = new Form("Check Balance");
    public void startApp()
    t1 = new TextField("First Name:", "",30, TextField.ANY);
    t2 = new TextField("Enter PIN:", "",4, TextField.ANY);
    form.addCommand(exit);
    form.addCommand(submit);
    form.append(t1);
    form.append(t2);
    form.setCommandListener(this);
    display.setCurrent(form);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
    public void commandAction(Command command, Displayable displayable)
    if (command == exit)
    destroyApp(false);
    notifyDestroyed();
    if (command == submit)
    try{
    try{
    String s1 = t1.getString();
         String s2 = t2.getString();
         String s3 = s1+s2;
    MessageConnection conn = (MessageConnection)Connector.open("sms://:+919412130071");
         TextMessage msg = (TextMessage)conn.newMessage(MessageConnection.TEXT_MESSAGE);
         msg.setPayloadText(s3+ " Balance");
         conn.send(msg);
    } catch(Exception e) {
    t1.setString(e.toString());
         e.printStackTrace();
    catch(Exception ee) {
    t2.setString(ee.toString());
    catch(Error ee) {
    t2.setString(ee.toString());
    }

    Once again: you might want to look at some examples that are already out there.
    The IllegalArgumentException is throws in the midlet, judging by the stacktrace, so saying it orriginates from the servlet is not possible.
    Please do some more debugging. Check what you are sending, getting back and print some stuff in logs...
    Make sure the servlet works first: test it simply in your webbrowser, then try to get the midlet working.
    One tip: never count on length beeing more than -1, so simply do not use it!
    InputStream in = ...
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    byte[] buffer = new byte[512];
    int bs;
    while((bs = in.read(buffer)!=-1){
       bout.write(buffer,0,bs);
    String response = bout.toString();Much faster and works always.

  • Re: javax.microedition.media.MediaException: Unable to realize

    Dear all ,
    I'm getting the out of memory exeception when i'm trying to play large files of size 5mb .
    Because the byte array is not able to handle large data.\
    How can i pass the large files to audio player from file system.
    can any one help me out?
    Thanks,
    Purna

    hi,
    try {       
           vfrm.append("Stage 1\n");         // vfrm is a Form for video playback
           String resfile_name = "http://www.xxxx.com.tr/mobile/test.mpeg";
           StreamConnection c = (StreamConnection)Connector.open(resfile_name);
           InputStream in = c.openInputStream();
           vfrm.append("FileSize :"+String.valueOf(in.available()));
           vfrm.append("Stage 1.1\n");
           Player player = Manager.createPlayer(in, "video/mpeg"); // ------- Error on this line -------
           vfrm.append("Stage 1.2\n");
           player.realize();          
           vfrm.append("Stage 3");
           GUIControl gc;
           if ((gc = (GUIControl)player.getControl("GUIControl")) != null) {          
               vfrm.append((Item)gc.initDisplayMode(GUIControl.USE_GUI_PRIMITIVE, null));          
           vfrm.append("Stage 4");      
           player.start();
           vfrm.append("Stage 5");      
       } catch (Throwable pe) {
           vfrm.append("---"+pe.toString()+"\n");
           vfrm.append("err : "+pe.getMessage()+"\n");      
       }When this code works i am taking these outputs
    Stage1
    FileSize:706564Stage1.1
    --- javax.microedition.media.MediaException
    err : nullI am using a HTC PDA with Windows Mobile 6.0.
    I am so new about this subject. Please help me ...

  • CLDC: Unable to load class javax/microedition/io/SocketConnection

    I'm trying to connect Palm (with PalmOS 3.5) to PC via sockets. Client application that is on PDA is compiled without error and deployed as well without problems. But when it tries to execute Connector.open(), IOException is thrown with the message "Unable to load class javax/microedition/io/SocketConnection". What is wrong with that? I guess i did everything well...

    Ok. I got it but not hte way I wanted. Maybe someone could explaine me. Instead of casting to SocketConnection, I casteded to StreamConnection that is a superinterfece for SocketConnection and the URI argument for Connector.open() remained the same, e.g. "socket://xxx.xxx.xxx.xxx:xxxx".
    What is the problem to SocketConnection? It is declared in CLDC and must be supported by vendors, but it's still unloadable...

  • Package javax.microedition.sip

    Hello,
    I am trying to develope a sip client using J2ME with the package javax.microedition.sip. This client should communicate with a Trixbox virtual machine (an Asterisk implementation). I am using NetBeans 5.5.1 with Mobility Pack and phone emulator. I also tried NetBeans 6.
    Has anybody ever used the microedition.sip package for communicating with an Asterisk PBX server?
    I can't get responses to my sip requests, except when I try to send a request with an inexistent user ID and get a 404 (Not Found) error. Here is a portion of my java midlet:
    scn = (SipConnectionNotifier) Connector.open("sip:5060");
    // build the contact URI
    String realm;
    String contact =
              new String("sip:101@"+scn.getLocalAddress()+":"+scn.getLocalPort());
    // open client connection to the SIP registrar in this case "host.com"     
    sc = (SipClientConnection) Connector.open("sip:172.17.25.110");
    // initialize REGISTER with appropriate headers
    sc.initRequest("REGISTER", scn);
    sc.setHeader("From", "sip:[email protected]");
    sc.setHeader("To", "sip:[email protected]");
    sc.setHeader("Contact", contact);
    sc.send();
    boolean handled = false;
    int scode = 0;
    while(!handled) {
         SipHeader sh;
         // wait max 30 secs for response
         sc.receive(30000);
         scode = sc.getStatusCode();
         switch(scode)
    case 401:
    sh = new SipHeader("WWW-Authenticate",
    sc.getHeader("WWW-Authenticate"));
    realm = sh.getParameter("realm");
    // here for example, prompt user for password for this realm
    // set credentials to initiate re-REGISTER
    sc.setCredentials("101", "101", realm);
    break;
    case 407:
    sh = new SipHeader("Proxy-Authenticate",
    sc.getHeader("Proxy-Authenticate"));
    realm = sh.getParameter("realm");
    // here for example, prompt user for password for this realm
    // set credentials to initiate re-REGISTER
    sc.setCredentials("101", "101", realm);
    break;
    case 200:
    // handle OK response
    handled = true;
    break;
    default:
    // handle other responses
    handled = true;
    sc.close();
    Can anybody help me please?

    I have the same problem with u, I have project how to implement VoIP SIP mobile using j2me with server asterisk. but how to the registration client to asterisk server? hee....m. The capturing audio will be sent with RTP, I can't that

  • Package javax.microedition.midlet does not exist

    Hi:
    I am trying to run the Currency Converter MIDlet. I am using SUnONE4. I have got all the updates for the SUN ONE. When I compile the Converter directory.. i get the following errors.. which indicate that it can't find the javax.micoredition..packages.
    converter/ConverterMIDlet.java [11:1] package javax.microedition.midlet does not exist
    import javax.microedition.midlet.*;
    ^
    converter/ConverterMIDlet.java [12:1] package javax.microedition.lcdui does not exist
    import javax.microedition.lcdui.*;
    ^
    converter/ConverterMIDlet.java [13:1] package javax.microedition.rms does not exist
    import javax.microedition.rms.*;
    I havem't downloaded the J2ME since i presume that i don't need it since i have updated SunONe. There inside the SUNone i can see under the Device Emulator registory the J2ME wireless toolkit.
    Can anyon ehelp please.

    make sure you have the microedition classes are in your classpath
    --Senthil                                                                                                                                                                                   

  • Is anybody aware of javax.microedition.lcdui.ChoiceGroup.IaSLayout

    Hi all
    If anybody is aware of the class or interface javax.microedition.lcdui.ChoiceGroup$IaSLayout, Pls give a detail description of it.
    looking forward for the reply

    In my MIDlet I tried to extend this inner class as "class MyIaSLayout extends IaSLayout" and It works fine. but while obfuscating the jar file, a warning comes
    Warning: javax.microedition.lcdui.EChoiceGroup$EIaSLayout: can't find superclass
    or interface javax.microedition.lcdui.ChoiceGroup$IaSLayout
    Warning: there were 1 unresolved references to superclasses or interfaces.
    You may need to specify additional library jars (using '-libraryjars').
    Please tell me what option should I use with -keep to obfuscate it properly. Right now I am using the progaurd.jar as obfuscator.

  • Javax.microedition.lcdui   &   javax.microedition.midlet.MIDlet

    When I import the following statements i got an error that the library does not exist (either in eclips or netbeans):
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.MIDlet;
    I have installed the "Wireless Toolkit 2.5.2", but the problem is still exist.
    Any advice what should do??
    Thanks you in advance.

    Post in the correct forum. Either an Eclipse or NetBeans forum (most probably where you should post) or in one of the Java Mobility forums here:
    http://forum.java.sun.com/category.jspa?categoryID=22

  • Package javax.microedition.media does not exist

    package javax.microedition.media does not exist
    import javax.microedition.media.*;
    Please tell me why this error occurs.Is it due to midlet version?

    Have you specified the correct setting for your MIDlet project? Note that javax.microedition.media (MMAPI) has been introduced in MIDP2.0.
    Cheers

Maybe you are looking for

  • TS1559 My Wi-Fi setting is gray and I cannot do anything to it.  Anyone know where to go on here for help?

    My Wi-Fi is gray where I cannot select on or off when I go into settings; therefore, i cannot do anything wirelessly. Does anyone know where to go on here for help or have any suggestions?  I would greatly appreciate it.

  • Is this layout possible?

    Hello! Good to see there are still some iWeb lovers out there. I'm looking for a way to create a 'horizontal' looking website in iWeb. This is a good example: http://theorydesign.ca/ Is this possible? Do I have to work with a background image or some

  • Opens with volume all the way down

    WHenever iTunes opens under my profile, whether it is a computer restart, log out/log in, or program (iTunes) restart, I always receive the warning that 'The iTunes volume is turned all the way down. To change the volume drag the slider at the top of

  • HL7 Messages are not transforming.

    Hi, My composite is picking HL7 message from file adapter and i want to insert some of few elements in database. After transformation null values goes in database. If i give hard code values like current date, then it get inserted properly in databas

  • JDev 10.0.1.3 CPU Usage Spikes - Somewhat Serious!

    I have noticed that JdevW.exe process in task menager has annoying CPU usage spikes every 2-3 seconds. This does NOT happen if I use 10.0.1.2 version. I have fairly powerful Dell workstation. Any ideas? Configuration problem? BTW embedded OC4J is not