Eception java.lang.error trying to create format XML string

I am trying to create XML documents without having to build everything manually whenever I want to do this.  I created a XMLFile class to create the document.  When I try to launch my app TestFoo, I get untrapped Exception java.lang.error.  I tried kxml2, using org.w3c.dom, java XML, banging my head against the wall as to why it will not work until I finally just rolled my own simple implementation.  I always get the error!  No details are provided.  There is no stack trace.  I use the emulator 9000 "BOLD" crossing os 4.6.0 eclipse 3.4.1

Console:

Starting TestFooStarted TestFoo(154)Exit TestFoo(154)ErrorNo detail messageTestFoo Document  0x171TestFoo XMLFile  0x381TestFoo TestFoo  0x297TestFoo TestFoo main 0x276

TestFoo.java

import net.rim.device.api.system.Application;

public class TestFoo extends Application {

  public static void main(String[] args) {      TestFoo foo = new TestFoo();      foo.enterEventDispatcher();   }

  public TestFoo() {        XMLFile xml = new XMLFile("rootNode");        xml.addProperty("myprop", "some value");      System.out.println(xml.toFormattedXMLString());       System.exit(0);   }}

XMLFile.java

public class XMLFile {   Document document;    public XMLFile(String rootElement) {      document = new Document(rootElement); }

  public void addProperty(String pName, String pText) {     Element elm = new Element("property");        elm.addAttribute("name", pName);      elm.setTextContent(pText);        document.appendChild(elm);    }    public String toFormattedXMLString() {     return document.toFormattedXML();    }}

Element.Java

import java.util.Enumeration;import java.util.Hashtable;import java.util.Vector;

public class Element {   private Vector children;  private String name;  private String textContent;   private Hashtable attributes;

  public Element(String name) {     this.children = new Vector();     this.attributes = new Hashtable();        this.name = name; } public void appendChild(Element child) {      this.children.addElement(child);  } public Vector getChildren() {     return children;  } public String getName() {     return name;  } public void setName(String name) {        this.name = name; } public String getTextContent() {      return textContent;   } public void setTextContent(String textContent) {      this.textContent = textContent;   } public Hashtable getAttributes() {        return attributes;    } public boolean hasChildren() {        return (this.children.size() > 0); } public int childrenCount() {      return this.children.size();  } public String getAttributeValue(String name) {        return this.attributes.get(name).toString();  } public void addAttribute(String key, String value) {      this.attributes.put(key, value);  } public void addAttribute(String key, int value) {     addAttribute(key,Integer.toString(value));    } public void addAttribute(String key, long value) {        addAttribute(key,Long.toString(value));   } public void addAttribute(String key, boolean value) {     addAttribute(key, String.valueOf(value)); } public boolean hasAttribute(String name) {        return this.attributes.containsKey(name); } public Element getChild(int position) {       return (Element) this.children.elementAt(position);   } public Enumeration getAttributeKeys() {       return this.attributes.keys();    }}

Document.Java

import java.util.Enumeration;

public class Document { private static final char _gt = '>';   private static final char _lt = '<';   private static final char _eq = '=';  private static final char _dqt = '"'; private static final char _cl = '/';  private static final char _sp = ' ';  private static final char _tab = '\t';    private static final byte[] _nl = System.getProperty("line.separator").getBytes();

  private Element rootNode; private StringBuffer sb;

  public Document(String rootName) {        this.rootNode = new Element(rootName);    } public void appendChild(Element child) {      this.rootNode.appendChild(child); } public String toFormattedXML() {      sb = new StringBuffer();      format(this.rootNode,0);      return sb.toString(); }

  private void format(Element node, int depth) {        writeOpenTag(node, depth);        for (int i=0;i0;i--) {            sb.append(_tab);      } }    private void writeOpenTag(Element node, int depth) {       indent(depth);        sb.append(_lt);       sb.append(node.getName());        for (Enumeration keys = node.getAttributeKeys();keys.hasMoreElements();) {            String key = keys.nextElement().toString();           sb.append(_sp).append(key);           sb.append(_eq).append(_dqt);          sb.append(node.getAttributeValue(key).toString());            sb.append(_dqt);      }    }    private void writeCloseTag(Element node, int depth) {       if (node.hasChildren()) {         sb.append(_lt).append(node.getName());        } else {          sb.append(_cl);       }     sb.append(_gt).append(_nl);    }}

