Re-installing a module using CodeModuleManager...

Hello

I am installing a module via the code and I'm having a few problems...

The module is stored in the file system (/ store/home/user) and when I try to connect using a ContentConnection I get a ClassCastException in loop. If I change this on a FileConnection there is no exception but the methods Manager = CodeModuleManager.createNewModule (len); Returns the value 0 all the time.

Java component: 4.5.0

Tested on a Curve 8900 4.6.1.168

Code:

conn = (ContentConnection)Connector.open(MYCOD_PATH);
int len = (int)conn.getLength();
bais = conn.openInputStream();

            if (len > 0) {
                byte[] data = new byte[len];
                bais.read(data);
                    handler = CodeModuleManager.createNewModule(len);

                    boolean couldWrite = false;

                if (handler != 0){
                     couldWrite = CodeModuleManager.writeNewModule(handler, 0, data, 0, data.length);
                }

                if (couldWrite){
                     result = CodeModuleManager.saveNewModule(handler, true);  //force override of the existing module
                }

Any idea?

Change the Manager to the Manager = CodeModuleManager.createNewModule (len, data, len); and save the module does the job

Solved!

Tags: BlackBerry Developers

Similar Questions

  • problem with installing app using CodeModuleManager

    Hi, I tried to install the application with CodeModuleManager using this code:

    {} public void install()

    try {}
    httpConnection = (HttpConnection) Connector.open (s, Connector.READ_WRITE);

    is = httpConnection.openInputStream ();
    bytes = IOUtilities.streamToBytes (is);

    int myModule = CodeModuleManager.createNewModule (bytes.length, bytes,
    bytes. Length);

    CodeModuleManager.saveNewModule (myModule);
    notifyUser ("ok!");

    } catch (Exception e) {}
    notifyUser ("failed!" + e);
    } {Finally

    try {}
    If (is! = null) {}
    is. Close();
    }
    If (httpConnection! = null) {}
    httpConnection.close ();
    }
    } catch (Exception e) {}
    notifyUser ("Could not close" + e);
    }

    }

    }

    Sorry, I did not use "code" but it does not work for me... (I use opera 10, windows 7).

    the problem is that I myself 'ok!' which means that the app has been installed. but I'm not under downloads. I also tried to search in advanced-> applications (also under modules), but I don't the have not found. I checked the value of CodeModuleManager.saveNewModule (myModule); and he gave me '10', so it seems that there is something...

    I tested this code under bb 9000.

    is - anyone of you see an error in this code? or maybe I should set some options under the device?

    concerning

    YH... It was my stupid mistake... I used the url where the jad file was, not where the Cod...

    This works.

    concerning

  • How to install the output in bridge CC module using an apple OSX 10.9.5 and a miss apple OSX 10.11 this point completely in CC bridge!

    How to install the output in bridge CC module using an apple OSX 10.9.5 and a miss apple OSX 10.11 this point completely in CC bridge!

    Hi abev41080082

    Greetings.

    Concerning

    Rohit

  • Portege Z930 cannot start with installed RAM module

    My laptop Toshiba Portege Z930-108 has stopped booting with any module of RAM installed in the support.

    If I remove RAM module, laptop computer starts and works fine, but if I install any module of RAM (4 GB 1600 original or a new 4 1600 CL9 or 1600 8 CL11) the computer cannot start.

    The screen stays black and power led flashing two green and two orange and a few seconds later, 3G indicator also on blue.

    This is the only problem I have with this computer, but it's strange.

    I updated the BIOS to the latest version and the problem is not resolved.

    I tried to reset the hardware (http://aps2.toshiba-tro.de/kb0/TSB3B03J90000R01.htm), also I tried to reset the equipment with power button 30 seconds without battery but button without success.

    Any idea on this problem of strage?

    Kind regards
    Lito.

    I guess you used bad RAM or not fully compatible modules.
    It's the only plausible explanation.

    I recommend you to order the RAM modules recommended by Toshiba that are:

    4 GB DDR3 - 1600 PA5037U-1M4G

    2 GB DDR3 - 1600 PA5037U-1M2G

  • Satellite M30: cannot install common Modules after upgrade OS

    Hello world

    I changed my Win XP OS to Win XP Pro. Now I try to install common Modules, but when I try to run it, the installation is visible in Windows Task Manager, but nothing happens. You have an idea to help me?

    Thank you

    Hello

    First be sure that you install all the things in the order of good facilities. This means that the common Modules must be installed before you start the installation of any other tool of Toshiba or utility.

    Common modules can be installed like any other application following facilities Assistant.

    Unfortunately I can't tell you anything because I know what facilities order you used.

    Try to explain exactly how make you OS installation and configuration of the OS. Check also delivered the Tools & Utilities CD. I'm not sure at 100%, but perhaps here you can find the document html with the exact order of installations.

  • Install a Module high speed Mobile me

    G ' Day,.

    I recently bought two new HP Probook 650 G1s for my business. Unfortunately, I did not realize that the modules mobile broadband were not standard, so none of them have one but they need them.

    I am able to buy and install these modules myself? If so, are there instructions on how to do it safely?

    Thank you

    Hello

    Firtly you must purchase one from the following list, otherwise it may not work:

    Wireless HP lt4111 LTE-EVDO / HSPA + Mobile Broadband
    HP lt4112 LTE / HSPA + Mobile Broadband
    Hs3110 HSPA + Broadband Mobile HP
    Atheros 802.11b/g/n (1 x 1)
    Atheros 802.11b/g/n (1 x 1) and Combo Bluetooth® 4.0
    Broadcom 802.11a/b/g/n (2 x 2) and Combo Bluetooth® 4.0
    Intel Centrino Advanced-N 6205 802.11a/b/g/n
    Intel Centrino Advanced-N 6235 802.11a/b/g/n and Bluetooth® 4.0 Combo
    WiFi Intel Dual Band Wireless-AC 802.11ac 7260 (2 x 2) and Combo Bluetooth® 4.0

    Secondary, please use the following manual to get the part # (page #73), it also shows you how to install the WWAN module:

    http://h20628.www2.HP.com/km-ext/kmcsdirect/emr_na-c04030196-1.PDF

    Kind regards.

  • I have install the module "adblock more ' on my android furefox browser, but not block, he adds. What can I do?

    I have install the module "adblock more ' on my android furefox browser, but not block, he adds. What can I do? Please help me quickly.

    You should contact the https://adblockplus.org/forum/ extension

  • Impossible to install the modules that are hosted outside of AMO

    I can't install any add-on that is hosted outside of AMO, in Firefox for Android 40.0.3, nor in Firefox Beta for Android 41.

    What I think should happen: I have download the file as signed (it records to SD card), then open it with Firefox and Firefox should ask me if I want to install this module.

    What is really happening: an add-on is downloaded, but when I open it is file as with Firefox - nothing happens. Firefox comes to shows me a blank screen (see the screenshot).

    My friend has this problem too.

    Looks like a regression bug (because I could install add-ons hosted out of AMO without any problems in previous versions), but I'm not entirely sure.

    So my question is: should I file a bug on Bugzilla or is it possible to install the modules hosted outside of AMO to Firefox for Android and it's just me something wrong?

    My phone has Android v2.3.5.

    UPDATE: apparently, I can not install the modules of local files, but can do some some sites. My module (I have problem with) is hosted on Github, and I can't install it for whatever reason.

    Update 2: it seems that modules can be installed from Github if she is not just a file (because Github changed Content-Disposition of at least some types of raw file of 'inline' to 'attachment'), but a binary attachment to a "news release".

    Apparently, I found a work around for this problem, so that this issue does not require a response more.

  • my keyboard has sometimes unresponsive, despite verified the above. Then it works again after I have shut down and restart my mac. is this normal? If this isn't the case, that due to an application? for example, I installed photoshop and use it all the ti

    Jin

    Sometimes, my keyboard stops responding, despite the checkist troubleshooting.

    Then it works again after I have shut down and restart my mac!

    is this normal? If this isn't the case, that due to an application? for example, I installed photoshop and use it all the time... also openoffice document prog...

    What else could be?

    I just replace the keyboard with a new one, but the problem persists.

    my mac has also been in mac repair and they found nothing wrong.

    Thank you!

    Please run and view a report of EtreCheck http://etrecheck.com/

  • I can't install the modules from the official site of mozilla Add-ons. I click 'Add to firefox' and nothing happens! Help!

    I can't install the modules from the official site of mozilla Add-ons. I click 'Add to firefox' and nothing happens!

    Hello

    Please check if a green icon is added to the left of the icon in the Web site address bar after clicking on Add to Firefox. If it appears, click it, check the message and select the desired action.

    Another reason could be that the extension could block Javascript or other features of the site.

  • Can not install "Common Modules" on my Portege 2000

    I'm trying to install "V.6.01.00 of Toshiba common Modules" on my 2000 Portege XP Proffesional with SP2, but "ACPI namespace cannot! "GNS.exe end." error 5 times before the laptop then show me button and when I press "it is not and ACPI system" it is not possible to install the toshiba ACPI device ' error is displayed and close the application "V.6.01.00 of Toshiba of common Modules.

    I don't have Recovery CD from the laptop, so I install and standard Windows XP Pro with SP2 and install the drivers that I download from Web of Toshiba without problem, except a Standard floppy that I forget not all drivers and if I diasble usb floppy emulation does not disappear.

    I read a lot of information in the forum, but I don't know what the problem is, I know only that the functions keys and request many Toshiba are not working because I can not install "common modules".

    Thank you

    Hello

    I think that service pack 2 pre-installed XP could be the reason for this problem.
    On the Toshiba page, you will find an updated Microsoft Windows XP SP2 information! Read the entire document.
    Seems that you must update some applications if you want to run the operating system correctly!

    The EHCI controller must be updated and many others! Check it!

    Please don t forget to install display drivers! To my knowledge, it also includes the chipset driver.

  • Satellite A10: RGB Port is not installed - can not use external display

    Satellite A10 the RGB PORT is not installed & cannot be used as external display. I tried to install the communication or COM 1. interrupt code. What are the possible solutions?

    Hello

    What did you mean by "not installed"?
    Generally, you don't need to install anything. You don't need any drivers for this port 3.
    Windows XP drivers should work properly.

    Please check device manager if there are errors or yellow exclamation points.
    If the problem occurs for a short time, you can try to use the WinXP restore tool.
    This tool will reduce the BONE until the start.

  • Satellite A210 - cannot install common module and driver display

    Just down to XP, downloaded drivers from toshiba and the installation was completed with an error not saying no driver found for my hardware. That's happened with the common Module and ATI Display Driver.

    I mean, I need em both!

    Help!

    Hello

    I checked the page European driver of Toshiba and it seems that XP drivers have not been to this A210 series!

    I think that you just tired to install common Modules is not supported on this laptop.
    That is one reason why you can not install it.

    With regard to the display driver.
    Try to install the drivers for the laptop models:
    PSAEJE satellite A210
    Equium A300D PSAK2E
    Equium L350D PSLE2E
    Satellite P200 PSPBLE
    Satellite L350D PSLE0E
    Satrellite L300D PSLC0E

    In my opinion, one of the pilots freed from these series should run.

  • How to install Windows XP using USB Flash Drive in Windows 7?

    I m windows 7 and want to install windows xp, how to install windows xp using a usb flash drive. I have the iso file from xp.

    Hello

    The Microsoft Windows 7 USB/DVD download tool is designed for the installation of Windows 7, is not for the installation of XP.

    I suggest that you use Google that Microsoft does not support what you want to do.

    http://www.computerhope.com/issues/ch001366.htm

    ______________________________________________

    As you have the ISO file, make a record with him:

    https://NeoSmart.NET/wiki/Burning-ISO-images-with-ImgBurn/

    See you soon.

  • How to install the OS using a disc?

    w to install the OS using a disc?

    Visit this link to install it. http://TechNet.Microsoft.com/en-us/library/bb457089.aspx

    In addition, to use the wipe & charge. In addition, when you start xp installation cd, once you select

    install xp, choose to format the hd, once its thru, and the installation begins, it will require a precedent

    copy of windows install to verify that this is an upgrade (95,98, ME, etc.), it will not however be asked if

    you have a full xp installation cd.

Maybe you are looking for

  • iPad will not download the latest version and does not save my iPad even if I bought more space.

    Trying to free up space and to download the latest version. Space in iCloud bought, but not backup. What I am doing wrong, like friends for help.

  • Satellite P200 and screen LCD Samsung T240HD - impossible to get good resolution

    HelloI can't force my laptop P200 with radeon 2600hd to work properly with the Samsung T240HD LCD screen.Nor with the d - Sub or HDMI output. Using d - Sub maximum resolution I can get is 1024 x 768... monitor can go up to 1900 x 1200. With different

  • "Get Image" border added around indicators

    Last week, I was browsing these forums for a way to make a table of buttons (or indicators) with separate Boolean text for each button.  I came across a suggestion of I THINK it was Ben (sorry if I'm misattributing it) to use an array of 2D with a "M

  • How to prune and linearize the nonlinear models

    Hello. When I heard the Control Design and Simulation Module following the tutorial getting started with the simulation, I encountered the problem like this: When I MRT/linearize nonliner subsystem, there is an error: Y at - there someone who can hel

  • Matte screen

    Hello! I want to buy two or one of the following models for my business: Aspire E5 - 571 Aspire V3-572PG Aspire E5 - 571G BUT the key will be if one of these can be ordered with a MATTE SCREEN (without touchscreen). If this is not the case, what mode