Persistent data store must signed Key?

I don't know if I changed another somenting, but since I've implemented persisted data, I can not run the application on my real device...

I get: error at startup appname: Module "appname-2' attempst to access a secure API."

I don't want to buy a key signed because I don't need...

That's what I use:

Net.rim.device.api.system import. *;

... code...

long KEY = "APPNAME.COM".hashCode ();

persist is PersistentStore.getPersistentObject (KEY);.

SerialRegistrado = (String) persist.getContents ();

If (SerialRegistrado == null) {}

application.popScreen (this);

new Valida (application, next);

SerialRegistrado = new String();

SerialRegistrado = "Epaloco";

persist.setContents (SerialRegistrado);

Persist.Commit ();

}

If it does not need a signature key, can someonel help me how to identify code that needs a key?

I checked http://na.blackberry.com/eng/developers/javaappdev/codekeys.jsp but cannot find anything

Help, please...

Of PersistentStore API:
Category: Signed: This element is accessible only by the signed applications. If you intend to use this item, please visit http://www.blackberry.com/go/codesigning for a set of keys for code signing. Code signing is required for applications running on BlackBerry smartphones. development on the BlackBerry Smartphone simulators can occur without code signing.
Since: JDE 3.6.0

Tags: BlackBerry Developers

Similar Questions

  • I need a few persistent data store help of Pentecost

    Hi, I have a problem, try to store persistent data, I m using Eclipse 3.4.2 and BlackBerry plugin, as I check my work with the correct laboratory and my code hasn´t issues only a warning I see on the laboratory code it s normal, but when I try to run the Simulator I get this:

    "Eception exception: lack of measurement of the resource.

    and this is the code

    package com.rim.someguy;
    
    //Import section
    import net.rim.device.api.ui.*;
    import net.rim.device.api.ui.component.*;
    import net.rim.device.api.ui.container.*;
    import net.rim.device.api.system.*;
    import net.rim.device.api.util.*;
    import net.rim.device.api.i18n.ResourceBundle;
    import java.util.*;
    
    public class measure extends UiApplication implements measureResource{
    
        //Variables for user interface fields
        private EditField numMeasureDev;
        private AutoTextEditField observation;
        private EditField lecture;
        private ObjectChoiceField choice;
        private EditField date;
    
        //Persistent data
        private static Vector data;
        private static PersistentObject store;
    
        //Resource bundle variable
        private static ResourceBundle _res;
    
        //MAIN
    
        public static void main(String[] args){
            measure app = new measure();
            app.enterEventDispatcher();
        }
    
        //Save Menu
        private MenuItem saveItem = new MenuItem(_res, SAVE, 110, 10){
            public void run(){
                StoreInfo nfo = new StoreInfo();
                nfo.setElement(StoreInfo.NUM, numMeasureDev.getText());
                nfo.setElement(StoreInfo.LEC, lecture.getText());
                nfo.setElement(StoreInfo.DAT, date.getText());
                nfo.setElement(StoreInfo.SEL, _res.getString(choice.getIndex()));
                nfo.setElement(StoreInfo.OB, observation.getText());
                data.addElement(nfo);
    
                //Storing data
                synchronized(store){
                    store.setContents(data);
                    store.commit();
                }
                Dialog.inform(_res.getString(APP_SUCCESS));
                numMeasureDev.setText(null);
                lecture.setText(null);
                date.setText(null);
                choice.setLabel(null);
                observation.setText(null);
            }
        };
    
        //Get Menu
        private MenuItem getItem = new MenuItem(_res, GET, 110, 10){
    
            protected int index;
    
            public void run(){
                synchronized(store){
                    data = (Vector) store.getContents();
                    LabelField label = new LabelField();
                    label.setText("Selecciona el dato a mostrar: ");
                    BasicEditField bef = new BasicEditField();
                    index = Integer.parseInt(bef.getText());
                    if (!data.isEmpty()){
                        StoreInfo nfo = (StoreInfo) data.elementAt(index);
                        numMeasureDev.setText(nfo.getElement(StoreInfo.NUM));
                        lecture.setText(nfo.getElement(StoreInfo.LEC));
                        date.setText(nfo.getElement(StoreInfo.DAT));
                        choice.getIndex();
                        observation.setText(nfo.getElement(StoreInfo.OB));
                    }
                }
            }
        };
    
        //Persistent Object
        static{
            //Resource Bundle
            _res = ResourceBundle.getBundle("measure");
    
            //Get the reference to PersistentObject and set value to Vector if is empty
            store = PersistentStore.getPersistentObject(0xdec6a67096f833cL);
            //key is a hash
            synchronized(store){
                if (store.getContents() == null){
                    store.setContents(new Vector());
                    store.commit();
                }
            }
        }
    
        //Class created for a persistent object StoreInfo
        private final static class StoreInfo implements Persistable{
    
            //Data for elements
            private Vector elements;
    
            //Fields
            public static final int NUM = 0;
            public static final int LEC = 1;
            public static final int SEL = 2;
            public static final int OB = 3;
            public static final int DAT = 4; 
    
            //in StoreInfo, add a new empty Vector with capacity of 4 elements and persist
            public StoreInfo(){
                elements = new Vector(5);
                for(int i = 0; i < elements.capacity(); ++i){
                    elements.addElement(new String(""));
                }
            }
    
            //Retrieve Vector element
            public String getElement(int id){
                return (String) elements.elementAt(id);
            }
    
            //Set Vector Element
            public void setElement(int id, String value){
                elements.setElementAt(value, id);
            }
        }
    
        //Measure constructor declaration
        public measure(){
    
            //Create a main screen
            MainScreen mainS = new MainScreen();
            mainS.setTitle(_res.getString(APPLICATION_TITLE));
            numMeasureDev = new EditField(_res.getString(TEXT1),"",
                    Integer.MAX_VALUE, EditField.FILTER_NUMERIC);
            lecture = new AutoTextEditField(_res.getString(TEXT5),"",
                    Integer.MAX_VALUE, EditField.FILTER_NUMERIC);
            date = new EditField(_res.getString(TEXT6),"");
            choice = new ObjectChoiceField(_res.getString(TEXT2),_res.getStringArray(OPTION));
            observation = new AutoTextEditField(_res.getString(TEXT3),"");
    
            //Adding elements to Screen
            mainS.add(numMeasureDev);
            mainS.add(lecture);
            mainS.add(date);
            mainS.add(choice);
            mainS.add(observation);
    
            //Adding menuItems to menu
            mainS.addMenuItem(saveItem);
            mainS.addMenuItem(getItem);
    
            //Push all elements to screen
            pushScreen(mainS);
        }
    }
    

    If anyone knows what I m hurt you showme how please!

    Two thoughts:

    1. If you have changed somehow the object type that you want to keep, you must remove the Simulator files before running again.
    2. How about you provide a clue as to where the class cast exception that happens? You are more likely to help in this way.
  • problem of persistent data store

    HI gentlemen

    I try to put in place the persistent object store, and I have a problem.

    1 problem: the key that I use for a few months, but sometimes when I getPersistentObject (key) it returns the null value, and in a certain type of bb phone, it always returns null, I what to ask is there a rule in key do?

    THX

    The usual practice is to use a facility to your tools to convert your package and name to an id, making it very unlikely that someone else will reuse the same ID.

    I have never see a null always return phone, even though I have stored a value in it.

  • persistent data store force mount

    Hello.

    I look for ways force mount the PowerCLI data store.
    and I found the following thread.

    PowerShell ResolveMultipleUnresolvedVmfsVolumes (equivalent of esxcfg - volume.pl)

    This is exactly the kind of thing I was looking for.
    But what is this script provide a constantly mounted?
    Need corresponds to the option "esxcfg-volume - M". '-m' option is not.

    Thank you

    I don't think that you can explicitly specify a persistent mount in the call to ResolveMultipleUnresolvedVmfsVolumes.

    You can check the persistence like this

    ....
    $Result = $vmHostSS.ResolveMultipleUnresolvedVmfsVolumes ($HUVRSarray)
    $Result | Select @{N = "Name"; E = {$_.vmfs.} Name}},@{N="persistent '; {E = {$_.vmfs.forceMountedInfo.persist}}

  • Detach a lun using the data store name?

    All (or Luc lol)

    I am wanting to use the disc to detach function, but instead of passing naa.id, I wish I could pass the name of a data store already disassembled data store to get the id of the naa. I would also like to pass a list of hosts, rather than to all guests who tied it.  I watched Alan functions but its going to each host rather than being able to move from a specific host.

    I took a slap at him earlier, but I'm a little confused on how to do it.

    http://www.lucd.info/2011/11/25/LUN-juggling-in-vSphere-5/

    Any help?

    With a small change to the functions of Alan, you can use a parameter of VMHost.

    In there, you specify one or more ESXi servers where the data store must be dismounted and detached.

  • What is the advantage to affect multiple virtual machines in a data store?

    Hello

    Quite a question stupid and basic, but I can't answer . What is the advantage of having multiple virtual machines in a store of VMFS data instead of having each VM in another VMFS data store? (eg. 3 VMs in 1 data store or 3 data warehouses and each virtual machine in one of them). I can only think about the ease of management for storage administrator because it creates only a single large LUN.

    Thank you

    By allowing multiple virtual machines in a data store, you can run more than 256 virtual machines in a DRS cluster.

    As a host has a limit of 256 scsi identification numbers, which means that it accesses no more than 255 LUNS shared. 1 scsi ID is used for local storage.

    In a DRS cluster as each host must be mapped to the same data warehouses to ensure that virtual machines can be moved on the cluster and run on any of the hosts.

    Now in my life as an architect VMware PSO I saw that a lot of virtual machines that require a single data store. The main reason to isolate a virtual machine on a data store must provide sufficient i/o performance. This can be achieved with other solutions than to isolate a virtual machine on a data store. Having a properly architected storage subsystem is crucial, vSphere can get out of a very large number of the IOPS / s. With technologies such as SIOC and DRS for storage, you can check that the virtual machines receive IO performance according to the needs.

  • Names of directory data store

    Hello

    Sorry for the N00b question, but I can't find an answer anywhere.

    I noticed that on my data stores, there are often multiple directories for the same customer. For example, if there is a guest named 'foo', there will be a directory "foo". But sometimes there will also be a directory named "foo_1".

    Whence the _1, < name >?  That is generated?

    TIA,

    T

    with the _1 means that the virtual machine has generally more than 1 HDD presented to her.

    But, in your case, by referring to the names of directories _1, it probably means that there are names that are duplicated in the data store.  A folder will be created when you create the virtual machine. The folder represents the object name of VMs.

    So, if I have a virtual machine named VM1, on the data store must be a VM1 folder with all the files associated with this virtual machine (.vmx, hard, etc.)

    If I create another virtual machine called VM1 and the content of the store data don't have not removed correctly a previous virtual computer that may have been moved, destroyed, removed from inventory, etc., there will be a VM1_1 folder with the associated files.  Have your records _1 files inside of them?

    You can also look something like RVTools.  It will help you find virtual machines that can be stunned. Check the Tab Vsante

  • Kickstart: Local data store destroyed do not reinstall it

    I noticed that when I reinstall ESXi 5 on a server already built, the previous local data store is not destroyed.

    I said to make a 'install' and 'overwritevmfs '.

    install - firstdisk = mptsas, local - overwritevmfs

    in the upper part of the kickstart but the store of previous local data remains.

    I tried to use clearpart

    clearpart - alldrives - overwritevmfs

    Yet the local data store of the previous generation, as well.

    Part of my process of kickstart is to rename the store local data (datastore1) to a meaningful name that includes the hostname so if I reinstall, the data store rename fails (since there is no datastore1 on the 2nd install).  Also, I need to know the name of the data store, as I'm checking out the files ' / ' when installing (via oem.tgz) and move before the first reboot in the section post % (or they will be gone). The only persistent location is the local data store. This also effects kickstart for resettlement syslog that goes to the local data store as well.

    Suggestions on how do I delete a data store local existing during the installation (unless you delete the RAID and re-create)?

    -JC

    I wrote the following script to rename the local old data store ESXi 5.0 using Primo-kickstart script:

    _____________________________________________________________________

    AcceptEULA

    #clearpart - firstdisk = cciss, local - all - overwritevmfs # removes all partitions on local drive (for G1 blade servers) but will not erase the label VMFS

    clearpart - firstdisk = hpsa, local - all - overwritevmfs # removes all partitions on local drive (for G6 blade servers) but will not erase the label VMFS

    install - firstdisk = hpsa, local - overwritevmfs

    rootpw SECRET

    reset

    % include/tmp/networkconfig

    % pre - interpreter = busybox

    # extract information network startup

    VMK_INT = "vmk0".

    VMK_LINE = $(localcli réseau ip interface ipv4 get | grep "${VMK_INT}")

    IPADDR = $(echo "${VMK_LINE}" | awk '{print $2}")

    NETMASK = $(echo "${VMK_LINE}" | awk '{print $3}")

    GATEWAY = $(esxcfg-route | awk '{print $5}')

    DNS = "10.130.0.21,10.130.0.22."

    Hostname = $(nslookup "${IPADDR}" | grep adresse | awk '{print $4}')

    echo ' network - bootproto = static - addvmportgroup = false - device = vmnic0 - ip = ${IPADDR} - netmask = ${MASK} - gateway = ${GATEWAY} - nameserver = ${DNS} - hostname = ${HOSTNAME} "> / MC

    p/networkconfig

    firstboot % - interpreter = busybox

    # Extract the host name of the host number

    # Example: HC - moon01.tapkit .net = ' 01, sc - moon02.tapkit .net = ' 02, sc - moonNN.tapkit .net = 'NN ',.

    HL ='hostname-s | WC-c"

    hostNum = $(nom d'hôte-s | cut-c'expr $hl-2'-'expr $hl-1')

    # Rename the local data store to something more meaningful

    # Find the current local data store NAME (exclude all the SAN HSV200 data store)

    DatastoreName = "$(liste étendue d'esxcli stockage vmfs |) grep ' esxcli - trainer = csv - format-param = fields = "Device, model" list of basic storage device | grep - v "HSV200". grep - v "Device". cut - d-f1' | AWK '{print $1}')'

    NewDataStoreName = "datastore$ hostNum.

    # Rename the data store

    Vim - cmd hostsvc/datastore/rename $DatastoreName $NewDataStoreName

    # copy % first startup script newspapers to persistent data store

    CP /var/log/hostd.log "/ vmfs/volumes/$NewDataStoreName/firstboot-hostd.log".

    CP /var/log/esxi_install.log "/ vmfs/volumes/$NewDataStoreName/firstboot-esxi_install.log".

    # Needed for configuration changes that cannot be performed in esxcli (thank you VMware)

    reset

    _____________________________________________________________________

    I hope this helps...

    A big thank you to William Lam for his great contribution: http://www.virtuallyghetto.com/2011/07/automating-esxi-5x-kickstart-tips.html

    Gilles Marcil

  • ESXi 4.1 reinstall without loss of data in the system data store

    Hello world

    because of incorrect tape device configuration (see more low http://communities.vmware.com/thread/289847?tstart=0), I have to reinstall Esxi 4.1 in the same place where the system partition is also home to the Oracle data disk (I didn't have the choice because the system starts on the table of great raid with SSDS, there was no such thing which allow me to pre partition the RAID disk into several partitions and choose) only a small partition to install ESXi files), what happens if I reinstall ESXi with the method of "REPAIR"? will be large files within the system data store destroyed or intact?  Help, please.  Any suggestions are greatly appreciated.

    When you do a normal installation of ESXi, the whole installation drive is wiped regardless of the existing partitions that exist.  With a repair only install ESXi system partitions are left.  Any data store must be perserved and after the repair, you can save any virtual machines that were welcomed on this data store.  If the repair not proceed with the installation (for example, if the data store exists in the first 900 MB of storage), then you will get a warning in this sense and a new facility (wipe the entire disk) is performed.

    So with a repair, you should be fine, but I want to take a backup without worrying.

    Dave

    VMware communities user moderator

    Now available - vSphere Quick Start Guide

    You have a system or a PCI with VMDirectPath?  Submit your specifications to Officieux VMDirectPath HCL.

  • Connect to ISO image on the data store

    Is it possible to do it with a script? If I mount the iso even several virtual machines at the same time?

    I tried: get-cddrive vm_name | game-cddrive - isopath 'vm_templates\iso-files\whatever\whatever.iso '.

    But it continues to error with an invalid message data store. Any ideas?

    The path of the data store must follow a specific syntax.

    Like this

    Get-CDDrive vm_name | Set-CDDrive -IsoPath "[datastorename] Folder\file.iso"
    

    Don't forget the test blank after the closing brackets!

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Failed to get the disk partition information when you add the new data store

    Hello

    Update my ESX to version 4 Update 1 (4.0.0, 256968). Now, I'm trying to add a new data store to a cluster in vCenter and receive the following error message when I will review the current structure of the disc "error when configuring the host: failed to get the disk partition information. When I click back, then next, there's no error message but in the formatting window, I get the error "Object reference" not set to an instance of an object.

    I see this question has been asked before, but I can't seem to find an appropriate response. Anyone? The interface using CLI instead of vCenter isn't an option (alignment VMFS, workload and so on)

    I use Dell R900 with an EMC Symmetrix VMax SAN

    The size of the LUN I want to add is 741 GB

    Concerning

    Marius Aulie

    If you have a virtual machine for Windows test, you could do the following, to ensure that the logic unit number has a clean partition table:

    -set the LUN as a GROSS physical to virtual machine device

    -Run diskpart, select the drive and run the CLEAN command

    -detach the LUN to the virtual machine

    -try to create the data on the LUN VMFS store

    The size of the block of the data store where the VM test can be a problem with the above. Due to the size of the LUN, the size of the block of the data store must be at least 4 MB. Attach the LUN to a physical test system could be an alternative.

    André

  • 'VM to data store' map shows inaccurate data

    We have a set of cluster HA with several data stores, all shared by the hosts in the cluster.  On the level "VM to the data store", I noticed that some hosts had lines connecting to two different data stores.  I assumed it was because the hard drive was on a data store, while the CD image has been stored on another.  In order to fix this, I went through and set all CD-ROM comments to "client".  While it worked for some customers, others are still on display as it is connected to two different data stores.

    Someone has any idea how to solve this problem?  We prefer that all the files of configuration of each guest, etc stored on the same data store.

    Take a look at one of your virtual machines with this double connection data store and see what files are on data warehouses. Also look at the data store that VC said that the virtual machine is located. I have seem a while ago when you create a new virtual machine and choose to add a virtual disk to another data store, virtual machine configuration files and files of delta snapshot in a data store, and the vmdk on another (if this is the case!).

    If your re - direct your shots, you will probably see this other data store must be referenced in the .vmx file in a configuration setting called WorkingDir =

    Thank you

    Neil

  • Cancellation of the assignment and reassign the data store by using different LUNS that datastore has not appeared.

    Hi all

    I have a data store after vdisk1 I have not assigned the vdisk to data store and reread the esxserver, the data store has disappeared.

    Again, I assigned the vdisk using the same number of logical unit as before and reread the esxserver, datastore appeared again return.

    But if I use a different assignment vdisk lun and on a new analysis of data store does not appear.

    Can someone tell me if the LUN must be even to see the store of data back again.

    If so why. ?

    Is there a vmware documentation to substantiate this claim.

    concerning

    Neela

    What do you mean by vdisk1?  The data store are stored as metadata on the LUN, when is formatted VMFS.  If you remove the LUN the VMFS is sitting on, then Yes, the data store will disappear.  If you only remove the vmdk who lives on this data store, then no, the data store must remain as it is, and you should be able to move the vmdk on the data store as needed.

    -KjB

    VMware vExpert

  • Must be signed with the RIM Runtime Code Signing Key (RRT) - example of code bar

    Hi, when I try to start the bardcode example in my device (9780 Smartphone), I get

    "Error starting BarCodeApp: Module 'BarCodeApp' must be signed with the RIM Code Signing Key (RRT) DURATION.

    The only class I have in my project is:

    import java.util.Hashtable;
    import java.util.Vector;
    
    import net.rim.blackberry.api.browser.Browser;
    import net.rim.blackberry.api.browser.BrowserSession;
    import net.rim.device.api.barcodelib.BarcodeBitmap;
    import net.rim.device.api.barcodelib.BarcodeDecoder;
    import net.rim.device.api.barcodelib.BarcodeDecoderListener;
    import net.rim.device.api.barcodelib.BarcodeScanner;
    import net.rim.device.api.command.Command;
    import net.rim.device.api.command.CommandHandler;
    import net.rim.device.api.command.ReadOnlyCommandMetadata;
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.system.KeyListener;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.Keypad;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.XYEdges;
    import net.rim.device.api.ui.component.BitmapField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.component.EditField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.container.FullScreen;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.decor.BorderFactory;
    import net.rim.device.api.ui.toolbar.ToolbarButtonField;
    import net.rim.device.api.ui.toolbar.ToolbarManager;
    import net.rim.device.api.util.StringProvider;
    
    import com.google.zxing.BarcodeFormat;
    import com.google.zxing.DecodeHintType;
    import com.google.zxing.common.ByteMatrix;
    import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
    import com.google.zxing.qrcode.encoder.Encoder;
    import com.google.zxing.qrcode.encoder.QRCode;
    
    /***
     * Barcode API Sample
     * 

    * This application demonstrates the most common use of the Barcode API: 1) * Creating and displaying a QR code, 2) Scanning a QR code and opening the * browser pointing to that URL. It could be easily modified to scan/create * other kinds of barcodes, or do other things with the scanned/created barcode. * * @author PBernhardt * */ public class BarcodeAPISample extends UiApplication { //This controls how big barcode we will display is to be private static final int BARCODE_WIDTH = 300; // This is the app itself private static BarcodeAPISample _app; // Errors will be logged here private LabelField _logField; // The main screen which holds the toolbar and displayed barcode private MainScreen _mainScreen; // The barcode is displayed here private BitmapField _barcodeField; // The text stored here is converted into a barcode by the user private EditField _barcodeTextField; // This controls the scanning of barcodes private BarcodeScanner _scanner; // This screen is where the viewfinderf or the barcode scanner is displayed private FullScreen _barcodeScreen; public BarcodeAPISample() { // New screen _mainScreen = new MainScreen(); // Create the log field so it can be used in this constructor _logField = new LabelField("Log: "); // Create the place-holder for the barcode image and add it to the main // screen _barcodeField = new BitmapField(new Bitmap(BARCODE_WIDTH, BARCODE_WIDTH), Field.FIELD_HCENTER); _barcodeField.setBorder(BorderFactory.createBevelBorder(new XYEdges(2, 2, 2, 2))); _mainScreen.add(_barcodeField); // Create and add the field to store the barcode contents _barcodeTextField = new EditField("Barcode text: ", "http://devblog.blackberry.com"); _mainScreen.add(_barcodeTextField); // Add "display barcode" and "scan barcode" toolbar buttons /** * This is a quick example of the new (in 6.0) * net.rim.device.api.command package and the * net.rim.device.api.ui.toolbar package. All it does is invoke the * displayBarcode() or scanBarcode() method when you click the * corresponding button. For more details on this package, see the * JavaDocs or elsewhere in the Developer Resource Center */ ToolbarManager toolbar = new ToolbarManager(); ToolbarButtonField displayBarcodeToolbarButtonField = new ToolbarButtonField(new StringProvider("Display")); displayBarcodeToolbarButtonField.setCommand(new Command(new CommandHandler() { public void execute(ReadOnlyCommandMetadata arg0, Object arg1) { displayBarcode(); } })); toolbar.add(displayBarcodeToolbarButtonField); ToolbarButtonField scanBarcodeToolbarButtonField = new ToolbarButtonField(new StringProvider("Scan")); scanBarcodeToolbarButtonField.setCommand(new Command(new CommandHandler() { public void execute(ReadOnlyCommandMetadata arg0, Object arg1) { scanBarcode(); } })); toolbar.add(scanBarcodeToolbarButtonField); _mainScreen.setToolbar(toolbar); // Add the log field to the bottom _mainScreen.add(_logField); pushScreen(_mainScreen); } // Simply create the the app and enter the event dispatcher public static void main(String[] args) { _app = new BarcodeAPISample(); _app.enterEventDispatcher(); } /** * displayBarcode *

    * This method will take the text in the _barcodeTextField, convert it into * a QRCode and display it on the main screen. It could be easily modified * to use a different barcode format or to get the text from somewhere else. */ private void displayBarcode() { try { QRCode qrCode = new QRCode(); // This encodes the text with a low level (%7) of error correction Encoder.encode(_barcodeTextField.getText(), ErrorCorrectionLevel.L, qrCode); // From there we get the actual data matrix and convert it into a // bitmap ByteMatrix barcode = qrCode.getMatrix(); Bitmap bitmap = BarcodeBitmap.createBitmap(barcode, BARCODE_WIDTH); _barcodeField.setBitmap(bitmap); } catch (Exception e) { log("Exception: " + e); } } private void scanBarcode() { // If we haven't scanned before, we will set up our barcode scanner if (_barcodeScreen == null) { // First we create a hashtable to hold all of the hints that we can // give the API about how we want to scan a barcode to improve speed // and accuracy. Hashtable hints = new Hashtable(); // The first thing going in is a list of formats. We could look for // more than one at a time, but it's much slower. Vector formats = new Vector(); formats.addElement(BarcodeFormat.QR_CODE); hints.put(DecodeHintType.POSSIBLE_FORMATS, formats); // We will also use the "TRY_HARDER" flag to make sure we get an // accurate scan hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE); // We create a new decoder using those hints BarcodeDecoder decoder = new BarcodeDecoder(hints); // Finally we can create the actual scanner with a decoder and a // listener that will handle the data stored in the barcode. We put // that in our view screen to handle the display. try { _scanner = new BarcodeScanner(decoder, new MyBarcodeDecoderListener()); _barcodeScreen = new MyBarcodeScannerViewScreen(_scanner); } catch (Exception e) { log("Could not initialize barcode scanner: " + e); return; } } // If we get here, all the barcode scanning infrastructure should be set // up, so all we have to do is start the scan and display the viewfinder try { _scanner.startScan(); _app.pushScreen(_barcodeScreen); } catch (Exception e) { log("Could not start scan: " + e); } } /*** * MyBarcodeDecoderListener *

    * This BarcodeDecoverListener implementation tries to open any data encoded * in a barcode in the browser. * * @author PBernhardt * **/ private class MyBarcodeDecoderListener implements BarcodeDecoderListener { public void barcodeDecoded(final String rawText) { // First pop the viewfinder screen off of the stack so we can see // the main app _app.invokeLater(new Runnable() { public void run() { _app.popScreen(_barcodeScreen); } }); // We will use a StringBuffer to create our message as every String // concatenation creates a new Object final StringBuffer message = new StringBuffer("Would you like to open the browser pointing to \""); message.append(rawText); message.append("\"?"); log(message.toString()); _barcodeScreen.invalidate(); // Prompt the user to open the browser pointing at the URL we // scanned _app.invokeLater(new Runnable() { public void run() { if (Dialog.ask(Dialog.D_YES_NO, message.toString()) == Dialog.YES) { // Get the default sessionBrowserSession BrowserSession browserSession = Browser.getDefaultSession(); // Launch the URL browserSession.displayPage(rawText); } } }); } } /*** * MyBarcodeScannerViewScreen *

    * This view screen is simply an extension of MainScreen that will hold our * scanner's viewfinder, and handle cleanly stopping the scan if the user * decides they want to abort via the back button. * * @author PBernhardt * */ private class MyBarcodeScannerViewScreen extends MainScreen { public MyBarcodeScannerViewScreen(BarcodeScanner scanner) { super(); try { // Get the viewfinder and add it to the screen _scanner.getVideoControl().setDisplayFullScreen(true); Field viewFinder = _scanner.getViewfinder(); this.add(viewFinder); // Create and add our key listener to the screen this.addKeyListener(new MyKeyListener()); } catch (Exception e) { log("Error creating view screen: " + e); } } /*** * MyKeyListener *

    * This KeyListener will stop the current scan cleanly when the back * button is pressed, and then pop the viewfinder off the stack. * * @author PBernhardt * */ private class MyKeyListener implements KeyListener { public boolean keyDown(int keycode, int time) { // First convert the keycode into an actual key event, taking // modifiers into account int key = Keypad.key(keycode); // From there we can compare against the escape key constant. If // we get it, we stop the scan and pop this screen off the stack if (key == Keypad.KEY_ESCAPE) { try { _scanner.stopScan(); } catch (Exception e) { log("Error stopping scan: " + e); } _app.invokeLater(new Runnable() { public void run() { _app.popScreen(_barcodeScreen); } }); return true; } // Otherwise, we'll return false so as not to consume the // keyDown event return false; } // We will only act on the keyDown event public boolean keyChar(char key, int status, int time) { return false; } public boolean keyRepeat(int keycode, int time) { return false; } public boolean keyStatus(int keycode, int time) { return false; } public boolean keyUp(int keycode, int time) { return false; } } } /*** * log *

    * Writes a message to an edit field for debug purposes. Also sends to * STDOUT. *

    * * @param msg * - The String to log */ public void log(final String msg) { invokeLater(new Runnable() { public void run() { _logField.setText(_logField.getText() + "\n" + msg); System.out.println(msg); } }); } }

    My request is properly signed and work very well in the Simulator.

    Thanks in advance.

    Solved.  http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800901/Support_-_Sign...

  • Try to re-signing and mount a data store

    Hi all

    I'm stuck trying to develop a "workflow" and hoping you can help. We need to make a daily DR copy of a production database and edit this copy on another virtual machine. The database feeds a hard with his own logic unit number and is heavily used, so we can suspend only wrote a few minutes.


    Here are the high-level workflow:

    1. Suspend the entries in the database
    2. Create a virtual copy (snapshot) of the LUN on our 3PAR
    3. Resume database entries
    4. Export (present) the virtual copy of the 3PAR to the ESXi cluster
    5. A rescan storage on all hosts in the cluster
    6. Add the LUN and re-signature of the data store
    7. Mount the VMDK from the new LUN to the VM test

    I fight a bit to make the portion of ESXi work. I can re-scan storage successfully on my host, but I'm not able to go up and re-signing of the data store newly discovered. Onyx told me to use resignatureUnresolvedVmfsVolume_Task , but the action failed with "TypeError: cannot find the resignatureUnresolvedVmfsVolume_Task function in the object (Instance) DynamicWrapper: [VcHostSystem]-[class com.vmware.vmo.plugin.vi4.model.VimHostSystem]" I run 5.5.2 vRO/vCO and don't have the library installed vi4 nor do I have all the actions that will be re-signing a volume.

    So I wonder, ResignatureUnresolvedVmfsVolume_Task has been deprecated and replaced by something else? Or did someone knows a library/plugin that I can add to vRO who will give me the opportunity to re-signing a data store?

    Thanks in advance for any help.

    See you soon!

    Hello

    The error message, it seems you are trying to call the method resignatureUnresolvedVmfsVolume_Task() on the object of type VcHostSystem. something like that

    var task = hostSystem.resignatureUnresolvedVmfsVolume_Task(spec);
    

    The problem is that resignatureUnresolvedVmfsVolume_Task() is not a method of type VcHostSystem, but in VcHostDatastoreSystemcharacters, therefore, you get this error.

    To fix it, you must obtain an object of type VcHostDatastoreSystem. Research in the API Explorer, you should be able to get VcHostDatastoreSystem object VcHostSystem object through the configManager property (which returns an object of type VcHostConfigManager), then property of datastoreSystem . Something like the following code:

    var task = hostSystem.configManager.datastoreSystem.resignatureUnresolvedVmfsVolume_Task(spec);
    

    I don't have a good environment to test, but it should work.

    I hope this helps.

Maybe you are looking for