NullPointerException on PersistentObject problem

* Update * I can solve the problem now! I did not know that I have to put a comment with the string KEY in the code... how silly I am (> / / /)<>

Hello!

I'm developing an application with EditField. I need the EditField to store it that the user entered, so I tried to write the code (using the example found on the Internet)...

private static PersistentObject myobject;
    static
    {
        //*****I have no idea what 0xe63e08aacd575338L is, just copy it from the Internet...
        myobject = PersistentStore.getPersistentObject(0xe63e08aacd575338L);
    }
String[]storedV = (String[])myobject.getContents();
if (storedV != null)
        {
            f1Field.setText(storedV[0]);
            f2Field.setText(storedV[1]);
        }

        f1Field = new EditField("Username:","");
        add(f1Field);
        f2Field = new PasswordEditField("Password:","");
        add(f2Field);
String unameToSave = f1Field.getText();
            String pwdToSave = f2Field.getText();
            String[] storeV = {unameToSave,pwdToSave};
            synchronized(myobject)
            {
                myobject.setContents(storeV);
                myobject.commit();
            }

With this code, everything went well when I run for the first time (if there is no value stored in PersistentStore).

When I run for the second time, I got "Eception Exception: NullPointerException ' on the line

 f1Field.setText(storedV[0]);

Please help me!

Thanks in advance for any answer!

PS. I use this Simulator 8520...

0xe63e08aacd575338L is, just copy it from the Internet...

Do not copy a key key somene else... or you will eventually damage the memory of each and other.  Use a unique key, pass around some of these figures in something different

Regarding the nullpointer, try to add a control to ensure that the field is not null

Tags: BlackBerry Developers