This line:

private static final byte[] _nl = System.getProperty("line.separator").getBytes();

is originally a NullPointerException because line.separator is not well supported. The line terminator standard for XML is CR/LF, so you can use:

private static final byte[] _nl = { '\r', '\n' };

Tags: BlackBerry Developers

Similar Questions

  • Smartphones blackBerry eception exception: Java.lang.Error

    Hello

    After downloading the twitter app that shows the following when I try to open it.

    Eception exception: Java.lang.Error

    Nobody knows what it means and how to fix this.

    Thank you!

    poppi2000 wrote:

    Hello

    After downloading the twitter app that shows the following when I try to open it.

    Eception exception: Java.lang.Error

    Nobody knows what it means and how to fix this.

    Thank you!

    Hello

    1. try to delete the first reboot of batteries that clears the application error

    2 also try uninstalling the last app you have installed before the error and restart / disconnect the battery. You can reinstall these applications later.

    3 if there are errors, you can clean your pocket computer to clear / delete applications and reinstall the application. How to delete all data and applications from the smart phone BlackBerry with the optio security wipe...

    4 the final solution is to reinstall the operating system or all OS upgrade to the latest version. How to update or reinstall BlackBerry Device Software using BlackBerry Desktop Software

  • Eception exception: java.lang.Error

    Model BB: 9360
    OS: 7,0 Bundle 1693
    (v7.0.0.319, platform 8.0.0.391)
    Carrier: T-Mobile
    With the help of BIS
    ------------------
    Application memory: 29058608
    Current storage:
    Storage applications: 27.6 MB
    Multimedia card:
    Total: 1.8 GB
    Free: 6661,5 MB
    --------------------
    I get the error message "Eception exception: java.lang.Error" often, once the system reboots - as well reboot where the system indicates that a restart is required &, too, when there has been a reboot regular (using deReset). I recently installed app, of BBAW, "PocketDay" that generates the tgis same error when I try to launch it.
    The system of detailed view of the event is:
    Name: error
    GUID: 9c3cd62e3320b498
    Time: April 28, 2012 16:47:05
    No detail message
    net_rim_cldc (4E5413CE)
    ControlledAccess
    assertRRISignature
    0x39CD
    net_rim_cldc-11 (4E5413CE)
    Display

    0xAFCD
    pdlistlib (498F098A)
    pdlistlib

    0 x 396
    pdlistlib (498F098A)
    pdlistlib$ pdLists

    0x321D
    pdlistlib (498F098A)
    pdlistlib$ pdLists

    0x41AF
    pdlists (498D960B)
    PI

    0x66C
    pdlists (498D960B)
    PI
    main
    0 x 730

    Hello and welcome on the M1A forums!

    A few places to visit: Blackberry 101     tips & tricks

    I suggest that you remove the application of PocketDay you installed recently to AW.  Restart your device and see if that does not get rid of the error message.  Go a few days and confirm that the error remains far away.  Then you can try to reinstall the application; Perhaps the installation has been corrupted. (btw I see on the site of PocketDay all BB PocketDay products have been abandoned so maybe that is the issue.) I could not find the app in AW either.)  Let us know how it goes.

    Happy to welcome you!

  • BlackBerry smartphones this message after each reset "Eception exception: java.lang.Error.

    Hello

    Because I deleted some languages on my BB, and I kept the French, German and English language, after each reboot (after an update via BB Desktop Manager for example), I received this message:

    "Eception exception: java.lang.Error.

    I select 'OK' and that's all, but I want to solve this problem...

    Thank you.

    Hello!

    If you get this reliable error, then it is very likely that something in your OS device is damaged. This type of error is the "final" in the programming code - an event has happened for which there is no event handler in the code. I suggest to try two things (in order):

    (1) whenever random strange behaviors creep, the first thing to do is a battery pop reboot. With power ON, remove the hood back and remove the battery. Wait a minute, then replace the battery and cover. Power on and wait patiently through the long reboot - about 5 minutes. See if things return to functioning. Like all computing devices, BB suffers from memory leaks and others... with a hard reboot is the best remedy.

    (2) reload your OS:

    • KB11320 How to perform a clean reload of the BlackBerry Device Software using the Application Loader tool

    Good luck and let us know!

  • ToolBarMenuButton.AddMenuItem (ApplicationMenuItem) survey java.lang.Error

    ApplicationMenuItemRepository.getInstance () .addMenuItem (ApplicationMenuItemRepository.MENUITEM_SYSTEM, applicationmenuitem)

    It shows an error: "Eception exception: Java.lang.Error.

    The exception cannot be caught and does not appear in the debugger, only on the phone.  It happens once ToolBarMenuButton.AddMenuItem calls toString in the ApplicationMenuItem, but the chain is fine - a literal.

    The call stack is several levels deep within unknown methods.

    Works fine in simulators and on the storm, but not on a 8330 4.5 running.

    Solved.  For some reason you need PIM / permission to organizers to add the entire system menu items.  I got the module defined with this permission, but the CodeModuleGroup didn't.

    They did of course difficult to debug it - he didn't throw a ControlledAccessException as it was supposed to.  Instead, he threw something that cannot yet be intercepted, which means that if users don't have the right permissions, the bombs of the app with an error that could be anything.

    Checks permissions and prompting if necessary, but in the past have always had requests for assistance relating to permissions yet, so it does not always work.

  • java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.Orac

    Hello world

    I have a problem with ojdbc14.jar is.
    My request, which is a J2EE (JSP) application, grows on JDeveloper 10.1.3.3 and works correctly. But I can't run my application on JDev 11.1.1.0.1.
    The problem is (I think) I can access at design time ojdbc.jar, but in the moment of execution, JDeveloper gives me below the exception when I press the run button.


    Error 500 - Internal server error

    java.lang.IllegalAccessError: tried to access class class oracle.jdbc.driver.OraclePreparedStatement UtilityPack.DBPack.TPreparedStatement
    to UtilityPack.DBPack.TPreparedStatement. (TPreparedStatement.java:72) (== > > tihis is my class)
    at UtilityPack.HCombos.fillCombos (HCombos.java:59)
    at jsp_servlet.__index._jspService(__index.java:158)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:408)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:318)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3498)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs (unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Could you please help? You have an idea? I tried, but I couldn't find the problem.
    Everything would be great.

    Thanks in advance.

    And you can read this.

    http://forums.Oracle.com/forums/Ann.jspa?annID=201

    Sascha

  • BlackBerry Smartphones Java.lang.error

    I deleted 2 requests for my turn. After the reboot, I got an error that reads... [Untrapped exception Java.lang.error]

    Although the 2 applications is not in the list of applications, they appear on downloadswith a green arrow next to them saying they are archived to be installed at a later date. I never will not reinstall them. How can I wipe them forever? I don't want to see icons

    THX

    Uncaught exceptions are essentially the final 'out' in programming... code an event that has happened for which there is no instruction in the program to deal with, then it falls out of the code string. The only solution is to have the programming code to handle the situation... which means the original code to be written to handle the event, tested and released to businesses and carriers to test and certify and communicate to their user base. The only solution is therefore, at our level is so of course we are on most recently certified code of our carriers. But this nature will not stop mistakes... they will continue randomly, like errors in all computer peripherals.

  • -2519 error trying to create a PDM file

    I'm trying to create a file of PDM with a code on a 9073 that previously worked. He started giving me an error-2519, so after reading upward, I did a reset of the cRIO - no help, then did a software restart on the cRIO - without help, then did a reformat, reinstall the software on the cRIO - no help. Now what? It works without error if I run the code on a PC instead of the cRIO.


  • Get the 500 error trying to create a table using the REST API

    Hello

    I tried to create a table using the REST API for Business Intelligence Cloud, but I got 500 Internal Server Error for a while now.

    Here are the details that I use to create a table.

    Capture.JPG

    and the json to create the schema that I use is

    [{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ["ROWID"]}]

    , {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['RELATIONID']},

    {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['ID']}

    , {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['RESPONDEDDATE']},

    {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [255], 'columnName': ['RESPONSE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_CREATEDDATE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_CREATEDBYID']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_LASTMODIFIEDDATE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_LASTMODIFIEDBYID']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_SYSTEMMODSTAMP']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [10], 'columnName': ['SYS_ISDELETED']},

    [{'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [50], 'columnName': ['TYPE']}]

    I tried this using postman and code, but I always get the following response error:

    Error 500 - Internal server error

    Of RFC 2068 Hypertext Transfer Protocol - HTTP/1.1:

    10.5.1 500 internal Server Error

    The server encountered an unexpected condition which prevented him from meeting the demand.

    I am able to 'get' existing table schemas, delete the tables, but I'm not able to make put them and post operations. Can someone help me to identify the problem, if there is no fault in my approach.

    Thank you

    Romaric

    I managed to create a table successfully using the API - the only thing I see in your JSON which is different from mine is that you have square brackets around your values JSON where I have not. Here is my CURL request and extract my JSON file (named createtable.txt in the same directory as my CURL executable):

    curl u [email protected]: password UPDATED h x ' X-ID-TENANT-NAME: tenantname ' h ' Content-Type: application/json '-binary data @createtable.txt https://businessintell-tenantname.analytics.us2.oraclecloud.com/dataload/v1/tables/TABLE_TO_CREATE k

    [

    {

    'columnName': 'ID',

    'dataType': 'DECIMAL ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': false

    },

    {

    'columnName': 'NAME',

    'dataType': 'VARCHAR ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    "columnName': 'STATUS."

    'dataType': 'VARCHAR ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    "columnName': 'CREATED_DATE."

    'dataType': 'TIMESTAMP '.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    'columnName': 'UPDATED_DATE ',.

    'dataType': 'TIMESTAMP '.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    }

    ]

  • Error trying to create for iOS Provisioning Profiles (Distribution) .ipa

    Hello, I tried to deploy my application MAF to a .ipa package. I use jDeveloper 12 c. I've already done before for profiles of development and it was working perfectly until yesterday when I tried to create a .ipa with certificate of Distribution. Now, I can't deploy for distribution, or for the development...

    The corresponding configurations for the iOS platforms, I did: I created the profile of Provisioning for Distribution in space subscribers for Apple developers and by signing the identity, I added the certificate corresponding to Distribution applications. I also defined an APP ID, I have configured my CRG - application.XML with the corresponding APPID, well.

    But when I tried to deploy my application to a package I get the below error:

    [11:33:13] successful deployment

    [11:33:13] security copy of related files at the request of the MAF...

    [11:33:13] executed command-line path: / users/MYMAC/jdeveloper/mywork/myMAFApp/deploy/OTROOOOOOOOOOO/temporary_xcode_project /.

    [11:33:13] run command line: xcodebuild-window Oracle_ADFmc_Container_Template archive archivePath - /Users/myMac/jdeveloper/mywork/myMAFApp/deploy/OTROOOOOOOOOOO/Destination_Root/Company.xcarchive - IPHONEOS_DEPLOYMENT_TARGET = TARGETED_DEVICE_FAMILY = 1 7.0 iphoneos sdk, ADD_SETTINGS_BUNDLE 2 = No. PRODUCT_NAME = company CODE_SIGN_IDENTITY = iPhone Distribution: MY COMPANY NAME. (215AST54872)

    [11: 33:15] orders for next generation failed:

    [11: 33:15] command-line execution failed (return code: 65)

    [11: 33:15] undeployment.

    [11: 33:15] - incomplete deployment.

    [11: 33:15] could not build the iOS application pack.

    [11: 33:15] deployment failed due to one or more errors returned by 'xcodebuild.  What follows is a summary of the returned error:

    Command-line execution failed (return code: 65)

    Orders for next generation failed:

    Check dependencies

    (1 failure)

    I don't know what could happen... This happened last week when I was trying to do the same thing and I registered my app in iTunes Connect. I wasn't able to delete the iTunes Connect app so I modified the APPID and since then, I have been able to deploy my application to a package again (certificate for development), but this time I didn't create a new application in iTunes Connect, so I don't know what could be happeing...

    I hope you guys can help me because I'm panicking... I ran out of options...

    I'm sure it's a problem with certifications, because I can deploy to iOS Simulator without any problem.

    Thank you very much!

    Thanks for your advice. I ran the command in the console and I could see the xcodebuild log and I realized that I was not setting good App ID, so I changed it and it worked perfectly.

    Thank you very much for your help!

  • Eception exception: java.lang.Error when persisting the data...

    Hi all

    I am facing this error persisting my data.

    I followed the example provided to

    http://NA.BlackBerry.com/developers/resources/A13_Storing_Persistent_Data_V2.PDF

    First, I copy paste the code in a project. It was working fine. Later I managed for my use following code re

    SerializableAttribute public class HelloWorld extends UiApplication
    {
    Public Shared Sub main (String [] args)
    {
      
    Hello HelloWorld = new HelloWorld();
    hello.parseOnlineData ();
    hello.enterEventDispatcher ();
    }
    public HelloWorld()
    {
    a new screen
    Try
    {
    pushScreen (new HelloWorldScreen()); MusicStores
    pushScreen (new Settings());
    }
    catch (System.Exception e)
    {
    System.out.println ("# error" + e.getMessage ());
    }
    }
     
    / * class final HelloWorldScreen extends screen
    {
    LabelField settings private;
    public HelloWorldScreen()
    {
    Super();
    LabelField title = new LabelField ("HelloWorld example",
    LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
    setTitle (title);
    Add (new LabelField "(Bonjour World!",LabelField.FOCUSABLE) ");
    }
    public boolean onClose()
    {
    Dialog.Alert ("Goodbye!");
    System.Exit (0);
    Returns true;
    }
      
    }*/
     
    }

    # second class that is inherited from the screen...

    Settings/public class extends screen
    {
    most popular public static string = "most popular."
    public static String newlyadded = "newlyadded;
    public static string Bulletin = 'News ';
    public static string columns = "columns";
    public static string = "jobs" jobs
    public static string = "events" events
    public static interview of string = "interview"
    public static String indepth = 'thorough ';
     
    CheckboxField chkMostPopular;
    CheckboxField chkNewlyAdded;
    CheckboxField chkNews;
    CheckboxField chkColumns;
    CheckboxField chkJobs;
    CheckboxField chkEvents;
    CheckboxField chkInterview;
    CheckboxField chkIndepth;
    ButtonField saveFields;

    public Settings()
    {
    Try
    {
    Configuration config = StoreConfiguration.getConfiguration ();
    If (config! = null &! config.isEmpty ())
    {
    chkMostPopular = new CheckboxField ("Most popular", ((Boolean) config.getElement (mostPopular)) .booleanValue ());
    chkNewlyAdded = new CheckboxField ("Newly added", ((Boolean) config.getElement (newlyadded)) .booleanValue ());
    chkNews = new CheckboxField ('News', ((Boolean) config.getElement (news)) .booleanValue ());
    chkColumns = new CheckboxField ("Columns", ((Boolean) config.getElement (columns)) .booleanValue ());
    chkJobs = new CheckboxField ("Jobs", ((Boolean) config.getElement (jobs)) .booleanValue ());
    chkEvents = new CheckboxField ('Events', ((Boolean) config.getElement (events)) .booleanValue ());
    chkInterview = new CheckboxField ("Interview", ((Boolean) config.getElement (interview)) .booleanValue ());
    chkIndepth = new CheckboxField ("in depth", ((Boolean) config.getElement (indepth)) .booleanValue ());
    }
    on the other
    {
    chkMostPopular = new CheckboxField ("Most popular", false);
    chkNewlyAdded = new CheckboxField ("Newly added", false);
    chkNews = new CheckboxField ("News", false);
    chkColumns = new CheckboxField ("Columns", false);
    chkJobs = new CheckboxField ("Jobs", false);
    chkEvents = new CheckboxField ("Events", false);
    chkInterview = new CheckboxField ("Interview", false);
    chkIndepth = new CheckboxField ("in depth", false);
    }
       
       
    saveFields = new ButtonField ("Save")
    {
    protected boolean navigationClick (int status, int time)
    {
    persistConfigurationData();
    Dialog.Alert ("data");
    onClose();
    Return super.navigationClick (status, time);
    }
    };
    Add (chkMostPopular);
    Add (chkNewlyAdded);
    Add (chkNews);
    Add (chkColumns);
    Add (chkJobs);
    Add (chkEvents);
    Add (chkInterview);
    Add (chkIndepth);
    Add (saveFields);
    }
    catch (System.Exception e)
    {
    System.out.println ("# error Settings()" + e.getMessage ());
    }
    }
     
    Private Sub persistConfigurationData()
    {
    Configuration config = new Configuration();
    config.setElement (most popular, new Boolean (chkMostPopular.getChecked ()));
    config.setElement (newlyadded, new Boolean (chkNewlyAdded.getChecked ()));
    config.setElement (news, new Boolean (chkNews.getChecked ()));
    config.setElement (columns, new Boolean (chkColumns.getChecked ()));
    config.setElement (jobs, new Boolean (chkJobs.getChecked ()));
    config.setElement (events, new Boolean (chkEvents.getChecked ()));
    config.setElement (interview, new Boolean (chkInterview.getChecked ()));
    config.setElement (indepth network, new Boolean (chkIndepth.getChecked ()));
    System.out.println ("will persist object");
    StoreConfiguration.setConfiguration (config);
    }
    }

    # third class which is a persistence class

    Configuration/public class implements Persistable
    {
    private static Hashtable _config;
    Configuration() public
    {
    _config = new Hashtable();
    }
     
    public Object getElement (String key)
    {
    Return _config.get (key);
    }
    ' Public Sub setElement (key of type string, Boolean)
    {
    _config.put (key, new Boolean (value));
    }
     
    ' Public Sub setElement (key of type string, Boolean)
    {
    _config.put (Key, value);
    }
     
    public Hashtable getConfiguration()
    {
    return _config;
    }
     
    public boolean isEmpty()
    {
    Return _config.isEmpty ();
    }
    }

    I use the BB 8300 Simulator.  Once this error is thrown in this program, the example program that was carried out with success, also stopped running. I tried changing the 'key' to store the data in the following line of code.

    PersistentStore.getPersistentObject (0xdec6a67096f833cL);

    Using bb 8300 with eclipse Simulator.

    Please help me solve this problem.

    Thank you

    Kind regards

    Amber

    Not sure where your problem is, but there are some things that I am not comfortbable with your current code.  This is a replacement code.  You can give it a try?

    The major changes are:

    (a) in the settings, we do not create a new object of Configuration, we update the existing object.  Also note that StoreConfiguration.getConfiguration (); should never return null.

    (b) in StoreConfiguration, I tidied up to account for what was happening in fact of suite and there is never a single _data object (Configuration)

    (c) in the Configuration, the hash table is more static.

    Apart from a bit of as, these changes reflect the fact that static may not be a singleton.  If you are referring to the Configuration of two different processes (a background app started at the beginning of time and a leading user interface component started with an alternative entry), you won't see the same object simply by using a static.

    Sorry, none of the code has been compiled, but I hope you understand intentions.

    Parameters

    package com.persistence;
    
    import net.rim.device.api.ui.component.ButtonField;
    import net.rim.device.api.ui.component.CheckboxField;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.ui.container.MainScreen;
    
    public class Settings extends MainScreen
    {
    
        public static String mostPopular = "mostpopular";
        public static String newlyadded = "newlyadded";
        public static String news = "news";
    
        CheckboxField chkMostPopular;
        CheckboxField chkNewlyAdded;
        CheckboxField chkNews;
    
        Configuration config
    
        ButtonField saveFields;
    
        public Settings()
        {
            try
            {
                config = StoreConfiguration.getConfiguration();
                chkMostPopular = new CheckboxField("Most Popular", ((Boolean)config.getElement(mostPopular)).booleanValue());
                chkNewlyAdded = new CheckboxField("Newly Added", ((Boolean)config.getElement(newlyadded)).booleanValue());
                chkNews = new CheckboxField("News", ((Boolean)config.getElement(news)).booleanValue());
    
                saveFields = new ButtonField("Save")
                {
                    protected boolean navigationClick(int status, int time)
                    {
                        persistConfigurationData();
                        Dialog.alert("Data saved");
                        //onClose();
                        return super.navigationClick(status, time);
                    }
                };
                add(chkMostPopular);
                add(chkNewlyAdded);
                add(chkNews);
                add(saveFields);
            }
            catch (Exception e)
            {
                System.out.println("##### Error occurred Settings() "+e.getMessage());
            }
        }
    
        private void persistConfigurationData()
        {
            config.setElement(mostPopular,new Boolean(chkMostPopular.getChecked()));
            config.setElement(newlyadded,new Boolean(chkNewlyAdded.getChecked()));
            config.setElement(news,new Boolean(chkNews.getChecked()));
            System.out.println("Going to persist object");
            StoreConfiguration.storeConfiguration();
        }
    }
    

    StoreConfiguration

    package com.persistence;
    
    import net.rim.device.api.system.PersistentObject;
    import net.rim.device.api.system.PersistentStore;
    
    public class StoreConfiguration
    {
        private static PersistentObject store;
        private static Configuration _data;
    
        private StoreConfiguration()
        {
    
        }
    
        static
        {
            store = PersistentStore.getPersistentObject(0xe63e08aacd575338L);
    
            Object storedObject  = store.getContents();
            if ( storedObject instanceof Configuration ) {
                // we have what we want - cast it
                _data = (Configuration) storedObject ;
            } else {
                _data = new Configuration();
                StoreConfiguration.setConfiguration(_data);
            }
    
        }
    
        public static Configuration getConfiguration()
        {
            return _data;
    
        }
    
        public static void storeConfiguration()
        {
            System.out.println("setConfiguration  ## Going to persist object");
            synchronized (store)
            {
                System.out.println("setConfiguration  ## _data "+((Boolean)_data.getElement("mostpopular")).booleanValue());
                store.setContents(_data);
                store.commit();
            }
        }
    }
    

    Configuration:

    package com.persistence;
    
    import java.util.Hashtable;
    
    import net.rim.device.api.util.Persistable;
    
    public class Configuration implements Persistable
    {
        private Hashtable _config;
        public Configuration()
        {
            _config = new Hashtable();
        }
    
        public Object getElement(String key)
        {
            return _config.get(key);
        }
        public void setElement(String key, boolean value)
        {
            _config.put(key, new Boolean(value));
        }
    
        public void setElement(String key, Boolean value)
        {
            _config.put(key,value);
        }
    
        public Hashtable getConfiguration()
        {
            return _config;
        }
    
        public boolean isEmpty()
        {
            return _config.isEmpty();
        }
    }
    
  • BlackBerry smartphones eception exception java.lang.error with the Installation of "MemoLock".

    I received the error of doom when I tried to install Memolock of Blackberry Apps. I have OS 5.0 and I uninstalled, cleaned and reinstalled with the same problem. I have also made sure all permissions are "allowed". What now?

    Thanks Jim! Your direct download worked like you assumed and I'm now able to enjoy an excellent product! Thanks again!

  • Eception exception: java.lang.Error when starting a selfwritten application

    Hello

    I have a self written request. When I run the app on the Simulator, it throws the error above. The error takes place before any breakpoint is reached. If debugging is really hard. I put a breakpoint on ' > ', but it is never reached.

    public static void main(String[] args) {
    
        Program program;
        try {
    >>>>        program = Program.instance();
            program.run(args);
        } catch (Throwable e) {
            final String msg = _resources.getString(ERROR_COULD_NOT_START_APPLICATION) + ": " + e.getMessage();
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                public void run() {
                    Dialog.alert(msg);
                }
            });
            return;
        }
        ...
    }
    

    Any help is appreciated.

    The problem is very simple. I used a clean class of parameters that can be Persistable. I give to uncomment the ' implements Persistable ".

  • Eception exception java.lang.error blackBerry smartphones

    That's what I get when I explore the podcasts on my 9780. There was an update I installed this morning, but since I've never used the podcasts before that I don't know if it affected anything. Suggestions

    Hi Kel,

    Try reinstalling the Podcasts application by going to www.blackberry.com/podcasts on your browser in the device.

    Make sure you restart after installation and test again.

    See you soon,.

  • error trying to create PDF via Distiller indd files

    %% [Error: undefined;] OffendingCommand: Ioo fa½1icþt· DOCUMENT p] %.

    %% [Flushing: rest of job (end of file) will be ignored] %%.

    %% [Warning: PostScript error.] No PDF file produced. ] %%

    How to fix a undefined error?

    It looks like what you were doing was trying to run distill directly on a document .indd InDesign file. Who will absolutely not work. Distiller processes only the PostScript (.ps) and Encapsulated PostScript (.eps) files.

    The appropriate method of creating a PDF file from an InDesign document (no matter whether someone else can advise you) is to open the InDesign (.indd file) document in InDesign, and then use the function export, Save as PDF (print), by specifying the name of the destination file (and directory) as well as the appropriate options (generally PDF/X-4 parameters or printing of high quality performance best results for most of the cases).

    -Dov

Maybe you are looking for