02-18-2011 03:25 AM
I have a problem with the meta data of my application. My application consists of two libraries and a main application. In Eclipse I have three BlackBerry projects. In the main application the libraries are added to the java build path as "Required projects". That works great! If I package the main application the libraries are automatically builded and added to the generated .alx file (as nested applications).
My problem: I use a BlackBerry Enterprise Server (BES) to automatically deploy our application.
1. The application could not be uploaded because the libraries depended on the main application. I fixed this according to another entry here (which stated that BES has problems with nested application - can't find it again), by removing the inner application tags and add the filenames directly to the files section of the main application.
So I am able to deploy our application through a software configuration. It is also very clean, because you just have a single item in the BlackBerry Administration service. But...
2. If I upload another version of our application (say 1.1 after 1.0) and add both to the software configuration the BES tries to install the new version and remove the old. But the installation fails. The deployment task says: Failure - Device reported that the Module Save Failed. The knowledge base says I had to look at the log files and so I did. In the Policy log I found the following lines:
RequestHandler:endApp: Sending the module \\<server>\share\Applications\<appname>-<version>\
RequestHandler::HandleAPPDDataCommand - Send Application to device failed "Device reported that the Module Save Failed".
That's no new information!
Because I thought: Mhm... maybe he has a problem because the lib is already installed with the same version... So I just have to update the components each at a time. So I created .zip files for each project I have in eclipse and meanwhile learned that adding "Specify imported .alx files" adds the 'requires' tag to the ALX, so the application depends on the libraries. I removed the old application version completely from the test device. After that I added the in eclipse generated projects one at a time to the BES. But...
3. I successfully added the two libraries as standalone applications to the BES. When adding our main application, the BES told me:
"The zip file contains information for existing applications. A version in the zip file already exists in the system. The existing application will not be updated."
So I thought: WTF!?! The ALX specification  says: "Nesting lets you require that, when a BlackBerry device application is loaded on the BlackBerry device, its prerequisite modules are also loaded on the BlackBerry device."
I thought: "Now I understand! The nested application is just a dependency, not a declaration." But the reality told me: "You Idio! Didn't you saw that eclipse also packages the .cod and .debug files inside you main application, for easy deployment?!?" Oh, yeah... The BlackBerry guys know what they do and create all required files in one place and also add it for me to the .alx file. But why, does the BES don't accept this? Now I removed the nested applications/libraries (the xml tags and the files in the 5.0.0 folder). I have now three separate .zip files containing each only one application and the dependency is done through the 'requires' tag in the main application's .alx file. I have not yet tried another update, but I hope this will work, because each application has now just one modul.
What is the correct way to declare and deploy dependencies (libraries and application) for BES software configurations? Should I use multiple isolated applications, a single application with multiple modules or is a mix possible? First I thought that the Eclipse Plugin would create good files (but it does not create a .zip file for BES upload *feature request*).
I use the Eclipse BlackBerry Java Plugin (220.127.116.11004161203-16) with the BlackBerry Java SDK (18.104.22.168).
 Elements in BlackBerry device application .alx file - http://docs.blackberry.com/en/developers/deliverab
02-24-2011 10:28 AM
Found some documentation for the error message:
"Device reported that the module save failed
The BlackBerry device identified a formatting error in the application data before or during the installation process.
You can verify that the application files are formatted properly and try to send the BlackBerry Java Application to the BlackBerry device again. If your second try at the installation is not successful, in the log files that you collected, locate the user account that experienced the issue. Trace the installation activity."
[BlackBerry Enterprise Server for Microsoft Exchange - Administration Guide, Version: 5.0 | Service Pack: 2, p. 142, Published: 2010-06-16]
This says, the files are not correctly formatted. I think this means the metadata in the .alx file!? Or are these the generated files by eclipse? From the Policy log file I can say, that the files for the correct OS version are used (5.0.0).
Because the managing of the files is left to the BES (5.0 SP2), I don't know what to do/change. Here the list of files, contained in my .zip I uploaded on the BES:
4.6.1/lib.cod, lib.cso, lib.debug, lib.jad, lib.jar, lib.rapc
5.0.0/lib.cod, lib.cso, lib.debug, lib.export.xml lib.jad, lib.jar, lib.rapc
(These files were zipped from the deliverables/Standard folder in the Eclipse project)
In the current case I just tried to update our library application, so dependencies should not be an issue. A pratical problem might be, that our application is running and therefore the handheld won't replace the files?!? Is it possible to update running applications??