Similar Questions

  • Using wizard to create forms of master / detail

    Hi guys,.

    I'm using JHeadstart 11.1.1.3.35 and having major problems trying to create records of master / details in a layout of the wizard

    Department Master (shape, style Assistant, insert enabled, new line on entry)
    Group of retail employees (form, data dependant, allowed insert, update has allowed)

    Using schema HR with a view link between services and employees

    Main group Department (Assistant)
    = > Region of the element (all the fields of the Department)
    = > Region container
    = > Region group (Group of retail employees)

    (NB - if I used a group of the region as step in the wizard at a higher level, the following error occurred during the generation which is why I wrapped it in a container of the region...

    [NewDepartmentNewEmp.jsff, default/pageComponent/formRegionGroup.vm] Journal of speed [error] method pushModelPointer threw the exception of reference $JHS for model default/pageComponent/formRegionGroup.vm at [1,1]
    [NewDepartmentNewEmp.jsff, default/pageComponent/formRegionGroup.vm] org.apache.velocity.exception.MethodInvocationException: Invocation of method 'pushModelPointer' in class oracle.jheadstart.dt.jag.engine.velocity.JagEngineFacade threw exception class java.lang.NullPointerException: null

    The problem is that the detail of employee group does not start in design mode.

    I tried the create() method substitution in DepartmentsImpl

    protected void create (AttributeList attributeList) {}
    Super.Create (AttributeList);

    NewEmployee RowIterator = this.getEmployees ();
    NewRow row = newEmployee.createRow ();
    newEmployee.insertRow (newRow);
    }

    I also tried the override of the executeQueryForCollection method in detail (saw this solution suggested in another post on creating a form-form master / detail)

    protected void executeQueryForCollection (Object, object,
    Object [] bindParams,
    int i) {}
    super.executeQueryForCollection (object, bindParams, i);
    If (getEstimatedRowCount() == 0) {}
    Line = createRow().
    insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);
    }
    }

    Nothing works well. I want to be able to use a wizard to create a record of master / detail in presentation view shape-to-shape. Is it possible, using a detail group, or do I have to create a separate view object that contains two master entity objects / detail in it and then just use the only VO in the Group Assistant of JHeadstart.

    This seems a very basic requirement, I clearly do something wrong!

    See you soon,.
    Brent

    Brent,

    To start in design mode, you must create the Group NewDeptEMp as a top-level group, so he will have his own taskflow. You can then define the new display line on the input property.

    In your wizard NewDept, you create a group of the region DIRECTLY under the container of the separatePages region, check "Include as ADFc region" then select the NewDeptEMp group.

    To work around the error that you got during the generation of the group in the region as an immediate child of the container sepeartePages, use the following code to formGroupRegion.vm:

    # revision_history
    # Steven Davelaar 28-sep-2011
    Additional support # 1.2 for the group in the region as child of separatePages region container
    Team JHeadstart # 30-sep-2006
    Historical revisions # 1.1 added, the basic version is 10.1.3.0.97 (SU1)

    #if ($JHS.page.itemRegion)
    #JHS_PARSE ($JHS.page.itemRegion.templateIdentifier $JHS.page.itemRegion)
    #elseif ($JHS.page.regionContainer)
    #JHS_PARSE ($JHS.page.regionContainer.templateIdentifier $JHS.page.regionContainer)
    #elseif ($JHS.page.groupRegion)
    #JHS_PARSE ($JHS.page.groupRegion.templateIdentifier $JHS.page.groupRegion)
    #end

    Steven Davelaar,
    Jheadstart team.

  • Problem with PersistentObject.

    Hi all

    I am new to the BB and bad English (I'm Thai), sorry if you confuse in my words. I have a project that has thead to download the server image and record in PersistentObject using my CustomHashTable. The problem is that I have an error message "NonPersistableObjectException", which is based on the method "persistentObject.commit ();" in "getEncodedImage()" when I debug, here is my code.

    public class TestApp extends UiApplication{
    
        public static void main(String[] args) {      UiApplication app = new TestApp();        app.enterEventDispatcher();   }
    
      TestApp(){        pushScreen(new TestScreen()); }}
    
    public class TestScreen extends MainScreen{
    
       EncodedImage encodedImage;    CustomHashTable persistentHashtable;  private DataInputStream dis;  private byte[] encodeData;    private ByteArrayOutputStream byteStream; PersistentObject persistentObject = PersistentStore.getPersistentObject(0x61a0ab9f850b5c9bL);
    
      TestScreen(){     super();      if (persistentObject.getContents() == null) {         persistentHashtable = new CustomHashTable();          persistentObject.setContents(persistentHashtable);            persistentObject.commit();        }else {           persistentHashtable = (CustomHashTable)persistentObject.getContents();        }     encodedImage = getEncodedImage("http://download.magikmobile.mobi/scodp/mpreview.do?idc=683979&size=140x90&","4952","hot");       encodedImage = scaleImage(encodedImage);
    
          this.setTitle("Test my app");     this.add(new BitmapField(encodedImage.getBitmap()));  }
    
      public EncodedImage scaleImage(EncodedImage image) {      int displayWidth = Fixed32.toFP(Display.getWidth());      int imageWidth = Fixed32.toFP(image.getWidth());      int scalingFactor = Fixed32.div(imageWidth, displayWidth);        EncodedImage scaledImage = image.scaleImage32(scalingFactor, scalingFactor);      return scaledImage;   }
    
      public EncodedImage getEncodedImage(String url, String id, String catagory) {
    
           EncodedImage enc = null;      if (persistentHashtable.containsKey("EncodeImage01")) {           enc = (EncodedImage)persistentHashtable.get("EncodeImage01");     }
    
            if (enc != null) {          System.out.println(">>>>>  image not null");            return enc;        } else {            System.out.println(">>>>>  image null");            try {                String newURL = null;                while (url.indexOf("&") > 0) {                    newURL = url.substring(0, url.indexOf("amp;"));                    url = url.substring(url.indexOf("amp;") + 4);                    url = newURL + url;                }
    
                    newURL = null;                String suffix = "";                HttpConnection httpConnection = (HttpConnection) Connector.open(url+suffix);                httpConnection.setRequestMethod(HttpConnection.GET);                if (httpConnection.getResponseCode() == 302) {                   boolean b = true;                    while (b) {                        if (httpConnection.getResponseCode() == 200) {                            b = false;                            break;                        }                        httpConnection = (HttpConnection) Connector.open(httpConnection.getHeaderField("Location"));                    }                }                dis = httpConnection.openDataInputStream();                int length = (int) httpConnection.getLength();                if (length > 0) {                    encodeData = new byte[length];                    dis.readFully(encodeData);                } else {                    byteStream = new ByteArrayOutputStream();                    int ch;                    while ((ch = dis.read()) != -1) {                        byteStream.write(ch);                    }                    encodeData = byteStream.toByteArray();                    byteStream.close();                    byteStream = null;                }                dis.close();                dis = null;                httpConnection.close();                httpConnection = null;                try {                    enc = EncodedImage.createEncodedImage(encodeData, 0, encodeData.length);                } catch (OutOfMemoryError e) {                  System.out.println(">>>>  OutOfMemoryError");                    e.printStackTrace();                    return null;                } catch (NullPointerException e) {                 System.out.println(">>>>  NullPointerException");                    e.printStackTrace();                    return null;                } catch (IllegalArgumentException e) {                 System.out.println(">>>>>  IllegalArgumentException");                    e.printStackTrace();                    return null;                } catch (ArithmeticException e) {                  System.out.println(">>>>  ArithmeticException");                    e.printStackTrace();                    return null;                }                encodeData = null;                persistentHashtable.put("EncodeImage01", enc);                persistentObject.commit();                catagory = null;                id = null;                url = null;                return enc;            } catch (SecurityException ex) {                ex.printStackTrace();                return null;            } catch (IOException ex) {                ex.printStackTrace();                return null;            }        }    }
    
    }
    
    public class CustomHashTable extends Hashtable implements Persistable{
    
    }
    

    What should I do?

    Thank you very much

    ~ MazMellow ~.

    I see no problem here, hashtable will have any object as second parameter to the function, so you can put hashtable in storage of place (it is supported and commonly used):

    Hash hash = new Hashtable();

    data Byte [] = image.getData ();

    Hash.put ("first", data);

    ....

    ...

    ...

    ....

    data Byte [] (byte []) = hash.get ("first");

    image = EncodedImage.createEncodedImage (data,...);

  • Problem with a Bitmap image in a ButtonField (get a 104 NullPointerException error)

    Hi, I'm a beginner in programming BlackBerry Apps, well...

    I tried to create a simple ButtonField customized with a bitmap inside, but I constantly get an error 104 eception: NullPointerException, here is my code to field custom buttond.

    import net.rim.device.api.ui.component.ButtonField;import net.rim.device.api.ui.Graphics;import net.rim.device.api.system.Bitmap;
    
    public class CustomButtonField extends ButtonField{  
    
      private Bitmap imagen;
    
      CustomButtonField(Bitmap imagen, long style){
    
          super(style);     this.imagen = imagen;                     }
    
      public int getPreferredWidth(){
    
                    return 60;        }
    
      public int getPreferredHeight(){
    
          return 60;        }
    
     protected void paint(Graphics graphics) {
    
          graphics.drawBitmap(0, 0, imagen.getWidth(), imagen.getHeight(), imagen, 0, 0);   }
    
       protected void layout(int width, int height) {
    
          setExtent(getPreferredWidth(), getPreferredHeight());
    
        }  }
    
    import net.rim.device.api.ui.container.MainScreen;import net.rim.device.api.system.Bitmap;
    
    public class PruebaScreen extends MainScreen{    
    
      private CustomButtonField boton;
    
      PruebaScreen(){
    
          Bitmap imagen = Bitmap.getBitmapResource("res/img/icon.png");     boton = new CustomButtonField(imagen, 0);     add(boton);
    
      }}
    

    I suspect that my problem is due to the method of painting or the page layout, I don't know... I hope someone can help me, thank you very much in advance.

    Check if your getBitmapResource returns any non-null Bitmap image.  Specify the path correctly may take a few tries ("' / res/img/icon.png '," img/icon.png", etc.")

  • PersistentObject and problem SendListener

    I recorded a SendListener in order to intercept outgoing e-mail. When my manager is called I want to access my application stored in PersistentObject settings to determine what I should do in my manager of sendMessage.

    The problem is that I can't access any information contained in my application. I suspect that it is because my manager sendMessage runs in the context of the mail application.

    Should which design I follow to access my store persistent since a manager like this?

    Thank you

    John.

    I must admit, I have not really tested recently myself, but as far as I know, you should be able to access your persistent objects - assuming that you are running by using your own code and persistent objects classes, the framework should not matter.

    Can you describe the problem when you try to access the information?  If your objects seem to be "null" then I guess you use static references.  static variables are specific to a context, then your listener will see different static variables for your application.

    The reason why I've not tested this recently is that the normal practice for Auditors is change in context of your Application, and the usual approach is via a GlobalEvent

    http://supportforums.BlackBerry.com/T5/Java-development/global-events-and-global-event-listeners/TA-...

  • Breaking problem: AIX: NullPointerException

    Hello

    I'm stuck with BI publisher, and I found no solution.

    We run OBIEE on AIX, and I tried on a simple query of bursting.

    The dataset:
    SELECT id, company name

    The application of rupture:
    Select
    d.ID KEY,
    "New model 1' MODEL,
    TEMPLATE_FORMAT "RTF"
    'en-US' LOCAL,
    OUTPUT_FORMAT "PDF."
    DEL_CHANNEL "FILE"
    ' / oraclebitest, oraclebi, xmlp, XMLP ""Parameter1".
    d.ID | parameter 2 '.pdf '.
    Of
    Company d

    Divide by:
    * / LINES/LINES/ID *.

    I ran the shine, and it failed with each row (the company).

    The error log is that (like, I changed the key in the bursting, select name ID, but it has not yet):

    [103009_033940669] [] [STATEMENT] Logger.init (): * DEBUG MODE IS ENABLED. ***
    [103009_033940670] [] [STATEMENT] Logger.init (): LogDir = / tmp
    [103009_033940754] [] [STATEMENT] model of analysis has begun...
    [103009_033940792] Model of data [] [STATEMENT]...
    [103009_033940793] [] [STATEMENT] oracle.xml.parser.v2.XMLDocument@10bd10bd
    [103009_033940799] [] [STATEMENT] within the parameterParser...
    [103009_033940799] [] [STATEMENT] within the dataQueryParser...
    [103009_033940813] [] [STATEMENT] model is complete analysis...
    [103009_033940815] [] [STATEMENT] include_parameters = false
    [103009_033940816] [] [STATEMENT] Start process Data
    [103009_033940817] [] [STATEMENT] process data...
    [103009_033940817] [] [STATEMENT] write data...
    [103009_033940819] [] [STATEMENT] Sql Query: select nev bi_kir_ceg
    [103009_033941075] [] [EVENT] data creation is complete...
    [103009_033941076] [] [EVENT] Total data generation time 0.0 seconds
    [103009_033941697] Oracle XML Parser [] [STATEMENT] version: Oracle XML Developers Kit 10.1.3.130 - Production
    [103009_033941732] [] [STATEMENT] Logger.init (): * DEBUG MODE IS ENABLED. ***
    [103009_033941732] [] [STATEMENT] Logger.init (): LogDir = / tmp
    [103009_033941820] [] [STATEMENT] model of analysis has begun...
    [103009_033942043] Model of data [] [STATEMENT]...
    [103009_033942043] [] [STATEMENT] oracle.xml.parser.v2.XMLDocument@589b589b
    [103009_033942044] [] [STATEMENT] within the parameterParser...
    [103009_033942045] [] [STATEMENT] within the dataQueryParser...
    [103009_033942045] [] [STATEMENT] model is complete analysis...
    [103009_033942046] [] [STATEMENT] include_parameters = false
    [103009_033942047] [] [STATEMENT] Start process Data
    [103009_033942047] [] [STATEMENT] process data...
    [103009_033942047] [] [STATEMENT] write data...
    [103009_033942048] [] [STATEMENT] Sql Query: select
    d.Nev KEY,
    "New model 1' MODEL,
    TEMPLATE_FORMAT "RTF"
    "hu - HU" LOCAL,.
    OUTPUT_FORMAT "PDF."
    DEL_CHANNEL "FILE"
    ' / oraclebitest, oraclebi, xmlp, XMLP ""Parameter1".
    d.Nev | parameter 2 '.pdf '.
    Of
    bi_kir_ceg d
    [103009_033942813] [] [EVENT] data creation is complete...
    [103009_033942813] [] [EVENT] Total data generation time 1.0 seconds
    [103009_033942836] /Configuration/xdo.cfg [of] [STATEMENT] not found.
    [103009_033946086] [oracle.apps.xdo.servlet.scheduler.XDOJob] [STATEMENT] [ID:8] Tmp dir of bursting: / oraclebitest/oraclebi/oc4j_bi/j2ee/home/applications/xmlpserver/xmlpserver/OPE/tmp /.
    [103009_033946087] [oracle.apps.xdo.servlet.scheduler.XDOJob] [STATEMENT] [ID:8] [break-up node] = [LINES/LINES/NEV], [node delivery] = [LINES/LINES/NEV]
    [103009_033946746] [oracle.apps.xdo.servlet.scheduler.XDOJob] [STATEMENT] [ID:8] implementation model: [name] = [new model], [rtf], [location]=[oraclebitest/oraclebi/oc4j_bi/j2ee/home/applications/xmlpserver/xmlpserver/xdo/cache/xmlp83650993.tmp]
    [103009_033946751] [] [STATEMENT] / oraclebitest/oraclebi/oc4j_bi/j2ee/home/applications/xmlpserver/xmlpserver/xdo/tmp /.
    [103009_033946792] [] [STATEMENT] key BurstingProcessor:Property = > xslt._XDOTIMEZONE: value = > Africa/Algiers"."
    [103009_033946793] [] [STATEMENT] key BurstingProcessor:Property = > xdk - io-secure mode: value = > true
    [103009_033946793] [] [STATEMENT] key BurstingProcessor:Property = > xslt._XDOCALENDAR: value = > 'GREGORIAN '.
    [103009_033946794] [] [STATEMENT] key BurstingProcessor:Property = > xslt._XDOLOCALE: value = > "hu_HU."
    [103009_033946831] [oracle.apps.xdo.batch.BurstingProcessorEngine] [STATEMENT] = > startElement(): startDocument entered < =.
    [103009_033946835] [] [EXCEPTION] java.lang.NullPointerException
    at oracle.apps.xdo.batch.bursting.ProcessEnterpriseDocument.processLayout (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.addDocument2Queue (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.createBurstingDocument (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.globalDataEndElement (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement (unknown Source)
    at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:210)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1318)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:263)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.process (unknown Source)
    at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.java:1994)
    at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:358)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
    to org.quartz.simpl.SimpleThreadPool$ WorkerThread.run (SimpleThreadPool.java:520)

    ..........

    [103009_034051143] [] [EXCEPTION] java.lang.NullPointerException
    at oracle.apps.xdo.batch.bursting.ProcessEnterpriseDocument.processLayout (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.addDocument2Queue (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.createBurstingDocument (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.globalDataEndElement (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.endElement (unknown Source)
    at oracle.xml.parser.v2.XMLContentHandler.endElement(XMLContentHandler.java:210)
    at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1318)
    at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
    at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
    at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:263)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest (unknown Source)
    at oracle.apps.xdo.batch.BurstingProcessorEngine.process (unknown Source)
    at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.java:1994)
    at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:358)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
    to org.quartz.simpl.SimpleThreadPool$ WorkerThread.run (SimpleThreadPool.java:520)

    [103009_034051624] [oracle.apps.xdo.batch.BurstingProcessorEngine] [STATEMENT] = > startElement(): endDocument entered < =.
    [103009_034051895] [] [STATEMENT] writing connection pool max: 10, min:5, total: 5, available: 5
    [103009_034053802] [] [STATEMENT] ToplinkDataHandler.terminateSession (): release the session.
    [103009_034058513] [] [STATEMENT] / oraclebitest/oraclebi/oc4j_bi/j2ee/home/applications/xmlpserver/xmlpserver/xdo/tmp / / 103009_033946756 deleted successfully...
    [103009_034058522] [] [STATEMENT] [ID:8] elapsed time of bursting: 87868, start time: 88542
    [103009_034058522] [] [STATEMENT] [ID:8] elapsed time of notification: 0, start time: 88542
    [103009_034058523] [oracle.apps.xdo.servlet.scheduler.XDOJob] [STATEMENT] [ID:8] programmer finished work. Output of...
    [103009_034130015] [] [STATEMENT] ToplinkDataHandler.getOutput (): called
    [103009_034130016] [] [STATEMENT] reading connection pool max: 20, min:5, total: 5, available: 5
    [103009_034130017] [] [STATEMENT] reading connection pool max: 20, min:5, total: 5, available: 5
    [103009_034130017] [] [STATEMENT] ToplinkDataHandler.queryOutput (): call to executeQuery().
    [103009_034130055] [] [STATEMENT] ToplinkDataHandler.queryOutput (): finish the executeQuery() call.
    [103009_034130366] [] [STATEMENT] ToplinkDataHandler.terminateSession (): release the session.
    [103009_034135802] [] [STATEMENT] ToplinkDataHandler.getOutput (): called
    [103009_034135803] [] [STATEMENT] ToplinkDataHandler.getOutput (): getting the client session.
    [103009_034135803] [] [STATEMENT] reading connection pool max: 20, min:5, total: 5, available: 5
    [103009_034135804] [] [STATEMENT] reading connection pool max: 20, min:5, total: 5, available: 5
    [103009_034135804] [] [STATEMENT] ToplinkDataHandler.queryOutput (): call to executeQuery().
    [103009_034135836] [] [STATEMENT] ToplinkDataHandler.queryOutput (): finish the executeQuery() call.
    [103009_034135867] [] [STATEMENT] ToplinkDataHandler.terminateSession (): release the session.
    [103009_034135867] [] [STATEMENT] ToplinkDataHandler.getJobs (): called.
    [103009_034135867] [] [STATEMENT] ToplinkDataHandler.getJobs (): getting the client session.
    [103009_034135868] [] [STATEMENT] reading connection pool max: 20, min:5, total: 5, available: 5
    [103009_034135868] [] [STATEMENT] reading connection pool max: 20, min:5, total: 5, available: 5
    [103009_034135868] [] [STATEMENT] ToplinkDataHandler.queryJobs (): call to executeQuery().
    [103009_034135911] [] [STATEMENT] ToplinkDataHandler.queryJobs (): finish the executeQuery() call.
    [103009_034135912] [] [STATEMENT] ToplinkDataHandler.terminateSession (): release the session.
    [103009_034332894] [] [STATEMENT] Servlet OPE full stop.

    -----
    Thank you very much
    Andras

    I don't think the explosion engine can find the format model. Check the regional settings on your model of format and locale for breaking settings see if they match.

    103009_033946835] [EXCEPTION java.lang.NullPointerException
    at oracle.apps.xdo.batch.bursting.ProcessEnterpriseDocument.processLayout (unknown Source)

    IKE Wiggins
    http://bipublisher.blogspot.com

  • Problem with the PersistentObject

    I use a persistent object. When I uninstall the application of option then still persistent object remain.

    Because when I installed this app still once he not not opening.

    Is there a way to remove the persistent all when object application uninstalling.

    If you implement persistable in a custom class, it will be deleted automatically.

  • _ERR_COMMAND_EXCEPTION CMN3101E user, the system is unavailable due to "java.lang.NullPointerException".

    I just had some problem to be able to print a PDF file that has sent me a reliable source of the school. He could not open with precision and would not print. I was told a few undesirable and the part of it said:

    User CMN3101E the system is unavailable due to "java.lang.NullPointerException".

    I then Googled that and found the I needed to have the video drivers Intel and not the versions of MS due to some problems. I went through all this mess by using Device Manager and switched 2 pieces of diff for Intel drivers Intel and not versions of MS. I also did an UPDATE MS after a reboot to ensure that another MS Update would not reinstall certain versions of MS and if he found them I wanted to mark them for future IGNORES and ignore them now.

    Still no go. I need help big time. Does anyone for a small iJEFF help today¿

    Hi Jeff,

    1. What is the brand and model of the printer?

    2. is the specific question in the PDF? Have you tried other files to print?

    See the articles:

    Resolve PDF printing problems

    http://helpx.Adobe.com/Acrobat/KB/troubleshoot-PDF-printing-Acrobat-Reader.html

    http://www.Adobe.com/cfusion/search/index.cfm?cat=support&term=Java%2Elang%2ENullPointerException&loc=en_US&self=0&LR=en_US&product=Acrobat

    Let us know if you have other questions about Windows in the future.

  • Persistent Store problem, need your help! ~

    Forgive and I would like to make a short story.

    Days, I am according to the A13_Storing_Persistent_Data_V2 document and fantasize for only a class useful for my application, but I am failed completely, here is that the source code written in the document.

    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 java.util.*; 
    
    public class MusicStores extends UiApplication { 
    
      private AutoTextEditField namefield;
      private AutoTextEditField addressfield;
      private EditField phonefield;
      private EditField specialtyfield;
      private static Vector _data;
      private static PersistentObject store; 
    
      public static void main(String[] args) {
        MusicStores app = new MusicStores();
        app.enterEventDispatcher();
      } 
    
      public MusicStores() {
        MainScreen mainScreen = new MainScreen();
        mainScreen.setTitle(new LabelField("Favourite Music Store"));
        namefield = new AutoTextEditField("Store Name: ", "");
        addressfield = new AutoTextEditField("Address: ", "");
        phonefield = new EditField("Phone Number: ", "", Integer.MAX_VALUE, BasicEditField.FILTER_PHONE);
        specialtyfield = new EditField("Music Type: ", "", Integer.MAX_VALUE, BasicEditField.FILTER_DEFAULT);
        mainScreen.add(namefield);
        mainScreen.add(addressfield);
        mainScreen.add(phonefield);
        mainScreen.add(specialtyfield);
        mainScreen.addMenuItem(saveItem);
        mainScreen.addMenuItem(getItem);
        pushScreen(mainScreen);
      } 
    
      private MenuItem saveItem = new MenuItem("Save", 110, 10) {
        public void run() {
          StoreInfo info = new StoreInfo();
          info.setElement(StoreInfo.NAME, namefield.getText());
          info.setElement(StoreInfo.ADDRESS, ddressfield.getText());
          info.setElement(StoreInfo.PHONE, phonefield.getText());
          info.setElement(StoreInfo.SPECIALTY, specialtyfield.getText());
          _data.addElement(info);
          synchronized (store) {
            store.setContents(_data);
            store.commit();
          }
          Dialog.inform("Success!");
          namefield.setText(null);
          addressfield.setText(null);
          phonefield.setText("");
          specialtyfield.setText("");
        }
      }; 
    
      private MenuItem getItem = new MenuItem("Get", 110, 11) {
        public void run() {
          synchronized (store) {
            _data = (Vector) store.getContents();
            if (!_data.isEmpty()) {
              StoreInfo info = (StoreInfo) _data.lastElement(); 
    
              namefield.setText(info.getElement(StoreInfo.NAME));
              addressfield.setText(info.getElement(StoreInfo.ADDRESS));
              phonefield.setText(info.getElement(StoreInfo.PHONE));
              specialtyfield.setText(info.getElement(StoreInfo.SPECIALTY));
            }
          }
        }
      }; 
    
      static {
        store = PersistentStore.getPersistentObject(0xdec6a67096f833cL);
        synchronized (store) {
          if (store.getContents() == null) {
            store.setContents(new Vector());
            store.commit();
          }
        }
        _data = new Vector();
        _data = (Vector) store.getContents();
      } 
    
      private static final class StoreInfo implements Persistable {
        private Vector _elements;
        public static final int NAME = 0;
        public static final int ADDRESS = 1;
        public static final int PHONE = 2;
        public static final int SPECIALTY = 3; 
    
        public StoreInfo() {
          _elements = new Vector(4);
          for (int i = 0; i < _elements.capacity(); ++i) {
            _elements.addElement(new String(""));
          }
        } 
    
        public String getElement(int id) {
          return (String) _elements.elementAt(id);
        } 
    
        public void setElement(int id, String value) {
          _elements.setElementAt(value, id);
        }
      }
    }
    

    I put this code into two parts, the first part to record the second part to get info and the info, and they use the same class of StoreInfo, here is the code of the first part.

    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 java.util.*; 
    
    public class SaveMusicInfo extends UiApplication { 
    
      private AutoTextEditField namefield;
      private AutoTextEditField addressfield;
      private EditField phonefield;
      private EditField specialtyfield;
      private static Vector _data;
      private static PersistentObject store; 
    
      public static void main(String[] args) {
        SaveMusicInfo app = new SaveMusicInfo();
        app.enterEventDispatcher();
      } 
    
      public SaveMusicInfo() {
        MainScreen mainScreen = new MainScreen();
        mainScreen.setTitle(new LabelField("Favourite Music Store"));
        namefield = new AutoTextEditField("Store Name: ", "");
        addressfield = new AutoTextEditField("Address: ", "");
        phonefield = new EditField("Phone Number: ", "", Integer.MAX_VALUE, BasicEditField.FILTER_PHONE);
        specialtyfield = new EditField("Music Type: ", "", Integer.MAX_VALUE, BasicEditField.FILTER_DEFAULT);
        mainScreen.add(namefield);
        mainScreen.add(addressfield);
        mainScreen.add(phonefield);
        mainScreen.add(specialtyfield);
        mainScreen.addMenuItem(saveItem);
        mainScreen.addMenuItem(getItem);
        pushScreen(mainScreen);
      } 
    
      private MenuItem saveItem = new MenuItem("Save", 110, 10) {
        public void run() {
          StoreInfo info = new StoreInfo();
          info.setElement(StoreInfo.NAME, namefield.getText());
          info.setElement(StoreInfo.ADDRESS, ddressfield.getText());
          info.setElement(StoreInfo.PHONE, phonefield.getText());
          info.setElement(StoreInfo.SPECIALTY, specialtyfield.getText());
          _data.addElement(info);
          synchronized (store) {
            store.setContents(_data);
            store.commit();
          }
          Dialog.inform("Success!");
          namefield.setText(null);
          addressfield.setText(null);
          phonefield.setText("");
          specialtyfield.setText("");
        }
      }; 
    
      static {
        store = PersistentStore.getPersistentObject(0xdec6a67096f833cL);
        synchronized (store) {
          if (store.getContents() == null) {
            store.setContents(new Vector());
            store.commit();
          }
        }
        _data = new Vector();
        _data = (Vector) store.getContents();
      } 
    
      private static final class StoreInfo implements Persistable {
        private Vector _elements;
        public static final int NAME = 0;
        public static final int ADDRESS = 1;
        public static final int PHONE = 2;
        public static final int SPECIALTY = 3; 
    
        public StoreInfo() {
          _elements = new Vector(4);
          for (int i = 0; i < _elements.capacity(); ++i) {
            _elements.addElement(new String(""));
          }
        } 
    
        public String getElement(int id) {
          return (String) _elements.elementAt(id);
        } 
    
        public void setElement(int id, String value) {
          _elements.setElementAt(value, id);
        }
      }
    }
    

    Following is the code of the second part.

    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 java.util.*; 
    
    public class GetMusicInfo extends UiApplication { 
    
      private AutoTextEditField namefield;
      private AutoTextEditField addressfield;
      private EditField phonefield;
      private EditField specialtyfield;
      private static Vector _data;
      private static PersistentObject store; 
    
      public static void main(String[] args) {
        GetMusicInfo app = new GetMusicinfo();
        app.enterEventDispatcher();
      } 
    
      public GetMusicInfo() {
        MainScreen mainScreen = new MainScreen();
        mainScreen.setTitle(new LabelField("Favourite Music Store"));
        namefield = new AutoTextEditField("Store Name: ", "");
        addressfield = new AutoTextEditField("Address: ", "");
        phonefield = new EditField("Phone Number: ", "", Integer.MAX_VALUE, BasicEditField.FILTER_PHONE);
        specialtyfield = new EditField("Music Type: ", "", Integer.MAX_VALUE, BasicEditField.FILTER_DEFAULT);
        mainScreen.add(namefield);
        mainScreen.add(addressfield);
        mainScreen.add(phonefield);
        mainScreen.add(specialtyfield);
        mainScreen.addMenuItem(saveItem);
        mainScreen.addMenuItem(getItem);
        pushScreen(mainScreen);
      } 
    
      private MenuItem getItem = new MenuItem("Get", 110, 11) {
        public void run() {
          synchronized (store) {
            _data = (Vector) store.getContents();
            if (!_data.isEmpty()) {
              StoreInfo info = (StoreInfo) _data.lastElement(); 
    
              namefield.setText(info.getElement(StoreInfo.NAME));
              addressfield.setText(info.getElement(StoreInfo.ADDRESS));
              phonefield.setText(info.getElement(StoreInfo.PHONE));
              specialtyfield.setText(info.getElement(StoreInfo.SPECIALTY));
            }
          }
        }
      }; 
    
      static {
        store = PersistentStore.getPersistentObject(0xdec6a67096f833cL);
        synchronized (store) {
          if (store.getContents() == null) {
            store.setContents(new Vector());
            store.commit();
          }
        }
        _data = new Vector();
        _data = (Vector) store.getContents();
      } 
    
      private static final class StoreInfo implements Persistable {
        private Vector _elements;
        public static final int NAME = 0;
        public static final int ADDRESS = 1;
        public static final int PHONE = 2;
        public static final int SPECIALTY = 3; 
    
        public StoreInfo() {
          _elements = new Vector(4);
          for (int i = 0; i < _elements.capacity(); ++i) {
            _elements.addElement(new String(""));
          }
        } 
    
        public String getElement(int id) {
          return (String) _elements.elementAt(id);
        } 
    
        public void setElement(int id, String value) {
          _elements.setElementAt(value, id);
        }
      }
    }
    

    I'm runing the Project One (first part) and record information to be stored, and then I WANT TO runing the project two (part two), but I received an error message telling me there are two same defined the class in the system, I try to change the class name of StoreInfo in two project, the last of error messge disappeared , instead of a CastClassException error, I am so sad...

    For a long time debugging I found some interesting things, look at the below codes to two projects, please read the name of the StoreInfor class, not StoreInfo.

     private MenuItem getItem = new MenuItem("Get", 110, 11) {
        public void run() {
          synchronized (store) {
            _data = (Vector) store.getContents();
            if (!_data.isEmpty()) {
              StoreInfor info = (StoreInfor) _data.lastElement();
            }
          }
        }
      };
    

    Now the _data class name is StoreInfo@xxxxxx (using _data.getClass () .getName ()) and class StoreInfo project two was renamed to StoreInfor, of course, I received a CastClassException error.

    I finished the story, and I need some guys to help solve this problem, tks a lot! ~

    Creating a descriptor application blackberry project and inside, choose library. Then, each project must refer to this library.

  • Newbie question - NullPointerException in enterEventDispatcher

    Hello

    I'm new to the Blackberry development and use the 4.6 SDK Eclipse plugin. I used the sample applications as a basis and try to add 3 buttons to my main screen. It's code to the constructor of the main screen

    public MyAppScreen() {        super(DEFAULT_MENU | DEFAULT_CLOSE);        try{            setTitle(new LabelField("My First App", LabelField.ELLIPSIS                 | LabelField.USE_ALL_WIDTH));                       FieldChangeListener listener = new FieldChangeListener() {              public void fieldChanged(Field field, int context) {                    Field buttonField = (Field) field;                  System.out.println("Button pressed: " + buttonField.getIndex());                }           };              HorizontalFieldManager hfm = new HorizontalFieldManager(                    Manager.HORIZONTAL_SCROLL);             ImageButton commBtn = new ImageButton(Field.FOCUSABLE,                  "img/comm_over.png", "img/comm.png");           commBtn.setChangeListener(listener);                        ImageButton accBtn = new ImageButton(Field.FOCUSABLE,                   "img/acts_over.png", "img/acts.png");           accBtn.setChangeListener(listener);                     ImageButton oppBtn = new ImageButton(Field.FOCUSABLE,                   "img/opp_over.png", "img/opp.png");         oppBtn.setChangeListener(listener);             hfm.add(commBtn);           hfm.add(new RichTextField(Field.NON_FOCUSABLE));            hfm.add(accBtn);            hfm.add(new RichTextField(Field.NON_FOCUSABLE));            hfm.add(oppBtn);                add(hfm);       }       catch(Exception e){         e.printStackTrace();        }   }
    

    I call it in my UiApplication class as follows

    public MyApp() {    MyAppScreen homePage = new MyAppScreen();    pushScreen(homePage);}public static void main(String[] args) {   MyApp app = new MyApp();    app.enterEventDispatcher();}
    

    ImageButton is a custom class whose code I made custom buttons sample application subject to change. When I run the application, I get a NullPointerException and stacktrace illustrates the exception in the MyAppScreen paint method.

    Is someone can you please tell me what could be wrong with the application.

    Thank you.

    @mantaker, sorry, it was just a typo. Fix the code.

    Thanks for all the answers. I solved the problem. Had missed on initialization in a constructor.

    I feel really stupid

  • SAX, problem analysis

    Hey I hope you guys are all right, uh parsing xml using the analysis of sax, and I have a problem... the analysis done successfully, but when I started to show on the screen shows NullPointerException savings of the categories in the table

    This is the code for the handler to

    package startAPp;
    
    import java.util.Vector;
    
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    
    import Utils.NCRDecoder;
    
    public class XMLHandler extends DefaultHandler {
        StringBuffer sb;
        private CategoryBean category;
        private Vector categories = new Vector();
    
        public void startDocument() throws SAXException {
            // TODO Auto-generated method stub
            super.startDocument();
        }
    
        public void endDocument() throws SAXException {
            // TODO Auto-generated method stub
            categories.trimToSize();
            CategoryBean[] beans = new CategoryBean[categories.size()];
            categories.copyInto(beans);
            AppManger manger = new AppManger();
            manger.setSize(categories.size());
            manger.setCategories(beans);
            System.out.println("end Document");
    
        }
    
        public void startElement(String uri, String localName, String qName,
                Attributes attributes) throws SAXException {
            // TODO Auto-generated method stub
            sb = new StringBuffer("");
            if (localName.equals("category")) {
                category = new CategoryBean();
    
            }
        }
    
        public void endElement(String uri, String localName, String qName)
                throws SAXException {
            // TODO Auto-generated method stub
            if (localName.equalsIgnoreCase("title")) {
                category.setTitle(sb.toString());
                System.out.println(" Name....." + sb.toString());
            } else if (localName.equalsIgnoreCase("link")) {
                category.setLink(NCRDecoder.decode(sb.toString()));
                System.out.println(sb.toString());
            }
            System.out.println("Local Name....." + localName);
            categories.addElement(category);
            sb = new StringBuffer("");
        }
    
        public void characters(char[] ch, int start, int length)
                throws SAXException {
            String theString = new String(ch, start, length);
            sb.append(theString);
        }
    
    }
    

    and it's the Manger who save the table.

    package startAPp;
    
    public class AppManger {
        CategoryBean[] beans;
        int size;
    
        public AppManger() {
    
        }
    
        public void setCategories(CategoryBean[] beans) {
            this.beans = beans;
    
        }
    
        public CategoryBean[] getCategories() {
            return beans;
        }
    
        public int getSize() {
            return size;
        }
    
        public void setSize(int size) {
            this.size = size;
    
        }
    
    }
    

    It is a sample of the screen to detect if the table contains null or not

       AppManger app;
        CategoryBean[] beans;
        Connection _conn;
    
        Vector v;
    
        public MyScreen() {
            setTitle("MyTitle");
            _conn = new Connection();
            _conn.start();
    
        }
    
        public void addElements() {
            app = new AppManger();
            beans=new CategoryBean[app.getSize()];
    
            v = new Vector();
            add(new LabelField("start"));
            for (int i = 0; i < beans.length; i++) {
                add(new LabelField(i+""));
            }
    }
    

    guys please help me

    There seems to be a lot of LN(x) = inkage code missing in this example, you boot, you start a connection.  But we do not know how this relates to your XML Manager or how your XMLHandler, which seems to have its own local variables, relates to the AppManger in your MyScreen.  There are also problems of timing here - ideas actulaly wire complete before displaying MyScreen.

    Wondering - how Java news are you?

    In any case, the obvious error is illustrated by these two lines:

    (a) in XMLHandler

    Feeder AppManger = new AppManger();

    (b) in MyScreen

    p = new AppManger();

    You see to think that they are the same object.  They are of the same class, but that doesn't make them the same object.  More specifically, they are two different instances of the same class.  If you want that treatment on the day the same object, then they must share.

    You can do this in

    (1) sharing a t in reference to the same object (i.e. only create an AppManager object and pass it to the MyScreen and XMLHandler time) or

    (2) to create a bot that Singleton Instance can access too.

    In this case (2) is easier, and the best way to create a Singleton is to make it static (which as you will discover later does not actually a Singeton in all cases, but fact in this case).

    Then change the beginning of AppManager as follows:

    public class AppManger {}
    CategoryBean beans [];
    int size;

    static instance of AppManger;

    private AppManger() {}

    }

    public static getInstance() {} AppManger

    If (instance == null) {}
    instance = new AppManger();

    }

    return instance;

    }
    .....

    and then instead of use

    ... = new AppManager()

    use

    ... = AppManager.getInstance ();

    With that resolved, you have only the synchronization problem to worry, in other words, ensuring that you do not display data on MyScreen until you have downloaded.  It is another problem.

  • Problems to make my first application work

    Hello, I am new in the development of blackberry applications, but not new in development (C++, C, c#, JAVA).

    I am facing some problems with my first development for the blackberry in JAVA platform.

    MyScreen code:

    public final class MyScreen extends MainScreen
    {
    
        EncodedImage mImage = EncodedImage
                .getEncodedImageResource("icon.png");
        ApplicationIcon mIcons = new ApplicationIcon(mImage);
    
        ApplicationIcon mIcon = mIcons;
    
        private static Date cDate;
        private String lefteds = "";
        private  LabelField leftd = new LabelField("Not set");
        private TextBoxField tbf = new TextBoxField(200, 30);
       // private GridFieldManager grid = new GridFieldManager(3,3,1);
        //private VerticalFieldManager _manager;
        private LabelField Leftd2 = new LabelField("Not set");
        private int Inum = -1;
    
        //-----------------------------------------------
        private static PersistentObject store = PersistentStore.getPersistentObject(0x1dfc10ec6454eb14L); 
    
        public void saveUserInfo(){
            synchronized(store) {
                store.setContents(leftd);
                store.commit();
            }
        }
    
        public LabelField getlefted() {
            LabelField leftd;
            synchronized(store) {
                leftd = (LabelField)store.getContents();
                if(leftd == null) {
                    leftd = new LabelField("Not Set!");
                }
            }
            return leftd;
        }
        //-----------------------------------------------
    
        MenuItem menuRegister = new MenuItem("Add status icon", 0, 0) {
            public void run() {
                registerIndicator();
            };
        };
    
        MenuItem menuUnregister = new MenuItem("Remove status icon", 0, 0) {
            public void run() {
                unregisterIndicator();
            };
        };
    
        protected void makeMenu(Menu menu, int instance) {
            super.makeMenu(menu, instance);
            menu.add(menuRegister);
            menu.add(menuUnregister);
        }
    
        private void registerIndicator() {
            try {
                ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
                        .getInstance();
                ApplicationIndicator indicator =
                        reg.register(mIcon, false, true);
                indicator.setVisible(true);
            } catch (Exception e) {
            }
        }
    
        private void unregisterIndicator() {
            try {
                ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
                        .getInstance();
                reg.unregister();
            } catch (Exception e) {
            }
        }
    
        void updateValue(int value) {
            try {
                ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
                        .getInstance();
                ApplicationIndicator appIndicator =
                        reg.getApplicationIndicator();
                appIndicator.setValue(value);
            } catch (Exception e) {
            }
        }
    
        void updateIcon(ApplicationIcon icon) {
            try {
                ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
                        .getInstance();
                ApplicationIndicator appIndicator =
                        reg.getApplicationIndicator();
                appIndicator.setIcon(icon);
            } catch (Exception e) {
            }
        }
    
        //--------------------------------------------------
    
        public MyScreen()
        {
            try
            {
            this.Leftd2.setText(getlefted().getText());
            }
            catch (Exception e)
            {
    
            }
    
             Background bg = BackgroundFactory.createSolidBackground(Color.LIGHTGRAY);
             setBackground(bg);
    
               XYEdges edges = new XYEdges(20, 20, 20, 20);
               Border border = BorderFactory.createBevelBorder(edges);
    
            // Set the displayed title of the screen
             setTitle("CountDown");
             ButtonField b = new ButtonField("Set CountDown", ButtonField.CONSUME_CLICK);
    
             b.setChangeListener(customListener);
             add(b);
    
             this.tbf.setText("Days to go!");
             add(Leftd2);
    
             add(this.tbf);
    
             if (this.Leftd2 == null)
             {
             saveUserInfo();
             }
    
        }
    
        public void calculate()
        {
            Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
            c.setTime(new Date(System.currentTimeMillis())); //now
    
            Date currentdate = c.getTime();
    
            int lefted = (int)((cDate.getTime() - currentdate.getTime()) / (1000 * 60 * 60 * 24)) + 1;
            lefteds = lefted + "";
            leftd.setText(lefted + " " + this.tbf.getText());
            Leftd2.setText(lefted + " " + this.tbf.getText());
            saveUserInfo();
            this.Inum = lefted;
            updateValue(lefted);
    
        }
    
          FieldChangeListener customListener = new FieldChangeListener() {   
    
                public void fieldChanged(Field field, int context) {    
    
                     DateTimePicker datePicker = DateTimePicker.createInstance();
                     datePicker.doModal();
                     Calendar cal = datePicker.getDateTime();
                     Date date = cal.getTime();
                     MyScreen.cDate = date;
                     calculate();
                }
                 };
    
        }
    

    It's part * beep * ugly code and also, my application

    There are some problems with it (apart from the fact that its badly coded, etc.).

    Why is my device reboots as a minute after I launch my app (while the app completely closed)?

    Is why I set the status bar would not appear as it should?

    I hope that someone here would be able to help me, I'm sort of stuck... I must be trying to include to the top of my own for almoste time.

    Thank you very much.

    "I have being trying to understand by myself for almost an hour."

    What - only an hour?

    There is a little run before you can walk through this code, suggest a slightly lower rate.

    Two things that I would look at first.

    (1) but first reboot the device.  I'm guessing that you have an older device and you compile using a more recent environment.  Do not forget the applications being forward but not backward compatible, you should develop with a JDE older than the operating system on your device.

    Allied to this I'll make sure your app is not started automatically.

    (2) you seem to try to persist a LabelField:

    public void saveUserInfo() {}
    {Synchronized (Store)}
    store.setContents (leftd);
    Store.Commit ();
    }
    }
       
    public getlefted() {} LabelField
    LabelField leftd;
    {Synchronized (Store)}
    leftd = (LabelField) store.getContents ();
    if(leftd == null) {}
    leftd = new LabelField ("Not Set!");
    }
    }
    Return leftd;
    }

    To be persistent, an object must implement Persistable.  LabelField doesn't do this.  If you want to save a LabelField, what you save is the text (a string that is persistent) and recreate it.

    See how you go after looking through this.  But I recommend to start simple (just count) before adding things as indicators and persistentStore.

  • NullPointerException in screen #navigationMovement Manager

    Hello

    After you add a VerticalFieldManager to a screen, Manager of navigationMovement super screen throws a NullPointerException and the verticalFieldManager scroll with the trackpad of this point (using the Enter key to scroll works very well and after once the trackpad works again scroll).

    I use the same model as this post defining NullField focus on the top and the bottom of the field with vertical scrolling. Has anyone have the same problems, or have any ideas on places of interest to search for?

    I'm sorry, that I couldn't reproduce it with a simple example. After a few hours, I was able to solve the problem by changing the hierarchy of my screen area, adding a handler of accepting high-field the developed anything in it.

    I think what he throwed NullPointerException because he could not find a field of focus when took place the first movement of the navigation, or the system has attempted to lock the focus on an element unfocusable. I have no final conclusion, I could work around it by rearranging the fields.

  • NullPointerException

    So I try to get a storage for an options screen, but apparently my method of doing this just won't work right. whenever I try to access a variable of the OptionsScreen, it is null, unless I opened the screen Options atleast once.  Now, I tried to create a new instance of the OptionsScreen to see if it works... but it didn't.

    The application starts on the main menu, then the next screen is screen2.  You can open the Options of screen2 screen.  The only way to prevent a NullPointerException is now opening the OptionsScreen atleast once

    I put three categories below to view the corresponding code.

    public class theApplication extends UiApplication
    {
    
        public static OptionsScreen options;
    
        public theApplication()
        {
            pushScreen(new MainMenu());
        }
    
        public static void main(String[] Args)
        {
            // Create a new instance of the sample application
            theApplication theApp = new theApplication();
            // Add this app to the event dispatcher
            theApp.enterEventDispatcher();
            // Create new options screen, to attempt to
            // load all options from persistent store
            options = new OptionsScreen();
        }
    
    }
    
    final public class OptionsScreen extends MainScreen
    {
    
        private static PersistentObject options;
        /** This is the key that allows access to the settings. */
        private static long optionsKey = 0x6514f426119fc864L; 
    
        private static BasicEditField text;
    
        public OptionsScreen()
        {
    
            // Set the title
            setTitle("Options");
    
            options = PersistentStore.getPersistentObject(optionsKey);
    
            setupUI();
    
        }
    
        protected void setupUI()
        {
            retrieveData();
    
            add(text);
        }
    
        private static boolean storeData()
        {
            Options newOptions = new Options(); 
    
            try
            {
                synchronized(options)
                {
    
                    newOptions.setText(text.getText());
                    options.setContents(newOptions);
                    options.commit();
    
                    return true;
                }
            }
            catch(Exception e)
            {
    
                Dialog.alert("error!");
                return false;
    
            }
        }
    
        private static void retrieveData()
        {
    
            Options theOptions = new Options();
            try
            {
                synchronized(options) {
    
                    theOptions = (Options)options.getContents();
    
                    try                { text = new BasicEditField("text ", theOptions.getText());}
                    catch(Exception e) { text = new BasicEditField("text ", "");                  }
    
                }
            }
        }
    
        public void save() throws IOException
        {
    
            storeData();
            super.save();
    
        }
    }
    
    public class Options implements Persistable
    {
        private String text;
    
        public void setText(String newText) { text = newText;}
        public String getText() {return text};
    }
    

    I have your OptionScreen class, do not use the bt constructor to initialize your data:

    static {
            options = PersistentStore.getPersistentObject(optionsKey);
    }
    

    I encourage you to use the Singleton patern

  • what the? (ChoiceField) .getChoiceCached (int) online: 898 NullPointerException

    Why I get this error?   (ChoiceField) .getChoiceCached (int) online: 898 NullPointerException

    The ChoiceFeild object is not null.

    JDE 5.0, 1.6.latest, Windows XP pro 32-bit jdk 1.3.0 eclipse plugin

    The exception gives no message.

    Just found the bug, here's the code.

    Sort = new InData [X];       Suppose X 4 >
    Type [0] =...

    sort [1] =...

    Sort [2] =...

    Sort [3] =...

    That is the problem - the sorting matrix is defined over a length of X but is filled less of X items

    sortChoice = new TransparentObjectChoiceField ("", sort, 0, Field.FIELD_VCENTER, orig) {}
    {} public void paint (Graphics graphics)
    graphics.setColor (menuTextColor);
    Super.Paint (Graphics);
    }
    };

    It was hard to find because the exception was thrown only when the screen with the sortChoice object was pushed and then of course there were several of these objects on the screen so it is difficult to see who wants to go.

    Thank you.

