This is my first technical write-up towards BlackBerry. I’ve been working on BlackBerry application development for the last couple of months and faced a number of issues while porting the MIDP application, some of whose solutions were not easy to find out and required more effort and time than anticipated.
I had difficult time in XML parsing with BlackBerry API. Here came the great kXML parser. I downloaded the jar file.
Importing a jar file to my project in JDE at first seemed an easy task. A little bit search led to my project’s Properties -> Build and then Add to imported jar files. But this procedure failed miserably and showed –
Module ‘kxml2-2.3.0’ not found.Error starting kXmlParserTest: Module ‘kxml2-2.3.0’ not found.
Again I resorted to googling and someone at one of BlackBerry developer forums wrote that this problem occurs due to incompatible binary structure of jar file and suggested a solution for preverify the kXML jar file.
1. Go to your JDE installation folder, for Windows XP it is usually C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin
2. Copy the kXML jar file to bin folder.
3. Notice the preverify.exe file. This is the tool we’ll use.
4. Now open your command prompt and change your current directory to your JDE installation directory.
5. execute the following command:
preverify -classpath “C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\lib\net_rim_api.jar” “your_kXML_jar_filename”
6. Notice that in C:\Program Files\Research In Motion\BlackBerry JDE 4.3.0\bin directory, another folder named output has been created. Preverified jar file resides here. Copy the preverified jar file with the same name that the non-preverified jar file has.
7. Now replace the non-preverified jar file with the verified one. Remove the former from your kXmlProject and add the latter.
Then the project build was successful and this project was going to be used as a library for my other project, say kXmlParserTestProject.
I tried to build kXmlParserTestProject but project build failed. Then was the time for fixing project dependencies.
– Go to kXmlParserTestProjec’s Project Dependencies and check kXmlProject.
Now everything working fine.