Error 401 on Twitter device

Hi I Don t know why my fall of code on 9700 OS 5, I try in OS6 9300, 9780 OS 6 and all devices with 0 7 s and the same code work as expected.

I take this forum code, I don´t remenber where and to change some lines and constant.

all devices of returned code 200 but 9700 give me a 401

Help, please

public static String requestToken(){
        String url = Const.REQUEST_TOKEN_URL;
        String header = oauth_header(url, HttpProtocolConstants.HTTP_METHOD_GET);
        String requestTokenUrl = concatURL(url, header);
        System.out.println(requestTokenUrl);
        HttpsConnection connection = null;
        InputStream input = null;
        try{
            connection = (HttpsConnection) HttpUtils.getConfiguredConectionFactory().getConnection(requestTokenUrl).getConnection();
            connection.setRequestMethod(HttpProtocolConstants.HTTP_METHOD_GET);
            connection.setRequestProperty("WWW-Authenticate","OAuth realm=http://twitter.com/");
            connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");

            input = connection.openDataInputStream();
            int resp = connection.getResponseCode();
            if (resp == HttpConnection.HTTP_OK) {
                StringBuffer buffer = new StringBuffer();
                int ch;
                while ( (ch = input.read()) != -1){
                    buffer.append( (char) ch);
                }
                String content = buffer.toString();
                Const.token = content.substring(content.indexOf((Const.OAUTH_TOKEN+"="))+(Const.OAUTH_TOKEN+"=").length(), content.indexOf('&'));
                Const.tokenSecret = content.substring(content.indexOf((Const.OAUTH_TOKEN_SECRET+"="))+(Const.OAUTH_TOKEN_SECRET+"=").length(), content.length());

            }else{
                  StringBuffer buffer = new StringBuffer();
                  int ch;
                  while ( (ch = input.read()) != -1){
                      buffer.append( (char) ch);
                  }
                  String content = buffer.toString();
                  System.out.println("request Error: " + content);
            }
            return Const.token;
            //return (getTwitterMessage(connection.getResponseCode()));
        } catch (IOException e) {
            return "IOexception";
        } catch (TransactionException nc) {
            return "noConnection";
        } catch (Exception e) {
            return "Exeption";
        } finally {
            try {
                connection.close();
                input.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
public static ConnectionFactory getConfiguredConectionFactory(int timeout){
        int[] allow ={
                TransportInfo.TRANSPORT_TCP_CELLULAR
        };
        int[] denny ={
                TransportInfo.TRANSPORT_MDS,
                TransportInfo.TRANSPORT_WAP,
                TransportInfo.TRANSPORT_TCP_WIFI,
                TransportInfo.TRANSPORT_WAP2,
                TransportInfo.TRANSPORT_BIS_B

        };
        ConnectionFactory factory = new ConnectionFactory();
        factory.setEndToEndDesired(false);
        factory.setEndToEndRequired(false);
        factory.setPreferredTransportTypes( allow);
        factory.setDisallowedTransportTypes(denny);
        factory.setAttemptsLimit(3);
        factory.setConnectionMode(ConnectionFactory.ACCESS_READ_WRITE);
        factory.setTimeoutSupported(true);      

        factory.setTransportTypeOptions(TransportInfo.TRANSPORT_TCP_CELLULAR,telefonicaAPN );
        factory.setConnectionTimeout(timeout);
        factory.setTimeLimit(timeout);
                return factory;
}
public static String oauth_header(String url, String method) {
        String nonce = nonce();
        long timestamp = timestamp();
        Hashtable pairs = new Hashtable();

        pairs.put(Const.OAUTH_CONSUMER_KEY, Const.consumerKey);
        pairs.put(Const.OAUTH_NONCE, nonce);
        pairs.put(Const.OAUTH_SIGNATURE_METHOD, Const.SIGNATURE_METHOD);
        pairs.put(Const.OAUTH_TIMESTAMP, Long.toString(timestamp));
        if(Const.token != null) {
            pairs.put(Const.OAUTH_TOKEN, Const.token);
            //pairs.put(OAUTH_VERIFIER, verifier);
        }
        pairs.put(Const.OAUTH_VERSION, "1.0");
        pairs.put(Const.OAUTH_CALLBACK, Const.CALLBACK_URL);
        String sig = signature(method, url, pairs);
        //pairs.put(Const.OAUTH_SIGNATURE, escape(sig));

        StringBuffer header_sb = new StringBuffer();
        if(method.equals("GET"))
        {
            String comma = ",";
            header_sb.append(Const.OAUTH_CONSUMER_KEY).append("=").append(URLUTF8Encoder.encode(Const.consumerKey)).append(comma);
            header_sb.append(Const.OAUTH_NONCE).append("=").append(nonce).append(comma);
            header_sb.append(Const.OAUTH_SIGNATURE).append("=").append(URLUTF8Encoder.encode(sig)).append(comma);
            header_sb.append(Const.OAUTH_SIGNATURE_METHOD).append("=").append(URLUTF8Encoder.encode(Const.SIGNATURE_METHOD)).append(comma);
            header_sb.append(Const.OAUTH_TIMESTAMP).append("=").append(Long.toString(timestamp)).append(comma);
            if(Const.token != null) {
                header_sb.append(Const.OAUTH_TOKEN).append("=").append(URLUTF8Encoder.encode(Const.token)).append(comma);
            }
            header_sb.append(Const.OAUTH_VERSION).append("=").append("1.0").append(comma);;
            header_sb.append(Const.OAUTH_CALLBACK).append("=").append(URLUTF8Encoder.encode(Const.CALLBACK_URL));
        }
        else if(method.equals("POST"))
        {
            header_sb.append(Const.OAUTH_CONSUMER_KEY).append("=").append(URLUTF8Encoder.encode(Const.consumerKey)).append("&");
            header_sb.append(Const.OAUTH_NONCE).append("=").append(nonce).append("&");
            header_sb.append(Const.OAUTH_SIGNATURE).append("=").append(URLUTF8Encoder.encode(sig)).append("&");
            header_sb.append(Const.OAUTH_SIGNATURE_METHOD).append("=").append(URLUTF8Encoder.encode(Const.SIGNATURE_METHOD)).append("&");
            header_sb.append(Const.OAUTH_TIMESTAMP).append("=").append(Long.toString(timestamp)).append("&");
            if(Const.token != null) {
                header_sb.append(Const.OAUTH_TOKEN).append("=").append(URLUTF8Encoder.encode(Const.token)).append("&");
                //header_sb.append(OAUTH_VERIFIER).append("=").append(escape(verifier)).append("&");
            }
            header_sb.append(Const.OAUTH_VERSION).append("=").append("1.0").append("&");
            header_sb.append(Const.OAUTH_CALLBACK).append("=").append(Const.CALLBACK_URL);
        }
        return header_sb.toString();
    }

Well I found the solution to al my headache, the phone are the incorrect time and that the reason for this same code fails in this terminal

Tags: BlackBerry Developers

Similar Questions

  • Equium L40-156: graphics card problem - error code 12 in Device Manager

    People of the night...

    Just got a family run Vista premium, Equium L40-156, everything is going well except a little problem with the display adapter (Mobile Intel 965).

    Tried the drivers that I had with the installer
    Tried the drivers from the toshiba download page
    Tried the drivers on the Microsoft Update site
    Tried the drivers from the website of intel

    All have the same problem, in Device Manager, it shows with an error (the pretty yellow triangle with the "!") with an error code 12 (the device cannot find enough free resources) even after a system resart.

    Switching view hidden devices displays a 2nd same device, but works correctly, but the two disappear if I try to delete either.
    Display settings do not display a connected device, DXDIAG had no idea either.

    Latest version of the BIOS installed, all other devices are very good and can not see an IO overlap anywhere

    Any suggestions, greatly appriciated

    Ta

    Hello

    I have studied a little bit and looked on the Microsoft page for some answers and found out what exactly means the error code 12.

    ------------------------------------
    + Error code 12 +.

    + This device cannot find enough free resources that it can use. If you want to use this device, you will need to disable one of the other devices on this system. (Code 12) +.

    + Two devices are assigned the same i/o ports, the same interrupt, or the same Direct memory access channel (whether through BIOS, the operating system, or a combination of both). This error message may also appear if the BIOS did not allocate enough resources to the device (for example, if a (USB) universal serial bus controller is not an interruption of the BIOS because of a corrupt MPS (Multiprocessor) system table). +
    -------------------------------------

    Well, what to say; usually this error message should not appear with the original Toshiba preinstalled operating system.
    I put t know if you have changed something or add an additional device, but it would be very interesting to know if the same error message appears after the reinstallation of the OS.
    You can use the Toshiba Recovery CD/DVD of restoration!

    All the drivers, the tools are already preinstalled on the recovery CD so the entire procedure will not take very long. about 10 min.

    Check this box and report if the same error is displayed on the laptop with the factory settings!

    Good bye

  • Satellite L750 - no error at startup boot device

    When you try to start my Satellite L750/755, I get an error no. Bootable Device.

    Before I try any recovery, is it possible to remove the HARD drive and connect it to my other PC so that I can get all my pictures, music, etc. it. If so, do I need.

    I have it on my old desk, and bought a HARD drive with a USB caddy, if disk HARD just looked like an external drive.

    Thank you very much

    Tim

    Yes, you can remove the HARD drive and connect it to your other laptop / PC with USB HDD external enclosure. With the help of this forum you can connect your HARD drive as an external device that must be recognized and listed in the Windows Explorer, so you can have full access to all your stored data.

    Back up all your data and put the HARD drive in your laptop.

    Usually, if there is not a hardware problem you can start your laptop and press F12 to get into the boot menu. When the boot menu appears on the screen that you can put the recovery disk of information optical disk drive, choose the CD/DVD drive and press ENTER. After making this optical drive should start the disc and start to copy the data to the HARD drive.

    What you can do before you start using the recovery disc is to enter the BIOS and set it to default settings.

    Please try it and send feedback.

  • Satellite A100-233 - error that unrecognized USB device

    I have a problem with my USB ports, they where working fine but all of a sudden they start gives me error that unrecognized usb device. I tried to reinstall XP but still the same.

    Can someone give my solution to this problem?.

    Hello

    You have yellow exclamation marks in Device Manager?
    I had a similar problem with the USB ports a few years ago. I removed the ports in Device Manager and reboot the laptop. The USB ports will recognize again.
    Furthermore, I reinstalled the latest chipset driver and everything worked well.

    The latest chipset driver download on the Toshiba site:
    http://EU.computers.Toshiba-Europe.com-online decision-making supported Downloads & => Download drivers

    Good luck! :)

  • IIS on Windows Server 2012 R2 8.5 sends error 401.2 when change password Administrator windows local, 500 errors

    IIS on Windows Server 2012 R2 8.5 sends error 401.2 when change password Administrator windows local, 500 errors

    This particular configuration is with Coldfusion 11. There is no errors in newspapers and the w3 service still works as are application pools. All websites and app pools run with transmission of authentication request.

    ColdFusion does not work with windows authentication and may be enforced as if reconfigured integrated instance to do this, if this isn't a matter of colfusion.

    Here is what I tried:

    1 I created a new user account with admin rights and disconnected and logged in as them and then make changes to the password on the server, and that didn't make a difference.
    2. I checked that all Web sites using the request pass through authentication.
    3. I checked that the application pool is also using the application-pass-through authentication.
    4. I looked to find errors in which case newspapers but don't see anything there either
    5. I also searched a failure in coldfusion logs and saw no more relevant here either, but I got colfusion running without IIS in any case.
    6. search of the roots of web for coded passwords hard and found nothing.

    If you have any ideas or any ideas let me know.

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums:

    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer

  • STP bluscreen error because of the device in Windows XP driver

    Originaltitle: white screen problem came with an error message. And the stop (blue screen) error caused by a device driver. I have not installed anything that either of the end someone can help please.
    I have not installed anything on the Pc quite a while so how can I know which driver is causing the problem. Thanks Edwin 866

    Hello

    We are pleased to know that the problem is solved. Please publish it on us in case you have questions more associated with Windows.

  • How can I activate my card Miniport Tun Microsoft? Get the error code (10) the device can not be started.

    Microsoft Tun Miniport adapt #2 /.

    Microsoft Tun Miniport Adapter #2 / it is disabled (code 22) / this device cannot start (code 10).  I need help to activate the network adapter.

    Description: Broadcom 802. 11b / g wlan - Packet Scheduler Miniport

    Device ID: root | * tunmp \0001
    status 0 x 01802401 has problem
    0x0000000a problem (10)

    Hi GGisin,
     
    -Did you change on your computer before this problem?
     

    Follow the steps listed in the article below for the mentioned error code:

    Explanation of error codes generated by Device Manager in Windows XP Professional

    Note: The information provided in this article are applicable to other versions of Windows XP as well.
     
    Additional reference on:
  • While in "Event Viewer-System", "an error was detected on device\Device\Harddisk2\D during a paging operation what is this error,"D"drive" is a dvd - rw drive empty on the front of our Tower? :

    We had the people that our PC reconstruction after an accident some time ago, say "it seems that the Windows swap file was somehow moved on the disk"D", and it should be on the main 'C' drive.  Microsoft sent us an email with instructions on how to reset the Windows paging on 'C' drive system and to reset the minimum and maximum space allowed for it.  We did it, but the ' warnings are still there. " The "D" drive is a drive of dvd - rw empy on the front of our Tower.  Most of the time it is empty, as it is now.

    What are they and how to fix it?  I'm 73 years old and still learning.    Grandpa

    Hello

    Check to see if that helps!

    http://www.techsupportforum.com/forums/F16/event-ID-51-nf68i-an-error-was-detected-on-device-device-Harddisk0-d-during-a-PAG-273585.html

    http://support.Microsoft.com/kb/244780/en-us

  • Error: A parity error was detected on \Device\Ide\IdePort0 at system startup

    Original title: Windows XP error 11

    Event Viewer maintains with the following messages appears at the start of windows xp,

    The driver has detected an error of the Comptroller on \Device\Harddisk0\D.

    A parity error was detected on \Device\Ide\IdePort0.

    Hi plogmine,

    We recommend that you change the setting of firewall/security at different levels and then try to access files and folders on the network.

    See this article for more information: http://support.microsoft.com/kb/814112

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Critical error - no suitable graphics devices found

    Try to solve the problem of friends using TeamViewer, because they're 1000 miles :)

    He gets this message "Critical error - no suitable graphics devices found" on some of the games on Vista. I want to talk about Solitaire and Mahjong. InkBall works.

    Happened that recently so I suspected the Windows updates of the week passed and uninstalled them. No change.

    I uninstalled the graphics driver and had Windows download and reinstall. Same thing. I tried to download the latest drivers from Nvidia, but it fails on attempt (see http://img16.imageshack.us/img16/802...llerfailed.jpg).

    Because references to the problem of torque on the Interweb. Some have found using the system restore, but that came out under the name of each of them, I try I get a "system restore was not entirely successful," 'transient error', 0x800423f3.

    Someone suggested to remove and to reinstall .NET 1.1 which is a no go.

    Malwarebytes, Superantispyare and MSE are good.

    Thoughts?

    Hello

    This can help you to use the system restore to fix:

    1. If you are using Norton, you should disable Norton inviolable Protection before using the system restore.

    http://Service1.Symantec.com/support/sharedtech.nsf/pfdocs/2005113009323013

    2. try to use Safe Mode system restore.

    http://bertk.MVPs.org/html/restoresysv.html

    See you soon.

  • Windows Vista Home Premiun auto restoration and backup; Save the error code: i/o device error (0x8007045D), file backup complete normar will not complete successfully.

    Device error Code: i/o Device (08007045D) error Code... trying to make a backup of normal file that goes all the way and then produces this error code.

    Hey Rodney,
     
    To resolve this issue, follow these steps:
    1. Click Start, type cmd in the start search box, right-click cmd.exe in the list programs and then click Run as administrator.
    If you are prompted for an administrator password or for confirmation, type your password, or click on continue.
    2. at a command prompt, type the following command and press ENTER: Chkdsk/r X:
    Note: In this command, x is a placeholder that represents the drive letter of the volume you want to check.
    3. press y when you are prompted to check the drive the next time the system restarts.
    4. close all applications and restart the computer.
    Note: When you restart, Windows checks the drive for errors, and then Windows starts.
    5. after the computer restarts, repeat steps 1 through 4 for the other volume and try the backup operation again.
     
    For more information, see this article: http://support.microsoft.com/kb/952272
     
    I hope this helps.
     
    Kind regards
    Syed
    Answers from Microsoft supports the engineer.
  • Files could not be copied into a WD My Passport External Drive because of an error 0x8007045D i/o device

    I tried to copy files from my hard drive into an external Western Digital My Passport drive. But, as I was watching the progress of the copy of the files, I noticed that only four files have been copied to the external. A large majority of the files could not be saved due to an error 0x8007045D i/o device. I noticed it's the same error I get when I shut down my computer (in this case it is said error of breakpoint or something). Drag / drop files did not work. Still later, my USB key no longer works.  I tried to check my hard disk for errors, but my camera came out clear.

    I use Windows 7 Professional 32 - bit, E5800 Pentium Dual Core and an Asus motherboard.

    How can I get rid of this error because I need to transfer my files specifically in the external hard drive?

    Help, please. I'm not very tech savvy so simple instructions the better.

    Hi @roryheadmav!

    You can try the basic steps in such cases troubleshooting - first try to connect the hard drive to an another USB port of the computer and if possible with another USB cable.

    I hope that you will be able to transfer all the data you have, but in case it does not work, you can also boot into safe mode and try to copy the same and see if you can successfully complete the copy error-free operation. You can follow this article that describes how to enter Safe Mode.

    http://Windows.Microsoft.com/en-us/Windows7/start-your-computer-in-safe-mode

    Hope this helps and let me know how it went.

  • Backup associated with repeated warnings ID 51: an error was detected on device \Device\Harddisk1\DR1 during a paging operation (or \Device\Harddisk5\DR5)

    I just found out about 7 000 event ID 51 warnings in the event viewer.

    These warnings began when I started using an IEEE 1394 external drive for backup. I can't say if the more than 7,000 warning messages started after formatting, or when the backup began.

    About 5,000 messages occurred during the first backup which lasted several hours, back on February 24.

    All of them had: an error was detected on device \Device\Harddisk5\DR5 during a paging operation.

    Managed backup done this night here and as far as I know. (I don't look in the observer of events at this time.)

    The next day, at 11:00, the messages have started, but this time in bunches of a dozen or less within one or two seconds. And they all change to this:

    An error was detected on device \Device\Harddisk1\DR1 during a paging operation.

    Since then, the warnings occur sporadically. The backup program ran on 28 February, and produces over a thousand more. A group that's happened when I tried to back up the registry to a subdirectory on the drive yesterday.

    What is strange, is that the drive seems pretty much OK. Backup completed without error. I can copy files to it, and then copy it.

    Given that these are warnings, is this correct? A driver problem?

    the drive is using 6.1.7600.16385 (win7_rtm.090713 - 1255)

    I formatted just before using it for the backup. These are the old years, but we never had any problems with it before.

    Any ideas on how to understand what is happening?

    You can also try changing the driver firewire to INHERIT one. (Device Manager, Bus IEEE 1394 controller, software update driver, browse my computer, let me pick from a list... Choose the line of inheritance in it.

  • event ID #51, an error was detected on device \Device\Harddisk1\DR1 during a paging operation. ; Session "ReadyBoot" stopped because of the following error: 0xC0000188

    2 weeks ago I started to do, the driver has detected an error on \Device\Ide\IdePort0 controller, an error was detected on device \Device\Harddisk1\DR1 during a paging operation. ; Session "ReadyBoot" stopped because of the following error: 0xC000018. Event ID #51, #11 bottom line I check the disc, I restarted computer sometimes the logical disks and primary transmission is up to leave after a certain time.  About 6 months ago I bought a new car because I had the same problem.  I had checked, adjustment, cables, power, bios, software update settings, BIOS and decided he could be the player.  I used manufacturing software troubleshooting - the drive past all the test.  I used the S.M.A.R.T. test - it past.  As I said I check disk found nothing.  However, I deleted and brought another drive.  Now, I get the same indications listed above.

    Hi Robert,.

    I'm glad that you posted the request in the Microsoft community. If I understand correctly, you get an error message indicating boost loan session interrupted because of an error.

    Here is an article that talks about the error you are getting. Go through it and check.

    Here is an article on Ready Boost. Have a look at.

    Hope this helps and let us know if you need more assistance. We will be happy to help you.

  • 3FO error found no boot device

    Original title: Renabling UEFI Mode error

    Last time I reformatted my PC and disable cause UEFI Mode if I turn it off so I can't format my pc!

    [OS before format: windows 8 pro]
    [OS after format windows 8 pro
    Now after formatting, I tried to solve the UEFi, which disables the traditional way
    and I get error 3FO no boot device found!
    my hard drive works fine!

    Hi Eddie,.

    I suppose that you have an HP computer.  Please see this topic for a possible cause of the failure.

    http://h30434.www3.HP.com/T5/notebook-hardware/my-PC-is-saying-boot-device-not-found-hard-disk-3FO/TD-p/778869

    See also: http://h30434.www3.hp.com/t5/Notebook-Operating-Systems-and-Software/quot-Hard-Disk-3F0-BootDevice-not-found-quot-Error-Message/td-p/2443931

    Note: Changing the BIOS settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS settings can be solved. Changes to settings are at your own risk.

    I suggest you contact HP support.
    http://WWW8.HP.com/in/en/support.html

    I hope this helps.

Maybe you are looking for

  • 10.11.6 and Microsoft Office is not well

    Since the upgrade to 10.11.6, Microsoft Office does not work on my computer. I use Outlook and Excel almost everyday as well as Word and Powerpoint, and none of them will start even on my computer. Try to open the program a pop up comes up saying tha

  • Trying to update my iPad with 9.3 mini2

    I tried to update my iPad mini2 to 9.3, and he says no internet. Then connected to itunes Macbook Pro to do the update there. Now, it just says that its to date.  Its a 9.2.1

  • Satellite U920T - volume keys do not work

    I have the Toshiba laptop u920t factory standard and after a reboot, the volume (F9 and F10) keys do not work.I need to run the Toshiba Software function keys and select fix that solves the problem until the next reboot. How can I fix this annoying g

  • Could you recommend model HP laptop for Linux

    I'll buy a new laptop. The main requirements are Chipset AMD; GPU Radeon HD; operating system is Linux (Kubuntu). The purpose of the laptop is a programming and calculations with the help of the GPU (MATLAB, Maple, OpenCL applications). A liilte bit

  • switch from vista to xp - Int failed: E:\i386\asms.

    I'm trying to switch back to Windows XP, Vista. I had to send my laptop in for repair and they loaded Vista on it because that's what was on this subject during the purchase. I bought this from a company that had upgraded to XP, which I like much bet