HTTP connection is thread isn't working

Hi,
I am writing an application that streams an input from a HTML webpage.
I have put the connection in a separate thread (as advised).
I need the input steam to be saved in the RMS (which is contained in the main part of the program) and as the thread is processed in the background, I cannot reference the RMS.
Please help me, I only have 14 days left and then the 10,000 words to go with it!!! Any ideas?
Many thanks

This is the process I am trying to take. However, the inputstream is in a separate thread and I am unsure how to pass the byte array to the original as "symbol is not recognised".
The code below illistrates the process I need
Many thanks
else if (command == download)
Process process = new Process(this);
process.start();
class Process implements Runnable
private HttpTrial MIDlet;
public Process(HttpTrial MIDlet)
this.MIDlet = MIDlet;
public void run()
try
getViaStreamConnection();
catch (Exception error)
System.err.println(error.toString());
public void start()
Thread thread = new Thread(this);
try
thread.start();
catch (Exception error)
public void getViaStreamConnection() throws IOException
try
Db = RecordStore.openRecordStore("Db", true );
catch (Exception error)
alert = new Alert("Error Creating",
error.toString(), null, AlertType.WARNING);
alert.setTimeout(Alert.FOREVER);
display.setCurrent(alert);
StreamConnection c = null;
String url = "http://homepage.ntlworld.com/gurneywilliam/list.html";
InputStream s = null;
StringBuffer b = new StringBuffer();
try
c = (StreamConnection)Connector.open(url);
s = c.openInputStream();
int ch;
while((ch = s.read()) != -1)
if (ch != '\n')
b.append((char) ch);
else
byte[] byteOutputData = b.getBytes();
Db.addRecord(byteOutputData, 0, byteOutputData.length);
//b.delete(0, b.length());
finally
if(s != null)
s.close();
if(c != null)
c.close();
try
Db.closeRecordStore();
catch (Exception error)
alert = new Alert("Error Closing",
error.toString(), null, AlertType.WARNING);
alert.setTimeout(Alert.FOREVER);
display.setCurrent(alert);

