05-28-2009 09:22 AM
Hi,
I have built an app (BabyTracker) that posts data from a rim device over http to a url. It works fine in the JDE and simulator. However I am getting an error when I run the app on my device (even though I have signed the app)...
"Error starting BabyTracker: Unsigned module "BabyTracker" may not contain classes in com.rim (except com.rim.samples), net.rim, net.blackberry, java or jav"
My development system consists of the following:
* IBM PC running XP SP2
* blackberry JDE 4.5.0.7
* 8100-Vodafone-4.5..055 simulator (uk)
* UK Vodafone 8100 device running v4.5.0.55 (platform 2.7.0.68)
* java ver 1.6.0_13
* import statements as follows:
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;
import net.rim.device.api.i18n.*;
import java.util.Date;
import java.util.Vector;
import javax.microedition.io.*;
import java.io.*;
import java.io.IOException.*;
The steps I am following are:
1. build and test app with 8100-Vodafone-4.5..055 simulator (works fine)
2. sign app by double clicking on BabyTracker.cod file, and clicking "Request". The signature tool appears as shownin the attached: sigtool.jpg.

3. attach device via usb
4. run javaloader -u load c:\data\javadev\rim\babytracker\babytracker.cod ...I input the password, and the app appears on the device
5. attempt to run the app and receive the following error: "Error starting BabyTracker: Unsigned module "BabyTracker" may not contain classes in com.rim (except com.rim.samples), net.rim, net.blackberry, java or jav"
Note: the JDE did not create a BabyTracker.csl file. In reviewing this bbs, I noted that a missing csl file was sometimes a problem. I looked at csl files that had come with JDE sample apps, and noted that they all contain one or both of the following two lines:
52424200=RIM Blackberry Apps API
52525400=RIM Runtime API
so I manually created the .csl file and added the lines. This did not resolve the problem.
Can someone please advise me as to what steps I am missing?
Thanks very much,
Ean
Solved! Go to Solution.
05-28-2009 09:55 AM
Close JDE.
Go to folder where *.jdw and *.jdp files located.
Now remove all generated files and leave only workspace (*.jdw) and project (*.jdp) files.
Compile your project again.
Now, did the compile generate all necessary cso and csl files ?
05-28-2009 09:57 AM
Also what is the structure of your project files/folders ?
Describe it here, like that:
MyProject\workspace.jdw
MyProject\project.jdp
MyProject\src\com\mycompany\MyClass1.java
MyProject\src\com\mycompany\MyClass2.java
etc ...
05-28-2009 11:05 AM
05-28-2009 11:08 AM
I did as you instructed, but left BabyTracker.java in as well, as this is where all the code is. The .csl file was not generated.
Thanks,
Ean
05-28-2009 11:12 AM
There is one folder, with the following files:
C:\data\javadev\rim\BabyTracker\BabyTracker.jdp
C:\data\javadev\rim\BabyTracker\BabyTracker.jdw
C:\data\javadev\rim\BabyTracker\BabyTracker.java
C:\data\javadev\rim\BabyTracker\BabyTracker.rapc
C:\data\javadev\rim\BabyTracker\BabyTracker.cod
C:\data\javadev\rim\BabyTracker\BabyTracker.cso
C:\data\javadev\rim\BabyTracker\BabyTracker.debug
C:\data\javadev\rim\BabyTracker\BabyTracker.jad
C:\data\javadev\rim\BabyTracker\BabyTracker.jar
Thanks,
Ean
05-28-2009 11:25 AM
Ok,
Based on this suggestion, I did the following:
* exit JDE
* delete all files except .jdp, .jdw, and .java
* reopen JDE and build (set for Release configuration)
* build project
* manually create .csl file
* double click on .cod file and requested signatures (this works fine)
* exit JDE
* run: javaloader -u erase BabyTracker
* run: javaloader -u load c:\data\javadev\rim\babytracker\babytracker.cod
...and the same error results: "Error starting BabyTracker: Unsigned module "BabyTracker" may not contain classes in com.rim (except com.rim.samples), net.rim, net.blackberry, java or jav"
Thanks,
Ean
05-28-2009 11:42 AM
The error suggests that one of your classes is defined in a system package. What does the package statement say in BabyTracker.java ?
The convention is to use your internet domain written backwards to ensure they are unique. If you own mydomain.com the statement should look something like:
package com.mydomain.babytracker;
If you don't have a domain you can use your name. Not exactly unique, but probably close enough for a phone app:
package eanhernandez.babytracker;
Cheers, Barak.
05-28-2009 12:08 PM
That did it!
Many thanks.
Questions:
1. what is a csl file for?
2. the package read as follows: package com.rim.BabyTracker; ...does this mean that my package was incorrectly specficied as a rim package?
Ean
05-28-2009 01:09 PM
At the moment, you probably don't care much about packages, what to do with them or what they mean. I'll just say that for security reasons the JAVA Virtual Machine doesn't like it when your classes are in the same package as system classes (com.rim, net.rim, java, etc.).
If you have a domain name, This is what Sun has to say about how to convert domain names to package names. Please note that by convention, package names are all lowercase (yours has some uppercase). If you don't have a domain and just wants to get the darn thing on the phone, i suggest changing the line to: "package eanhernandez.babytracker;" recompile and try again.
No idea what a csl is...
Cheers, Barak.
The reason why you're not allowed to put your classes into package com.rim.something, or package java.something, is that residing in the same package as the system classes gives your classes access to things it should not touch.