HttpConnection works only in MIDlet startapp()

I have this MIDlet that verifies if a RecordStore exists and if not it makes a connection and retrieves data from a java webservice. It's fairly simple - i've included the framework below:
public void startApp() {
     rsPatient = openRecordStore(RECORD_STORE_PATIENT);
     if(rsPatient.getNumRecords() > 0) {
          System.out.println("rsPatient: " + rsPatient.getSize() + " bytes");
     else {
          final Hashtable parameters = new Hashtable(1);
          parameters.put("languagePrefix", activeLanguagePrefix);
          showMessageForm("Downloading patient data...");
          Thread connectionThread = new Thread() {
               public void run() {
                    //make a SOAP connection and save envelope
                    WSConnection(aMethod, parameters);
          connectionThread.start();
          try {
               connectionThread.join();
          catch(InterruptedException ie) {
               ie.printStackTrace();
          //do something with envelope
          System.out.println("rsPatient created (" + rsPatient.getSize() + " bytes)");
I'm a bit confused because if i delete the RecordStore (making the MIDlet connect to the webservice) I have no problem connecting again later during runtime. But it seems that i'm unable to make additional connections if the RecordStore already existed. That is, if the MIDlet did not need to connect to the webservice and retrieve the data, later during runtime I'm suddenly unable to connect using this line (which is the very same line as the MIDlet would use earlier if the RecordStore was empty):
connection = (HttpConnection) Connector.open(url, Connector.READ_WRITE, true);
This comes from a SOAP implementation (ksoap2) which I used, so the HttpConnection is a class in package org.ksoap2. I narrowed it down to this line, but no exceptions are thrown, no error messages appear, and a System.out.println of the above line shows nothing. I can se nothing extraordinary going on besides the above frameword that could make a change, so why is this necessary? Thanks in advance!

You shouldn't be doing all of that in the startApp() method. The lifecycle methods are expected to return quickly, not to do thread-blocking activity like HTTP connections. Try spawning that off into a separate thread....

Similar Messages

  • How do I keep a page as my home page when dragging icon to left of URL to house image & confirming that I want it as home page works only for current session, so when Firefox next opened, I end up with some stupid search page which McAfee doesn't like?

    A couple of days ago, I connected to the Internet as usual & opened Firefox, only to be greeted by an almost blank screen with a Google-type search box in the middle & this message from McAfee:
    "Your default search settings have changed. This may pose a security risk. Would you like to restore them to McAfee Secure Search to provide a safer searching experience?"
    instead of my usual home page (BT Yahoo). I naturally clicked on the "Yes" option in the message, but rather than restoring my BT Yahoo home page, all that did was to insert the McAfee logo to the left of the search box in the top right-hand corner of the screen. The first time it happened, I had to search for the BT Yahoo page & then followed the standard procedure for setting it again as my home page. It worked only for that session: each time I shut down Firefox or restarted my computer after that, all I got was the blank "search page" & restoring the previous session was the only way to get back to BY Yahoo. How on earth do I make the home page setting permanent?
    As far as I'm aware, I have done nothing to alter my search settings. However, I am anything but computer-literate, so I may have done/pressed something without realising it, but trying to understand what is now happening is far beyond my limited IT skills.

    See McAfee support to find out how to disable that McAfee feature - that isn't part of the normal Firefox installation.

  • Sound doesn't work(only in firefox). why? sound doesn't work(only in firefox). why? (adobe flash player doesn't work even thought it's installed)

    sound doesn't work (only in firefox). adobe flash player doesn't work correctly, thought it's installed. can't solve the problem. i need Sound.
    == This happened ==
    Every time Firefox opened
    == don't know

    What does the Adobe test page say?
    http://www.adobe.com/software/flash/about/
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")
    See also [[No sound in Firefox]] and [[Video or audio does not play]]

  • I have loaded Lion on my MacBook and the new trackpad functions work only on one ordinary account or user and not on the admin account. The trackpad preferences are well set. What can I do?

    I have loaded Lion on my MacBook and the new trackpad functions work only on one ordinary account or user and not on the admin account. The trackpad preferences are well set. What can I do?

    iCloud should still help you reduce some hard drive space. Just select "optimize" in the icloud tab in Mac Photo App preferences.
    Granted, not the same as completely offloading your library to a back-up drive at your location.
    Good Luck!

  • I clicked on "Erase all Content and Settings and now my ipad is not working, only the apple logo appears. how to i reset it back?

    I clicked on "Erase all Content and Settings and now my ipad is not working, only the apple logo appears. how to i reset it back?
    Some please show me how to reset it.

    Here is some information from Apple:
    http://support.apple.com/kb/TS3274
    http://support.apple.com/kb/HT4057

  • Can I use Google Sync to transfer only my contacts from my IPhone 4 to my gmail acct? I don't want to sync info from Gmail to the IPhone. Can the sync work only one-way? I have 0 contacts on my gmail as I'll only use it as a back-up 4 my IPhone contacts.

    Can I use Google Sync to transfer only my contacts from my IPhone 4 to my gmail account? I do not want to sync info from Gmail to the IPhone. Can the sync work only one-way? I have 0 contacts & 0 calendar events on my gmail account. I opened the Gmail account specifically to for the Google Sync and wil only be using this account as a back-up for my IPhone contacts. Please Help!!

    You do realize that the SIM only contains account information for your wireless account.
    Moving the SIM from phone to phone does not cause any of your iTunes content, contacts, email, etc to magically appear on the device.

  • Working with Outlook 2011 for Mac, my mails are slow and I can work only on-line, when off-line, mail cannot be opened because it is only partially downloaded. How to solve??

    working with Outlook 2011 for Mac, my mails are slow and I can work only on-line, when off-line, mail cannot be opened because it is only partially downloaded. How to solve??

    Try http://www.microsoft.com/mac/support.

  • Why GWt suggest box is not working in the latest versions of Firefox ? It was working only in Firefox 3 and not other versions. could you please assist in this regards.,

    Why GWt suggest box is not working in the latest versions of Firefox ?
    It was working only in Firefox 3 and not other versions. could you please assist in this regards.,

    jbren wrote:
    I repeatedly have problems with playback on my STB's. Go thru all the motions, inhouse agent, fix multi room dvr problems. Unplug unit, unplug dvr, etc. etc. etc.  The DVR'd show will play on the DVR but not on the STB's. What's up with that?
    Sorry to hear the auto fix suggested early did not fix your problem. So we can get more information from you, I have copied your post to our private support board. Please refer all correspondences to there from here on out. You can easily get to the private support one of two ways. In the email you signed up for the forums with, you will receive a link to click on. Make sure you are already signed into the forums before clicking on this link. Another way of getting there is by clicking on your username anywhere you see it in the forums. This brings you to your account profile. Scroll down to the section labeled "My Support Cases" . In there you will see the link to your case.
    Anthony_VZ
    **If someones post has helped you, please acknowledge their assistance by clicking the red thumbs up button to give them Kudos. If you are the original poster and any response gave you your answer, please mark the post that had the answer as the solution**
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or plan

  • Since moving to iCloud, my mobileme email works ONLY on my iPhone, but not on my PC with Outlook.  I get an error message indicating the authentication is not accepted.  any suggestions?

    since moving to iCloud, my mobileme email works ONLY on my iPhone, but not on my PC with Outlook.  I get an error message indicating the authentication is not accepted.

    To anyone who has viewed this post and is having similar difficulties, the answer came on a different forum: I dragged & dropped the files from Mail to iCloud Drive. Opened them on my MB Air, they were saved in Templates and are now accessible across all my devices.
    Answer came from SGIll: Numbers templateshttps://discussions.apple.com/message/27505880#27505880Numbers templates

  • Master Page: Alternatives (Subform Set) works only for the first page

    Hi everybody!
    I have bumped into a very weird problem with ADOBE Forms:
    When I create an 'Alternative' in a Context area and then place it on a Master Page, it works only for the first page. On the rest of pages it always show the 'TRUE' subform, regardless of the condition (which is not changed, of course). Absolutely the same Alternative works perfectly in a Content area for all pages.
    Has anybody seen something like this? Any ideas why?
    Thank you!

    This happens because of the processing of the form.
    You can see this here:
    LiveCycle ES2 * Adobe LiveCycle Designer ES2
    You have to put a own variable, which is set with the value you want in the very beginning.
    I know, it is not that logical in the first moment, but it makes sense.
    Regards
    Florian
    PS: This space SAP Interactive Forms by Adobe is the correct for questions like that

  • Does DML error logging work only on local DB and not remote DB?

    (A) does not log the errors but (B) does log the errors.
    Does the LOG clause work only on a local database and not a remote database?
    A)
    begin
    INSERT
    INTO
    "PRISM"."TARGET"@"DBLINK"
    (INVOICE_NUM
    ,INVOICE_AMOUNT)
    VALUES
    ('GHI'
    ,'GI')
    LOG ERRORS INTO "PRISM"."ERR$_TARGET"@"DBLINK" (1000) REJECT LIMIT unlimited
    end;
    B)
    begin
    INSERT
    INTO
    "PEER_TARGET"
    ("INVOICE_NUM",
    "INVOICE_AMOUNT")
    VALUES
    ('GHI'
    ,'GI')
    LOG ERRORS INTO "ERR$_PEER_TARGET" (1000) REJECT LIMIT unlimited
    end;

    Oracle has come back to us saying that
    "DML error logging feature is not supported for distributed DML."

  • Ichat video not working only to one person

    I've read most of the post on "i chat not working"; but has anyone had it to not work only to one individual. This is my case. I can video i chat with my son in FWB FL. with no problem. He has an Apple also. I can take my laptop to his location and video i chat with my sister-in-law in Jefferson Ga. But, I cannot video i chat with my sister-in-law from my location, Valrico, Fl. to her location in Jefferson Ga. I have had a 3 way phone conversation going with Apple, My internet provider and her internet provider and no one can solve the problem. Does anyone have any assistance they can provide. I'm not computer savy; so be patient and go slow and detail with me; thanks. Norm

    More often than not this is about the way a modem or router or combo at either end use NAT.
    NAT is Network Address Translation.
    It is the way a device shares an Internet connection with several devices/computers.
    However NAT means different things to different devices and not all devices therefore are doing what is called NAT the same way.
    See here for further mind boggling
    So what you may have is a device at either end that does not or will not play nicely with another device.
    This can be particularly the case if the device has to use Port Forwarding or Port Triggering or is using the DMZ to open ports.
    Using UPnP reduces the problem in many cases.
    http://www.ralphjohns.co.uk/page15.html#CertainBuddy
    Telling us what devices in the way of Modems and routers each end is using may help us pint to what can be changed.
    Makes and models please with what they are doing to open the ports for iChat.
    As Defcom has pointed out with certain connection it can be the Speed difference in the Internet connection both up and down that can be a factor.
    I may receive some form of compensation, financial or otherwise, from my recommendation or link.
    9:58 PM Monday; April 28, 2008

  • Is there a format for a file that I can use for attaching a one page document with photos embedded that will open in everyone's email automatically?   I've tried PDF and Word, but worked only in Mail.  Lost formatting when just copied and pasted in email.

    Is there a format for a file that I can use for attaching a one page document with photos embedded that will open in everyone's email automatically?   I've tried PDF and Word, but PDF worked only in Mail.  Word worked in nothing.  I also tried copying and pasting the document but lost all formatting when just copied and pasted in email.  Is there a way to do this?

    Are you sure PDF won't work? It should as what you're trying to do is pretty much what it is designed for (PDF - Portable Document Format). On a Mac anywone who receives the file should be able to see it in all its page layout glory by using the app Preview or Adobe Reader. Same on a PC, the file should be viewable as a PDF file using Adobe Reader and probably some other viewer (don't use PCs so not sure what other apps).
    What application are you creating the file in and are you sure you're exporting it correctly in PDF format, fonts and images embedded?

  • Is it possible to work only on a small part of the image in FCP ?

    Hello,
    I"m working on a DV film that I have made this winter, but on the original film, the image (video) is a lot darker on both top corners (I have some problems with my camera when I use it outside during the winter).
    Is there any way to work only on a part of the image with a filter, instead of working on the whole image. I would like to work on thoses 2 darker spot without touching the rest of the image.
    Thanks

    What you need to do is color correct just those two portions of the image. In a DaVinci and Final Touch this is called using "power windows." Now, you can do this one of two ways.
    1) Layer the same clip on the timeline 3 times. V1, V2 and V3. Same start and end time on all clips. Now, use the 4-point garbage matte on the clips on the upper layers to isolate those sections and then apply the 3-way color corrector to brighten the images.
    2) Colorista by Red Giant Software (www.redgiantsoftware.com) is a $200 color correction filter that allows you to layer color correction and isolate specific areas...using POWER WINDOWS in effect.
    Shane

  • Flash Player works only for Local Admins

    Hi!
    We have about 40 computers in our organisation with the same problem: Since few weeks the Adobe Flash Player (ActiveX) works only, when the user has administrative privileges. If a normal user wants to watch youtube-films or other flash objects, there will only appear a message that (a new) Adobe flash player must be installed to view the content (or so). It looks like there is no Adobe Flash player installed. But if the user is a local admin, everything works fine - on the same computer.
    Under Software Adobe Flash Player is displayed as installed.
    We have WinXP Professional SP2/SP3 32bit running on 4-year-old Maxdata computers. And few new computers (also WinXP Professional SP2/SP3 32bit)
    Confusing: There are few computers where flash works for everyone! It seems, that especially the computers that are new don't have this problem.
    I've tested everything: Using the MSI-file, using the EXE-file. Uninstalling the MSI, uninstalling the EXE. Using Version 14, 16 and now 26. Uninstalling everything by the offical Adobe flash player uninstaller. Installing the software as administrator, installing the software via GPO. I've deleted system32/macromed/flash. I've used Microsoft subinacl - with the offical adobe reset_fp10.cmd. I edited system32/macromed/flash so that everybody has write rights on this folder.
    But nothing works. It's always the same: Videos in the IE are only shown for admins.
    And now, I've no idea, what else I could do?!
    Anyone else?
    Greetings from Germany
    Peter

    Pat, is this the one?
    http://forums.adobe.com/thread/729200?tstart=0
    eidnolb

Maybe you are looking for

  • Can't connect to wireless network that works fine for other machines

    I received my MacBook Pro last week (2.16 GHz) and I've been very happy with it so far. However, when I brought it home, I've had nothing but issues trying to connect to my wireless network. It's a Netgear, and you can read more about it at the follo

  • HT203768 retrieving pics from icloud

    I no longer had an iphone (although other family members still do)... before switching phones, i backed up all my pics to icloud. how can i access those now for retrieval? thanks

  • 2 holds on my debit card

    I purchased a gaming computer to be shipped to the store. On the 6th BB put a hold on my card for 786.56. Then on the 12th BB placed another hold on my card for the same amount. Thats 1573.12 tied up. Can we clear one of these out? I have bills to pa

  • I am trying to download i tunes onto my pc but get an error saying that some old i tune files can not be deleted before reinstalling.

    I am trying to download i tunes onto my pc (Windows XP) but get an error saying that some existing files can not be deleted to be re installed.  I have tried several time but to no avail.

  • Button Attributes

    Button Attributes Help says the following: For buttons based on templates your template will need to include the #BUTTON_ATTRIBUTES# substitution string. You can use this to control tab stops for example: tabindex="3" Where and how exactly I include