ClassCastException on Manager.createPlayer problem with DataSource

I run the code BufferedPlayback (JDE 4.7.0) example loading a local file (LimitedRateStreamingSource to the source of data):

final LimitedRateStreamingSource source = new LimitedRateStreamingSource("file:///store/home/user/test/test.wav");
source.setContentType("audio/x-wav");
final Player player = Manager.createPlayer(source);

but when I create the player a ClassCastException is thrown.
Search with google I found this method performs a cast to CommonDataSource, and this leads to the exception (http://discussion.forum.nokia.com/forum/showthread.php?t=113902).

I can't figure out how to solve this problem... someone has any advice?

LimitedRateStreamingSource in this example expects a HTTP URL.  When you use it with a file:/// URL a FileConnection is returned by the Connector.open call, which triggers a ClassCastException.

You will need to modify the example to use a FileConnection instead of a ContentConnection.

Tags: BlackBerry Developers

Similar Questions

  • Error 16 and adobe application manager and problem with uninstalling

    Hello

    Big problem with ligthroom CC,

    Initially, I got the error 16, I changed the name of some files the other instructions.

    Now, Lightroom still doesn't work and ask me for the "Adobe Application Manager, which is absent or"injured", to run the trial version. But I no longer use the version been trying for over 2 months!

    I tried to uninstall Lightroom and it does not work, adobe talk a uninstall problem. I tried everything it was written and still does not work

    Please, help me!

    under PC

    Thank you

    Error 16: Creative Suite help / Error Configuration 16 | CC, CS: http://helpx.adobe.com/x-productkb/policy-pricing/configuration-error-cs5.html

  • H8-1447ez: problem with the recovery Image

    I have HP's ENVY h8 PC bought two years ago. Last week, I tried to update my OS to Win10 - in any case - I made the backup of the downloaded and installed on USB recovery Image Win10. Don't like it, then

    because win 10 deleted the entry of the new filming, I use my USB key to back to Win 8. After some problems, I successfully restored my old BONES, but it does not recognize the partition of

    the recovery Image - neither the original nor the USB.
    I mean, if I go to settings-> change the PC-> General settings-> delete everything and reinstal windows-> start-> Reset your PC-> next it says: cannot find the files needed

    Is it possible to fix this?

    Ladies and gentlemen: PROBLEM SOLVED...

    I have successfully restored my PC in its original configuration - if you want, I can write how separate article make (fix Recovery Manager and problem with Recovery Manager not seeing original missing recovery Image).

    @veilendank10: thanks for trying to help, but my problem is of a very different nature.

  • Problems with Manager.createPlayer)

    Hello

    I'm new in the world of development of BB... I'm doing a simple application that retrieves a file from a URL .wav and it plays, but the process is stuck on Manager.createPlayer (URL).

    I ran the application using the debugger and when it comes to this line he says 'source not found', here's a snippet of what I'm trying to do:

    public class MyPlayer implements PlayerListener, passable
    {

    Player;

    (I call this my main application thread and start it)

    {} public void start()
    Thread t = new Thread (this);
    t.Start ();
    }

    void run() {}
    try {}
                       
    String url = "http://java.sun.com/products/java-media/mma/media/test-wav.wav";

    Create an instance of player
                 Player = Manager.createPlayer (url); (it gets stuck in this line and the IDE shows a source not found)
    player.addPlayerListener (this);

    make the player
    Player.Realize ();
    Player.prefetch ();
    Player.Start ();
    }
    {} catch (Throwable t)
    reset (); This is a method of myself
    }
    }

    }

    The funny thing is that I tried the same code with a MIDlet and it works well in Nokia and Sony Ericsson simulators, but Blackberry is locked. I'm missing something here?

    I use Eclipse IDE, BlackBerry JDE component Pack Version: 4.5.0.16 and the Simulator Curve BlackBerry 8300 that come with the JDE.

    I also tried the application in a BlackBerry Pearl Simulator, with the same results

    Any advice will be highly appreciated = (...)

    I found the solution, the problem was that my emulator had no access to the internet, when he tried to connect to the URL and get the .wav file it so never found the source.

    I downloaded Blackberry email and MDS services Simulator package, which allows the internet connection for the simulators, and it worked!

    I could connect to the URL and play the .wav

  • Problem with Manager.createPlayer)

    Hello

    I want to play a little mp3 noise when I turn on my BB with a background application. So first, I tried this code in a foreground application:

        public void play()      {        //first we need to find the supported content types        String types[] = Manager.getSupportedContentTypes(null);        for (int cnt = types.length - 1; cnt >= 0; --cnt) {            if (types[cnt].equals("audio/mpeg")) {            //this sample demonstrates playing an MP3 file that has been             //added as a resource to the project            try {                //retrieve the MP3 file                Class clazz = getClass();                InputStream is = clazz.getResourceAsStream("/test.mp3");                //create an instance of the player from the InputStream                Player player = Manager.createPlayer(is, "audio/mpeg");                player.realize();                player.prefetch();                //start the player                player.start();                } catch (Exception ex) { System.out.println("ERROR -> "+ex); }             }         }    }
    

    But it does not work! It returns the exception "java.lang.IllegalArgumentException: flow: null". I think that it does not find test.mp3. I put the mp3 file in the same directory the files .java and .jdp.

    So, could you tell me what I have to add or delete of this code, listen to this sound (first in a foreground application) test please!

    And is it possible to play an mp3 sound with an application at the beginning of the unit?

    Thank you in advance!

    It is perhaps the issue:

    «I put the mp3 file in the same directory files .java and .jdp.»

    The MP3 resource must also be added to the project.

  • Problem Manager multiple selection with system dialog box

    I currently have a problem with the help of system on a manager of multiple selection dialog as the code below works fine:

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                id: deleteActionItem
                                onTriggered: {
                                    var selectionList = listView1.selectionList();
                                    var selectedItem = dataModel.data(selectionList);
                                    console.log(selectedItem);
    
                                    for (var i = 0; i < selectionList.length; ++ i) {
                                        _sql.deleteClient(dataModel.data(selectionList[i]).clientID)
                                        dataSource.loadData()
                                    }
                                }
                            }
                        ]
                    }
    

    However, when it is changed to use that a dialogue system, the feature does not work and the console record results:

    selected list: undefined

    selected item: undefined

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                id: deleteActionItem
                                onTriggered: {
                                    multiSelectDeleteDialog.show()
                                }
                                attachedObjects: [
                                    SystemDialog {
                                        id: multiSelectDeleteDialog
                                        title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged
                                        body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged
                                        onFinished: {
                                            if (result == 3) {
                                                console.log("Cancelled")
                                            } else {
                                                console.log("Deleted")
                                                var selectionList = listView1.selectionList()
                                                console.log("selected list: " + selectionList)
                                                var selectedItem = dataModel.data(selectionList);
                                                console.log("selected item: " + selectedItem);
    
                                                for (var i = 0; i < selectionList.length; ++ i) {
                                                    _sql.deleteClient(dataModel.data(selectionList[i]).clientID)
                                                    dataSource.loadData()
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    }
    

    With the help of Roger Leblanc, it works now

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                property variant selectionList
                                property variant selectedItem
                                id: deleteActionItem
                                onTriggered: {
                                    deleteActionItem.selectionList = listView1.selectionList()
                                    deleteActionItem.selectedItem = dataModel.data(selectionList);
                                    multiSelectDeleteDialog.show()
                                }
                                attachedObjects: [
                                    SystemDialog {
                                        id: multiSelectDeleteDialog
                                        title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged
                                        body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged
                                        onFinished: {
                                            if (result == 3) {
                                                console.log("Cancelled")
                                            } else {
                                                console.log("Deleted")
    
                                                for (var i = 0; i < deleteActionItem.selectionList.length; ++ i) {
                                                    _sql.deleteClient(dataModel.data(deleteActionItem.selectionList[i]).clientID)
                                                    dataSource.loadData()
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    }
    
  • I had some problems with my pc, since then when I close Firefox it would not reopen unless I go to Task Manager and end the process for FF.

    I had some problems with my pc, since then when I close Firefox it would not reopen unless I go to Task Manager and end the process for FF. I uninstalled FF and re-installed and no change.
    Walt

    I have a same problem.

  • Problems with the Power Manager 1.51 new T60 has

    I've updated Power manager version 1.51 has and I have problems with the gauge of Power Manager in the task bar. Life remaining battery is not updated once more. Is there any chance I can find an earlier version of the software that worked perfectly before? Or there is a method to solve the problem?

    Sincerely,

    Nikita Septucha


  • Problems with Windows Update! ("some settings are managed by your system administrator"?)

    I seem to have problems with my windows update. Last week when I checked to see if updates were needed that I was unable to view them because he said that "some settings are managed by your system administrator" who won't let me change the settings and the display of updates. It's my own personal computer so I am the administrator. However, this week update windows begins to function normally because there was an update available and I managed to download it, but a few days later, the windows on the screen update returned to say that "some settings are managed by your system administrator. I did a scan for spyware/adware/virus recently and I had only a low risk of adware that was detected and deleted without modification with windows update. This problem started right after that I got a warranty of software installed by Dell, I don't know if what they did could cause the problem. The system I use is Windows Vista Home Premium Service Pack 2. Any help would be greatly appreciated!

    You can see the effects of a hijackware infection. That being said...

    McAfee applications (and Norton) are known for not not upgrade (or uninstalling) itself.

    1. run this triple McAfee fix: http://service.mcafee.com/FAQDocument.aspx?id=TS100507

    2. After completing step 3 of triple correction, manually & repeatedly update your McAfee application until you get a prompt 'no more updates'.

    3. open Internet Explorer (only) to http://support.microsoft.com/kb/971058 & run it in DEFAULT and modes difficulty then AGGRESSIVE. [1]

    4. restart & test by...

    How will I know if my computer is up to date? :
    http://Windows.Microsoft.com/en-us/Windows-Vista/how-can-I-tell-if-my-computer-is-up-to-date

    ~~~~~~~~~~~~~~~~~~~~~~~~
    [1] full Disclosure: the difficulty operating in AGGRESSIVE mode will remove your update history but not the list of installed updates.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Problems with Aero and Desktop Manager

    All these problems started after I downloaded an upgrade of windows (last year I think). Whenever I started my computer to the taskbar and stuff Aero initiated very well, then after a few seconds the taskbar became white and disable Aero. Now, it is even worse, Windows just to start with the Basic (looking for old windows) theme and even if I try to restart the Desktop Window Manager, it will not work. Yesterday I installed and Nvidia card (the PC came with a built-in video chip only) and I was hoping to get the fix for the problem, but did not *. I also downloaded the Fix Aero tool and nothing. Even the msconfig.exe won't help. What can I do? It frustrates me.

    Hello

    If you have already tried to run the fix in the below gave link, try the steps that are proposed in the given link and check if that helps.

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-Windows-Aero

    Hope that information was useful

  • Problem with touch in a focus Manager

    I searched the threads on this topic but impossible to find a solution.

    Here's the thing: I have a screen, to which I add a custom handler that I add other components such as buttons, textfields, other managers and so on.

    One of the components of this is a focus Manager, I did work as a button, because he was too customized to be a button, with two blocks of text and a bitmap.

    In a trackball device it works fine, when I ride down he's focused and I can select normally, but when I use a camera touch (9550) touchs are ignored.

    I had other problems with Tush, I used a VerticalManager for the front screen and no matter where I hit, the only button I could choose was the last. Then I changed VerticalManager to the Manager and it worked, but the focus Manager I mentioned previously still did not work.

    Any ideas?

    Thanks in advance.

    Kind regards

    Dan

    It seems that the Manager cannot be selected unless there is an active field inside so you need to touch this area.

    So, the solution is to add a new field to the handler, like this:

    add(managerFocusButton = new Field() {
        protected void paint(Graphics graphics) {
        }
        protected void layout(int width, int height) {
            setExtent(width, height);
        }
        public boolean isFocusable() {
            return true;
        }
        protected void drawFocus(Graphics graphics, boolean on) {
        }
    });
    

    And then this kid with the width and height of his Manager.

    The field is not visible and the Manager won't entirely.

    Thank you.

  • Problem with DVD player and get the error code 19 Device Manager

    Original title: TSSTcorp CDDVDW SH - 224DB ATA device

    Windows cannot start this hardware device because its information of configuration (in the registry) is incomplete or damaged. (Code 19)

    How to fix it please Message Please please how to fix it

    Hi Emerald,

    Please contact Microsoft Community. I understand that you have a problem with the CD\DVD drive and get the error code 19 Device Manager. I've surely you will help solve this problem.

    To better understand the issue, I would like to know if you have any recent software or hardware on the computer changes before this problem?

    This problem might have occurred because of these reasons:

    1. Install or uninstall the CD or DVD recording programs.
    2. Uninstall Microsoft Digital Image.

    Try the steps listed here and see if it helps:

    I suggest you try the procedure described in article which will correct corrupted registry entries. Check if it helps.

    Your CD-ROM or DVD drive is not recognized by Windows or other programs
    http://support.Microsoft.com/kb/314060/en-us

    Note: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information on how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    Hope this information helps. Reply to the post with an up-to-date report of the issue so that we can help you further.

  • Problem with disk management.

    To increase the size of drive, I installed win 7 64 bit from a cloned on a WD Green 3 TB hard drive backup.  When I go to disk management I have the following: Disk 0: base / system reserve 1.87 GB NTFS healthy, "C:" 2046,13 GB NTFS healthy, no Boot affected 746,52 GB.

    I could not wish 'C' in the unallocated space.  Is this possible and if so, what is the procedure?

    Thanks for the help

    There is a specific problem with windows that imposes a limit of 2 GB on hard drives. This can be overcome by using a GPT partition table, but then needs a UEFI BIOS in order to boot from it.

  • problem with the windows Task Manager.

    Hello.i uses windows 7 64 bit and I have a problem with my windows task manager.i am still able to use the windows task manager but when it appears, the tab all lack .it s display only a program this running.i hope you can help solve this problem.thank you.

    To regain the tabs and information, double-click on the outside edge of the window.

  • I get a box that says, please verify your billing information. We discovered a problem with your last payment for creative cloud. Go online to manage your account and check your billing account. 19 days remaining. What is c?

    I get a box that says, please verify your billing information. We discovered a problem with your last payment for creative cloud. Go online to manage your account and check your billing account. 19 days remaining. What is c?

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

Maybe you are looking for

  • Air iPad 2

    air2 iPad no charging current display on itunes

  • Re-install can't find drive

    Windows XP operating system does not load. I tried to repair the OS by following the instructions found here, but when I click on R a message appears it cannot find any hard drive to install the operating system to. I'm dead in the water or is it pos

  • Can HP 17-J005EA I switch to a SSD

    Hi all How do I know who and what makes the SSD are compatible with this laptop *. My new laptop is amazing and I am very satisfied with the performance. But... I do not understand for a laptop for the price of... Well, we know the price, it did not

  • Cannot open first pro because he says drivers are not found. Help!

    I had adobe cs5 first pro on my computer for years now and there are a couple of weeks, it stopped working.  A pop up appears and indicates the following (first adobe has not found any capable video modules.  Please update your video display drivers

  • BlackBerry Smartphones please Hellp me on this

    I RECENTLY BOUGHT A BLACKBERRY BOLD 9900 4 BUTTON. I AM FACING A LOT OF PROBLEMS WITH THE SOFTWARE. THE MAIN PROBLEM THAT I ENCOUNTER IS, AFTER MAKING SOME CALLS (ABOUT 20-30 SOMETIMES STILL 5-10) INCOMING CALLS AND MAKING CONTINUOUS CALLS I CAN'T HE