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.

Tags: BlackBerry Developers

Similar Questions

  • Need to rename a data store.

    Dear team,

    I have a SAN Lun mapped to one of the esx host, sure I created a data store, now we are planing to make a naming convention appropriate to a data store g exisitn, I need to rename a data store. is it possible to rename a data store where the VM production? It will affect running virtual machines that are stored on this data store. ????

    concerning

    Mr. VMware

    You can rename no problem with no impact to your infrastructure.  It is simply an object name in vCenter

  • 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

  • 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}}

  • 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.

  • Shrink a VM HD - is the destination data store need to have enough space for the source or destination VM?

    Hi all

    I have an existing file with HD Server configures:

    HD1: 60 GB

    HD2: 20 GB

    HD3: 650 GB

    Total: 730 GB

    I intend to shrink HD3 250 GB that will give me a new total of 330 GB.

    My question is, when I rode the VMware Converter Standalone process and I get to the step where I select the 'destination '.  Obviously, I need to select a data store that can adapt to the virtual destination machine.

    My concern is that it shows the size of the source disk (Go 730) (see image below), and for some reason any part of the conversion process the destination data store requires the storage of the size of 330 GB vm 730GB as opposed to the 'new '.

    source disk size.PNG

    Can anyone confirm?

    Thank you

    There are no for the data store 730 GB free in order to submit the conversion. 330 GB free (size after reduction) would be sufficient.

    If you also select a provisioning, you could even start the conversion with less free space on the data store, but it may fail at some point, if the actual data meet.

  • 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

  • Cancel an increase in data store on removable hard drive

    Hello, I was just wondering, but I was messing around trying to find the way on an empty stomach for manually copying the VM to a RDX removable hard drive and decided to try to increase the size of the data with the RDX hard disk store.  I was wondering if there is a way to cancel this increase in size of the data store.  When I remove the RDX drive, it gives me an error saying no data store has been created but still work in the VM.  Any help would be appreciated.

    Welcome to the community,

    I understand thi correctly. You have added the RDX as a measure for the data store local drive!

    There is no way to remove a measure. You will need to evacuate the data store (i.e. save virtual machines), remove the extended data store and create a new.

    André

    BTW: With product (edition/version/version) are you using?

  • Find Select or search the allocated space of vCAC Database data store

    Hello

    I need to declare the data store space allocated by the store of data and market.

    In the attachment is the vCAC display where values are visible.

    Homepage > Infrastructure > reservations > Reservations

    Does anyone know where to find in the database?

    SELECT DISTINCT D.Name, SUM(E.MaxCapacity) AS Reserviert, SUM(B.StorageAllocated) AS Verwendet
    FROM [vCAC].[dbo].[HostReservation] A, [vCAC].[dbo].[HostReservationToStorageStats] B, [vCAC].[dbo].[HostToStorage] C, [vCAC].[dbo].[HostStorageReservationPolicy] D,[vCAC].[dbo].[HostReservationToStorage] E
    WHERE A.HostReservationName = 'RES-Default' AND A.HostReservationID = B.HostReservationID AND A.HostReservationID = E.HostReservationID AND B.HostToStorageID = C.HostToStorageID AND C.HostStorageReservationPolicyID = D.HostStorageReservationPolicyID AND C.HostToStorageID = E.HostToStorageID AND D.Name = 'Gold'
    GROUP BY D.Name;
    
  • VMware ESXi 5.1.0 VMFS5 maximum data store size

    Hi all

    I read white papers on VMFS and I get conflicting answers on the maximum size of a VMFS5 data store.

    We are using a Dell EqualLogic PS6100 and linking the LUNS via iSCSI for host servers.

    I need to create a data store TB 4 for my file server reside on.

    (A) is it possible?

    (B) are there performance problems with the largest data warehouses such as I want to do.

    Block sizes C) must be modified to mount a data store of this size and how you do it.

    Any idea or article links would be greatly appreciated.

    Keith

    (A) Oui it is possible but you will need to use a RDM - ESXi 5 allows access to 64 TB but the size of the virtual disk is always capped at 2 TB - 512b

    (B) you must not

    (C) with ESXi 5 block size is no longer a variable that you define for a VMFS data store

  • Remove a data store

    I need to remove a data store so that I can reformat vmfs3 to vmfs5. It is my understanding that vcenter will not introduce any APD or correct payday loans? The LUN will remain visible to all guests, as I said I just need to remove the data store on this subject, so I can recreate it with vmfs5.

    I guess after I remove it, I should questions some hosts renumerisations (except done automatically vcenter) before I recreate?

    Thank you.

    You are right, since you don't anyone the LUN, there is no problem with ODA...

    Simply remove the data store and create a new one. After that you can rescan all hosts so that they detect the new format.

    André

  • Best practices for a NFS data store

    I need to create a data store on a NAS and connect to some servers ESXi 5.0 as a NFS datastore.

    It will be used to host virtual machines less used.

    What are the best practices to create and connect a datastore NFS or networking and storage view bridges in order to get the best possible performance and decrease is not the overall performance of the network?

    Concerning

    Marius

    Create a new subnet of layer 2 for your NFS data warehouses and set it up on his own vSwitch with two uplinks in an active configuration / eve of reunification. Uplink should be variously patches in two distinct physical switches and the subnet must have the disabled bridge so that NFS traffic is not routable in other parts of your network. NFS export can be restricted to the IP address of storage host IP (address of the VM kernel port you created for NFS in the first step), or any address on that subnet. This configuration isolates traffic NFS for performance, ensures the security and redundancy. You should also consult your whitepapers of storage vendors for any specific recommendation of the seller.

    Data warehouses can be made available for the guests you wish and you can use Iometer to compare PAHO are / s and flow rate to see if it meets your expectations and requirements.

  • ESXi 4.1 VSphere and size of the file on the data store

    Hello

    I'm new to VMWare and have been reading on maximum configuration for virtual machines and

    Warehouses of data in this forum.

    If I have a computer virtual (Server Win2K8 R2) that in the future may reach 2 TB is true while

    I need to create a data store on the SAN network with a block size of 8 MB, so it can accommodate

    the increase in the size of the virtual machine?

    What is a correlation one between the size of the VM and the VM file size?

    Example: If the Win2K8 server reaches 1 TB, the size of the VM file also to 1 TB?

    And finally, if the maximum of 2 TB is reached on the Win2K8 server how to add

    more space for my VM?

    Thank you

    VM3434

    If I have a computer virtual (Server Win2K8 R2) that in the future may reach 2 TB is true while

    I need to create a data store on the SAN network with a block size of 8 MB, so it can accommodate

    the increase in the size of the virtual machine?

    Fix

    What is a correlation one between the size of the VM and the VM file size?

    Example: If the Win2K8 server reaches 1 TB, the size of the VM file also to 1 TB?

    There are two types of vmdk (the VM disk):

    • thickness: file is allocated in advance... so in your case, the file is already a file of 2 TB
    • thin: file is dynamic and reach the size max

    See also: http://communities.vmware.com/docs/DOC-10854

    And finally, if the maximum of 2 TB is reached on the Win2K8 server how to add

    more space for my VM?

    You can't... 2 TB is the max disk size.

    You can add more drives.

    André

  • How to associate the data store of the target for the newly created using the API Interface

    How to create a new Interface under project, need to associate the data store target for mappings for the interface by using APIs "."

    Able to get the associated interface created temporary data store. You need to associate a new database model. How to do this using the API

    My code is,

    String pCode = "DEVELOPMENT";
    Context OdiContext = (mgr.getFinder (OdiContext.class)) .findByCode (pCode) (IOdiContextFinder);
    System.out.println (Context.getLastDate ());

    OdiInterface pInterface = new OdiInterface ("toDeleted_Interface", pFolder, context);
    pFolder.addInterface (pInterface);

    The list of ds < DataSet > = pInterface.getDataSets ();
    < DataSet > iterator itr = ds.iterator ();
    DataSet ds_nxt = itr.next ();

    PAlias string = "HRA_TMPL_DEFNS_TL";
    pOrder int = 0;
    OdiModel pModel = (mgr.getFinder (OdiModel.class)) .findByCode ("FILE_PM_MODEL") (IOdiModelFinder);
    String pName = "HRA_TMPL_DEFNS_TL";
    OdiDataStore pUnderlyingOdiDataStore = new OdiDataStore (pModel, pName);
    SourceDataStore pSourceDataStore = new SourceDataStore (ds_nxt, false, pAlias, pOrder, pUnderlyingOdiDataStore);
    ds_nxt.addSourceDataStore (pSourceDataStore);

    TargetDataStore tdata = pInterface.getTargetDataStore ();

    If (tdata.isTemporaryDataStore ())
    {
    }

    http://odiexperts.com/creating-interface-for-single-source-and-target/
    http://odiexperts.com/creating-temporary-interface-using-ODI-SDK/

  • File is greater than the maximum size supported by the data store "Datastore1".

    Okay, I'm trying to create a virtual machine from 350 GB.  I need to run a database of 283 GB to test / Proof of concept that will grow more than 325 GB. I get this error message

    -


    Error

    -


    File is larger than the maximum size supported by datastore 'Datastore '.  vm name.domain.com/server name.domain.com.vmdk

    -


    Ok

    -


    I have read that I need to increase the size of the block, but I need to remove the data store. Is it the same on ESXi 4.0?  I have 4 other VM about 150 GB. Please tell me I'm wrong.  Please...

    Same rules apply.  Create an another LUN with the correct block size and away files or hang the lun and recreate

    Steve Beaver

    VMware communities user moderator

    VMware vExpert 2009

    ====

    Co-author of "VMware ESX Essentials in the data center" virtual

    (ISBN:1420070274) Auerbach

    Come and see my blog: www.theVirtualBlackHole.com

    Come follow me on twitter http://www.twitter.com/sbeaver

    *Virtualization is a journey, not a project. *

Maybe you are looking for