Error if I do, Error if I dont!!!

Hey, I'm having problems with my code.
if (midiIOIn == thisThread) {
               try {
                    Transmitter getTrans = MidiSystem.getTransmitter();
                    Sequencer setSeq = MidiSystem.getSequencer();
                    MidiEvent recMSG;
                    MidiMessage getMSG1 = recMSG.getMessage();
                    int recStatus = getMSG1.getStatus();
                    byte[] getMSG2 = getMSG1.getMessage();
                    String statusString = Integer.toString(recStatus);
                    String messageString = getMSG2.toString();
                    gui.midiInTextField.setText(statusString);
                  gui.midiStatusTextField.setText("Data Received");
               catch (MidiUnavailableException ex1) {
                   System.out.println("FAIL");
           }The line: MidiEvent recMSG; gives me the error variable has not been initialized*, when I intialize it with *'= null'* it goes away and I can compile my program, but when I hit the button to receive MIDI information I get a +'NullPointerException'+ on the next line down.
Can anyone help me with this problem?
Greatly appreciated,
Tom

Maybe you need to have this variable refer to some non-null object? Just a thought.
Sorry, not meaning to be smug (OK, maybe a little), but what do you expect will happen if you do:
MidiEvent recMSG = null;
MidiMessage getMSG1 = recMSG.getMessage();You're trying to call a method on a null object, so of course you'll have a NPE. The solution: get a decent MidiEvent object first before trying to call a method on it. I'm not familiar with Java Midi programming, but it almost sounds as if a MidiEvent object would be passed as a parameter to the method for a Midi-Listener of some type. I'm sure the API will show you the way.
Edited by: Encephalopathic on Dec 23, 2009 2:12 PM

Similar Messages

  • I click on itunes but doesnt open and says send error report or dont send

    i click on itunes but doesnt open and says send error report or dont send

    You will need to provide more details as we cannot see your computer screen. Does this happen every time you launch LabVIEW? What version of LabVIEW are you using? What version of Windows? Does LabVIEW crash? If so, what were you doing at the time it crashed?

  • Windows prompting send error report or dont send

    when am using labview application windows prompting send error report or dont send can some one help in this..I did all re installation and windows update but no use..

    You will need to provide more details as we cannot see your computer screen. Does this happen every time you launch LabVIEW? What version of LabVIEW are you using? What version of Windows? Does LabVIEW crash? If so, what were you doing at the time it crashed?

  • I am facing problems while openin an application in facebook and other places.when i go to the application,an error shows and firefox closes autmatically either i send error reports or dont.....plz help

    i am facing problems while openin an application in facebook and other places.when i go to the application,an error shows and firefox closes autmatically either i send error reports or dont.....plz help

    Notes:
    1) Please use the code tags when posting code or JNLP/HTML. It helps to retain indentation and avoids asterisks and plus sings being interpreted as formatting marks. To do that, select the code/JNLP etc. and click the CODE button seen on the Plain Text tab of the message posting form.
    2) That launch file is invalid. You might check it (and the project in general) using JaNeLA.
    3) The only place that SimpleSerial class could be, that the JRE would find, is in the root of aeon.jar. Is it actually there?

  • Im getting a java error but i dont see that i missed any updates

    im getting a java error but i dont see that i missed any updates

    rmbrewer wrote:
    im getting a java error
    What version of OS X?
    What app is giving you an error?
    Exact wording of the error?

  • Whenever i try to open my after effect it just says error 15 n dont work plzz help me out

    whenever i try to open my after effect it just says error 15 n dont work plzz help me out

    We cannot know. you are not telling us anything about your system, what kind of project, what footage etc. We don't even know what version of AE!!! In any case, run the Creative Suite Cleaner Tool, reinstall the program. If the issues persist, we realyl need a lot more info to help you.
    Mylenium

  • TS3694 im trying to reset my iphone 4 att. but it keeps giving me error 3194. i dont know the restriction ow

    im trying to reset my iphone 4 att. but it keeps giving me error 3194. i dont know the restriction pw
    it dose not let me update software

    Error 1004, 1013, 1638, 3194: These errors may be the result of the connection to gs.apple.com being redirected or blocked. Follow these steps to resolve these errors:
    Install the latest version of iTunes.
    Check security software. Ensure that communication to gs.apple.com is allowed. Follow this article for assistance with security software. iTunes for Windows: Troubleshooting security software issues.
    Check the hosts file. The restore will fail if there is an active entry to redirect gs.apple.com. Follow iTunes: Advanced iTunes Store troubleshooting to edit the hosts file or revert to a default hosts file. See section "Blocked by configuration: (Mac OS X/Windows) > Rebuild network information".
    Try to restore from another known-good computer and network.
    If the errors persist on another computer, the device may need service.

  • Hello,i have a macbook pro and i just recently downloaded facetime, and now i cant use it, it says An internal FaceTime error occurred,i dont know how to fix it, please help.

    hello,i have a macbook pro and i just recently downloaded facetime, and now i cant use it, it says An internal FaceTime error occurred,i dont know how to fix it, please help.

    If your webcam is powered by USB, make sure it is attached directly to your Mac and not a USB hub.  In my case, I had my Rocketfish webcam attached to a peripheral USB hub and it wasn't drawing enough power to operate at capacity.  Therefore, Facetime was quitting on me and giving me that exact error message.  Once I attached the webcam directly to my Mac USB port, problem solved.  Hope that helps. 

  • My ipad will not come on.  i tried to restore and get error message 1603, dont know how to take out itsw

    my ipad will not come on.  i tried to restore and get error message 1603, dont know how to take out itsw which it tells me to do.

    Error 1603
    Follow the steps listed below for Error 1604. Also, discard the .ipsw file, open iTunes and attempt to download the update again. See the steps under Advanced Steps > Rename, move, or delete the iOS software file (.ipsw) below for file locations. If you do not want to remove the IPSW  in the original user, try restoring in a new administrator user. If the issue remains, Eliminate third-party security software conflicts.
    Error 1604
    This error is often related to USB timing. Try changing USB ports, using a different dock connector to USB cable, and other available USB troubleshooting steps (troubleshooting USB connections. If you are using a dock, bypass it and connect directly to the white Apple USB dock connector cable. If the issue persists on a known-good computer, the device may need service.
    If the issue is not resolved by USB isolation troubleshooting, and another computer is not available, try these steps to resolve the issue:
    Connect the device to iTunes, confirm that the device is in Recovery Mode. If it's not in Recovery Mode, put it into Recovery Mode.
    Restore and wait for the error.
    When prompted, click OK.
    Close and reopen iTunes while the device remains connected.
    The device should now be recognized in Recovery Mode again.
    Try to restore again.
    If the steps above do not resolve the issue, try restoring using a known-good USB cable, computer, and network connection.
    The above is from the 2nd link below.
    Update and restore alert messages on iPhone, iPad, and iPod touch
    http://www.buybuyla.com/tech/view/012953a0d412000e.shtml
    iOS: Resolving update and restore alert messages
    http://support.apple.com/kb/TS1275
    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
     Cheers, Tom

  • HT201442 every time i try to update my ipad, something (error) happends. why dont u fix that for us? why is this always complicated? how may i solve error 3194 now? why updating a software version is so complicated?

    every time i try to update my ipad, something (error) happends. why dont u fix that for us? why is this always complicated? how may i solve error 3194 now? why updating a software version is so complicated?

    Did you take a look at the link that you tagged?

  • I have iphone 4 os 7.04, tried updating to 7.1, but continously shows error that I dont have working internet connection, though I have one and tried via wifi and 3g same error comes. The update has been downloaded, agree pressed but no further??

    I have iphone 4 os 7.04, tried updating to 7.1, but continously shows error that I dont have working internet connection, though I have one and tried via wifi and 3g same error comes. The update has been downloaded, the page shping license agreement comes. As soon as I press agree, it asks me to wait for verification and then this error that there is no working internet connection comes, even though I have one and it works fine

    Try these steps as needed:
    Reset phone: press both the home and power buttons, releasing when the Apple logo appears
    Settings > General > Reset > Reset Network Settings.  You will have to re-enter WiFi passwords
    Connect phone to iTunes on your computer and update using iTunes
    iOS: How to update your iPhone, iPad, or iPod touch

  • Does anyone no how to fix an error 50 i dont no what it is

    how do I fix an error 50 on my iphone 3g it wont let me restore my backup files

    Hello lynn,
    Thanks for using Apple Support Communities.
    From your post I understand that you're having issues when trying to restore your iPhone from a backup.  To start with please follow the troubleshooting in this article below.
    Resolve iOS update and restore errors in iTunes
    http://support.apple.com/kb/TS1275
    If you continue to have the issue, follow the steps in the article below.
    iOS: If you can't back up or restore from a backup in iTunes
    http://support.apple.com/kb/TS2529
    Take care,
    Alex H.

  • When hit the 'home' icon, i get the error message and dont get back to home page

    When moving from a website, I press the "HOME" icon but I always get an error message but never going back to the home page. How can I solve this problem. Thanks.

    What error message do you get?
    Can you attach a screenshot?
    *http://en.wikipedia.org/wiki/Screenshot
    *https://support.mozilla.org/kb/how-do-i-create-screenshot-my-problem
    Use a compressed image type like PNG or JPG to save the screenshot.

  • Another critical steam error / bug - i dont know ^^

    Hey there.
    I just set up Steam for Cs 1.6 - everything worked fine i could play with about 30 fps ^^...
    well i was fine with that as long i could play but then it stopped working.
    (alredy fixed that ingame features for friendlists etc)
    when i now run steam and start cs im able to connect to a server and play for about 30 seconds before my macbook freezes.
    the only thing i can do then is hard reboot it
    the fan is running fast enough and every temperature is acceptable range.
    i already tried to log the wine output with: wine Steam.exe > steam.log
    but its empty.. someone told me to log it with: wine Steam.exe > steam.log 2>&1 (i dont know what this means but it did not work also...)
    some specs:
    wine-1.1.4
    kde4
    Arch linux on a macbook.
    init script for cs:
    #!/bin/bash
    # WINE binary
    CDLOADER_WINE="wine"
    # Steam directory
    STEAMDIR="$HOME/.wine/drive_c/Program Files/Steam"
    cd "$STEAMDIR"
    WINEDEBUG="-all" nice -n -8 wine Steam.exe
    EDIT: forgot my xorg.conf...
    Section "Device"
    ### Available Driver options are:-
    ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
    ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
    ### [arg]: arg optional
    #Option "NoAccel" # [<bool>]
    #Option "SWcursor" # [<bool>]
    #Option "ColorKey" # <i>
    #Option "CacheLines" # <i>
    #Option "Dac6Bit" # [<bool>]
    #Option "DRI" # [<bool>]
    #Option "NoDDC" # [<bool>]
    #Option "ShowCache" # [<bool>]
    #Option "XvMCSurfaces" # <i>
    #Option "PageFlip" # [<bool>]
    Identifier "Card0"
    Driver "intel"
    VendorName "Intel Corporation"
    BoardName "Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller"
    BusID "PCI:0:2:0"
    EndSection
    i already tried to set Option "AccelelMethod" to "xaa" and to "exa" with MigrationHeuristic "greedy" "normal" "smart"....
    does anyone have any suggestions what is going wrong or how i could log it?
    greeting simuru.
    Last edited by simuru (2008-09-11 10:41:01)

    no suggestions? not even how i can log it?

  • Whenever we click on any of the link to open it, the firefox shows popup - an error having two buttons 'Send Error Report' and ' Dont Send'. Clickking on either of them closes the firefox and it is continously irritating us a lot.

    any it site it may be, clicking on any link which opens in a new tab or a window, always firefox gets crashed. Please reply the solution as soon as possible as it is really very very irritating.

    See:
    *http://kb.mozillazine.org/Firefox_crashes
    *https://support.mozilla.com/kb/Firefox+crashes
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    Delete the files sessionstore.js [2] and sessionstore.bak in the Firefox Profile Folder.
    * Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    If you see files sessionstore-##.js with a number in the left part of the name like sessionstore-1.js then delete those as well.<br />
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    See also:
    * [1] http://kb.mozillazine.org/Session_Restore
    * [2] http://kb.mozillazine.org/sessionstore.js

Maybe you are looking for

  • Change Column Headings in ALV Report Using OO

    Hi Friends, I am using OO to display a report with ALV Grid I tried to change the column names but it still takes the column names from the DDIC. My declaration is as  follows Data: num type dmbtr. TRY.             lr_column ?= lr_columns->get_column

  • Can't restore iPod Classic - Error 1439

    I tried plugging in my iPod one day to put new songs on my iPod, but it was freezing my computer and I had to restart my computer. When I restarted my computer, suddenly my iPod was reading 'Plug to computer to restore'. Which is strange itself, beca

  • In the middle of watching downloaded movie and ipad froze wont turn off

    Question?? In the iddle of watching dowloaded movie Ipad froze - will not do anything - time frozen, movie frozen. Cannot turn off - nothing. Help!!

  • RETAIL vs. BULK

    im planning to buy a radeon 9500 pro and check the retail stores around for prices. for a retail version the price is around $200 or so but if its a bulk version it prices around $165-170 which is aroun 30-40 cheaper than retail. but wuts the differe

  • DIsplalying BI reports with Folder structure in SAP EP7.0

    HI Dear Friends, I have  a requirement in my current project where i am integrating the BI reports with SAP EP.Iviews are associated with BI Reports.In the portal on clicking workset it should display folders in the portal content area with Icons ins