Maybe you are looking for

  • Compaq CQ5210F desktop: when I turn off my desk, I lose my date settings and clock

    When I turn off my computer's power supply, I have now lost all my memory date and time. I just change my cmos battery. Still nothing. Windows 7 64-bit. The new battery would be bad?

  • Is there a malware remover comprable to "malwarebytes" for 10.6.8?

    I was overcome by a parody of the installation of Google as my home page.  The only way to delete what I found is Malwarebytes, but it is for 10.8.x / any help? Goldie

  • IQ816 to crush when waking Sleep Mode

    This seems to be my last problem.  I had a virus.  Who cleaned up.  I also had problems with the Nvidia driver, so I've updated that.  I tried a repair of this problem by using the System File Checker.  Does not solve it.  Registry cleaner is not set

  • Preserve the original dt during playback PDM

    Hi all I have the following situation. We have two VI; the first reads a PDM GB 3 file and allows us to extract the selected channels, which we can then decimate, reducing the size of bit, maybe a few other conversions, etc. We then record these chan

  • Windows 7 does not not entirely - not updated

    Some problems have emerged over the past month, I would be very grateful for any help: Windows will not update, error 80072EFE code, last modified on 02/11/2010 (February 11, 2010) Search engine in IE8 and Firefox do not work correctly, with tabs doe