Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Trusted Contributor
Posts: 102
Registered: ‎03-01-2010
My Device: 8310
My Carrier: Ingenieur

Jdom in blackberry application

[ Edited ]



i am using JDOM to manipulate an xml file into a blackberry application :

this is the code :


Callback = new TreeCallback();
            tree=new TreeField(Callback, TreeField.FOCUSABLE);
             SAXBuilder parser = new SAXBuilder();
             org.jdom.Document doc = parser.build("data.xml");
             Element docu=doc.getRootElement();
             Element node = docu.getChild("outline");
             List entries=node.getChildren("outlineentry");
             //On crée un Iterator sur notre liste
             Iterator i = entries.iterator();
                     //On recrée l'Element courant à chaque tour de boucle afin de
                     //pouvoir utiliser les méthodes propres aux Element comme :
                     //selectionner un noeud fils, modifier du texte, etc...
                     Element courant = (Element)i.next();
                     Attribute type= courant.getAttribute("type");
                     Attribute label= courant.getAttribute("label");
                     if (type.getValue()=="none")
                         int    node1 = tree.addChildNode(0, label.getValue());
                                 while(i.hasNext() && type.getValue()=="namedelementlink")
                                     int    node2=tree.addChildNode(node1, label.getValue());


That's whay i put this loop to read just some nodes ? when i run my project i have this exception :

Error Starting :Module Jdom not found ,but i have added the JDOM.jar in the class path


in your opinion what's the problem for me????

can any oen help me ?



All Replies
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-, Z10 (STL100-3)-, Z30 (STA100-5)-, Passport (SQW100-1)-, PlayBook (16GB)-
My Carrier: Verizon

Re: Jdom in blackberry application

You added JDOM to your class path so it would compile but JDOM doesn't exist on the BlackBerry so you get the error it can't be found.


Look up how to add a 3rd party library to your BlackBerry, that should fix it.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Trusted Contributor
Posts: 102
Registered: ‎03-01-2010
My Device: 8310
My Carrier: Ingenieur

Re: Jdom in blackberry application

Thank you very much  for repling ;


Can you tell what do you mean by adding  a 3rd party library to my BlackBerry,i don't find any source to start .

can you explain to me ??


thank in advance ;

Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Jdom in blackberry application

The library jar must be compiled as a COD and added to your JAD file (for OTA download). If you are installing on the phone manually, then the library COD will also need to be loaded using javaloader.


If you search the forum for "library cod" you will find many discussions.


Here is one: