09-20-2012 12:29 PM
I have build and preverified the bccore and bcpkix Bouncy Castle libraries and have included them in a BlackBerry project in Eclipse using the 7.1.0 BlackBerry SDK plugin.
When attempting to instantiate the CMSSignedData class I am seeing a NoClassDefFoundError exception being thrown. The exception returns nothing from getMessage() and printStackTrace() just shows "no stack trace".
Solved! Go to Solution.
09-20-2012 01:10 PM
Make sure you have followed all of the steps here. It looks like you may have missed step 3.
09-20-2012 01:42 PM - edited 09-20-2012 01:45 PM
After building the 2 Bouncy Castle libraries as BlackBerry Library projects, then including the jars from their respective "deliverables/standard/7.1.0" directories I get a "A project can only export one midlet jar" error in the application project that uses them.
To avoid this error in the past, I have compiled the library projects against the RIM net_rim_api.jar with the target and source parameters set to 1.2 and 1.3, then run jar on the results followed by preverify.
Note: I am using Eclipse with the BB 7.1.0 plugin rather than the BB SDK as a whole.
Note also: The 2 library jars are definitely included in the build output of the BB application, this is not a simple case of the library classes not being present. Mot of the BC library calls work fine, it is just this one (CMSSignedData) so far that has caused a problem.
09-20-2012 02:09 PM
I have simplified the issue and removed the possibility of this being a library related problem.
I have now recompiled my test application with no libraries included and instead added the Bouncy Castle source code to the application. The NoClassDefFoundError still occurs when the application is run in the BlackBerry simulator or directly on a phone.
I am using the cldc sources from the Bouncy Castle 1.47 release. The only change I have made is to refactor the code to rename the 4 java.* packages which are not allowed in BB deployments.
09-24-2012 03:45 AM
The problem is now solved. There is an issue with using the Bouncy Castle code (even with it included directly as source code in my test application) when built against the BB 7.1.0 JDE. Rebuilding the project against the BB 7.0.0 JDE fixes the problem.