Similar Messages

  • Why connect by level isn't working in SQL*Plus?

    This following script isn't working in SQL*Plus, but it working fine in SQL Developer, TOAD, SQL Developer. I've no idea - whats going on here?
    satyaki>
    satyaki>select to_char(add_months(to_date('01-JAN-'||to_char(sysdate,'YYYY'),'DD-MON-YYYY'), level - 1),'MON') mon
      2  from dual
      3  connect by level <= 13;
    MON
    JAN
    satyaki>
    satyaki>Regards.
    Satyaki De.

    Oh! Excellent.
    Yes, now i remembered - William did inform about the buggy nature of old Oracle 9i version.
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE    9.2.0.1.0       Production
    TNS for HPUX: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    satyaki>
    satyaki>
    satyaki>select mon
      2  from (
      3         select to_char(add_months(to_date('01-JAN-'||to_char(sysdate,'YYYY'),'DD-MON-YYYY'), level - 1),'MON') mon
      4         from dual
      5         connect by level <= 12
      6       );
    MON
    JAN
    FEB
    MAR
    APR
    MAY
    JUN
    JUL
    AUG
    SEP
    OCT
    NOV
    MON
    DEC
    12 rows selected.
    satyaki>The reason is my version. Thanks Maxim for pointing this out.
    Regards.
    Satyaki De.

  • Sees connection, but internet isn't working

    Hi, folks! I hope you can help me with this problem my macbook is having.
    Sometimes it does this thing where it sees the connection (bars show) but when I try to use any program that requires an internet connection (Safari, Firefox, iTunes store, or iChat) it doesn't work, doesn't connect. It used to work fine, just suddenly started doing this. I have not changed any of the settings or the IP address.
    This has been a recurrent problem since I got the laptop, and using it just sort of randomly starts working again after a couple days. Now it has been a couple weeks and it is still not working, so I would like to figure out what is the root of the problem and fix it! Does anyone have any tips or ideas?
    Thank you in advance!
    <3

    Sorry, this is my first time doing this ^^;
    I have cable, Roadrunner. I do have a linksys router, but when I try to plug the ethernet cable directly into the computer, the internet still doesn't work. My computer does recognize the signal, but I have no internet. It gives me a "page cannot be found" when I try to load up for Firefox or Safari, and iChat and iTunes store won't load up either.
    The internet was working fine, it just suddenly started doin gthis. It isn't the first time, but usually it just randomly pops back on after a day or two. My other computer is working fine, so I don't think the problem is with the connection.

  • HTTPS connection with client certificate not working in spartan

    Spartan does not show certificate for the user to select
    when I click the https link.
    The certificates (taken from a smartcard) are indeed present in the user CertStore.
    It works with IE 11 and Chrome.
    Has somebody any suggestions ?
    Thanks.

    in fact you are more using a reverse-proxy than a proxy since it is on the server part..
    You have to put all the SSL server part on the reserve-proxy itself and not on the final RSS feed. Then, the reverse-proxy will authenticate your client and gets its certificate. After that, either this proxy will open a plain connection (no ssl) towards the RSS, or you can also open a ssl connection but this means you must create a client certificate for the proxy. It just depends on the security level you need, and I used this solution many times in professional hosting.
    hope it helps !

  • Making https: connection from java code loaded into Oracle 8i database

    A bit of a blast from the past, really, as 8i provides a JVM at 1.2.2.
    I need to provide an PL/SQL function which accesses a RESTful web service requiring https connection. Got the call working under 1.2 locally without much trouble using:
    static {
            System.setProperty("java.protocol.handler.pkgs",
                    "com.sun.net.ssl.internal.www.protocol");
            Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
        }The trick is to get the Oracle database to run the code internally. What libraries do I need where? I get an extremely unhelpful NoClassDefFoundError, without mention of the offending class.
    By doing loadjava with jcert.jar,. jnet.jar and jsse.jar (the libraries I'm using with the test program) I can get loadjava to accept and allegedly resolve the class.

    endasil wrote:
    malcolmmc wrote:
    Well, sadly look at the colour scheme.Yeah, sarcastic was I. The NoClassDef error seriously doesn't give a class name? I find it astonishing that any implementation would be that stupid.Seriously. The strange thing is that before I got to the NoClassDefFound I had a Initialization error (until I added a security rule for setting the Provider) and for that I got a full stack trace (in an obscure trace file, granted).

  • No HTTP Connection until after multiple reboots.

    I seem to lose my HTTP connectivity but FTP seems to work as well as local network connectivity. 
    After the computer has been on for 24 hours plus and I wake it up from sleep mode I lose the ability to see HTTP traffic (websites).  But I was able to see a pdf from a site (this may have been cached).  When I reboot an unknown app seems to hang
    the shutdown and I frequently have to hold the power button to shutdown. When it does reboot I have to shutdown from the "Select User/logon" screen. At this shutdown it goes just fine.  Then finally upon the next restart it will then connect
    to internet websites. 
    Other computers on my local network seem to connect to the internet just fine.  So it does not seem to be a router issue. I have tried the other users on the computer and they seem to work just fine also.  I have scanned the computer for Viruses
    via MacAffee and nothing was detected.  I have ran IPConfig commands (release, renew, etc) and nothing seems to work. I do see the DNS server for my internet provider (Comcast).  
    I think the failure to shutdown is a clue.  When I worked on the Win 98 a similar issue used to occur because of a network card driver issue.  I have checked my driver for updates and I am running the latest version. 
    Summary. 
    No website viewing
    Local network seems fine
    Hangs on shutdown
    Needs two shutdowns to start working
    I have ran ipconfig (renew, release, etc)
    I have updated the Driver for the network card 
    (Wireless or Cat-5 network connection same result)

    Hi,
    Firstly, Please check NIC driver properties in Device Manager, Make sure the option "Allow the computer to turn off this device to save power" was unchecked.
    Secondly please check Event Viewer if it identify this problem.
    About Device driver update, If your computer was OEM, it would be better to check update at its official site.
    In addition, to fix this problem, please try to use command netsh winsock reset to reset winsock for test.
    Roger Lu
    TechNet Community Support

  • A toolbar called Searchqu got installed in my web browsers.I uninstalled Mozilla Firefox without removing the toolbar and it stopped working saying that can't connect to the server.I uninstalled and installed Firefox but it isn't working.

    A toolbar called Searchqu got installed in my web browsers.I uninstalled Mozilla Firefox without removing the toolbar and it stopped working saying that can’t connect to the server.I uninstalled and installed Firefox but it isn’t working.

    See this thread for potential ways of removing Searchqu from your system: https://support.mozilla.com/en-US/questions/790833

  • Problem with ABAP proxies - HTTP connection to R/3 is not working

    Hi guys!
    I'm setting up a connection from XI to R/3 , because I'm using proxy objects. Our DEV is working fine. Now I have moved the objects to QA and since the HTTP connection is not there, I need to set it up.
    I have created a service user on R/3, activated ICF service on R/3 and created a HTTP to abap type connection in XI. When I test the connection I get a new logon screen. Why? I have provided information about logon user, client, ....
    Thank you! Olian

    Hi,
    this logon screen populated when the RFC User ID is locaked. ask your basis team to release it.
    also refer below links if in case of any other problem
    Actiave ABAP Proxies -- /people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies
    Setting Up Point-to-Point Connections with proxy
    http://help.sap.com/saphelp_nw04s/helpdata/en/85/78af1bf407434796aaf8dbd6d4e7b7/frameset.htm
    Thanks
    Swarup

  • I need help my computer isn't working and there is no was to get on my iTunes and I just updated my phone and now it's stuck on where it shows the plug connected to iTunes help!!!!

    I need help my computer isn't working and there is no was to get on my iTunes and I just updated my phone and now it's stuck on where it shows the plug connected to iTunes help!!!!

    There is no other way than to plug into a computer to restore the phone. You can use another computer to do so, but in case you did not back up to iCloud your data and settings will be gone.
    Follow this article to connect in recovery mode:
    iOS: Unable to update or restore

  • I'm trying to connect my Bluetooth JBL speakers to my Macbook Pro but it isn't working. I can't seem to find Bluetooth Setup Assistant because I updated my laptop. What should I do?

    I'm trying to connect my Bluetooth JBL speakers to my Macbook Pro but it isn't working. I can't seem to find Bluetooth Setup Assistant because I updated my laptop. What should I do?

    Make sure you set the speakers as discoverable, which usually involves holding down a button for a few seconds. Go to System Preferences / Bluetooth and you should be able to add it.

  • New time capsule stops working with http connections

    I have the latest 2TB Time Capsule. I've been getting a weird issue where my I can no longer can do http connections (i.e. browse the internet) but I can still use other internet capable services like Skype or Steam. It seems that traffic through port 80 just seems to stop working. All of my devices on my network experience the issue. I have even exchanged Time Capsules but the issue still presists.
    Does anyone have any ideas?

    Here's a traceroute when things work:
    traceroute 8.8.8.8
    traceroute to 8.8.8.8 (8.8.8.8), 64 hops max, 52 byte packets
    1  192.168.1.1 (192.168.1.1)  3.637 ms  1.030 ms  0.924 ms
    2  69.254.248.1 (69.254.248.1)  10.644 ms  10.237 ms  10.590 ms
    3  te-7-1-ur02.olathe.ks.indepen.comcast.net (68.87.234.209)  10.453 ms  10.177 ms  10.519 ms
    4  te-4-4-ar02.independence.mo.indepen.comcast.net (68.87.234.5)  10.464 ms  11.360 ms  13.087 ms
    5  68.87.234.29 (68.87.234.29)  11.762 ms  12.583 ms  13.066 ms
    6  be-20-702-cr01.sanjose.ca.ibone.comcast.net (68.86.89.37)  28.948 ms  21.847 ms  24.969 ms
    7  he-0-11-0-0-pe04.350ecermak.il.ibone.comcast.net (68.86.83.58)  22.267 ms  22.081 ms  21.251 ms
    8  * * *
    9  * * *
    10  72.14.237.110 (72.14.237.110)  26.647 ms
        72.14.237.108 (72.14.237.108)  25.617 ms
        72.14.237.110 (72.14.237.110)  53.230 ms
    11  72.14.232.141 (72.14.232.141)  33.403 ms  33.622 ms
        209.85.248.228 (209.85.248.228)  34.010 ms
    12  216.239.46.193 (216.239.46.193)  33.824 ms  33.433 ms  34.014 ms
    13  * * *
    14  google-public-dns-a.google.com (8.8.8.8)  37.414 ms  34.587 ms  34.306 ms
    Here's the output when it doesn't:
    traceroute 8.8.8.8
    traceroute: unknown host 8.8.8.8
    I just changed my DNS. I'll report back in a day to say if it fixed anything.

  • My new Iphone 4s says its connected to my icom but it isn't working

    I previously had a Droid and my Icom worked great.  Today I have a new Iphone and it says it is connected to my ICom but it isn't working. 

    Failure of Restore with iTunes on computer is the deciding step. Make Genius reservation and take iPhone to Apple for resolution with Warranty.

  • WIFI is still connected but isn't working?***?

    My WIFI icon on my MacBook Pro is black but safari isn't working. If I turn the wifi off and then immediately back on it works again. When it goes out, my phone and iPad still work. Any ideas?

    Hello epilgreen,
    After reviewing your post, I have located an article that can help with Wi-Fi networks. It contains a number of troubleshooting steps and helpful advice for the issue you are experiencing:
    Wi-Fi: How to troubleshoot Wi-Fi connectivity
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • My iPad isn't working properly. When I try to connect to the internet or follow a link it shuts down and returns to the main screen. Any clue as to what could be causing this? Not my internet connection, I checked that.

    My iPad isn't working. I cannot follow a link in an email or connect to a game. It goes to a black screen then back to the main screen. Any idea what could be causing this?

    Settings > General > Reset > Reset Network Settings
    Perform a "hard reset" on the device by pressing down and holding the home button and the sleep/wake button for up to 30secs. until you see a black screen with the Apple logo, then release.
    Then test to see if it solved the problem.

  • Tried to install iOS 7 and it said I needed to connect my phone to iTunes, so I did and then it said my phone wasn't updated to the software now my phone isn't working!

    Tried to install iOS 7 and it said I needed to connect my phone to iTunes, so I did and then it said my phone wasn't updated to the software now my phone isn't working! all it's doing is showing a iTunes logo with a charger thing under it and won't let me cancel or anything

    After connecting your iPhone to the computer did you restore using the iTunes on your computer?

Maybe you are looking for

  • Creating a database

    I have installed oracle 8.0.5 on Redhat 6.1 but i am not able to create a database . Can anyone guide me on that. When I try connecting through internal it says not enough privileges. This error is there when I log in with any user. My email is [emai

  • Material and vendor transfer to GTS sytem

    I am using GTS 8.0. We have a very peculiar issue. Newly cretaed vendor & material doesnot get transferred to GTS. Please provide the step by step configuration settings to transfer material and vendor master to GTS using rbdmidoc.eg. change pointers

  • How to delete CR2 files from iPad

    I recently used the camera connection kit to download photos (JPEG and Raw) from my Canon G12 to my iPad.  Since I have gotten home, I have been transferring the photos to iPhoto on my MacBook Pro.  When I try to delete the photos from my iPad, it wi

  • CD printing software

    please I have HP Photosmart C5380 All-in-one printer and recently updated my HP photo creations on my computer. I wanted to print a picture on a CD which I normally do but there is no option for CD photo printing on the new updated photo creation. Ca

  • Any sign of 10-bit graphics in Mountain Lion?

    Since many users first started looking for support for widely available 10-bit per channel monitors, spurred on by Apple's adoption of DisplayPort, it seems we've had silence! Is there ANY indication that Apple are going to implement support for "Dee