05-28-2009 09:22 AM
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 22.214.171.124
* 8100-Vodafone-4.5..055 simulator (uk)
* UK Vodafone 8100 device running v126.96.36.199 (platform 188.8.131.52)
* java ver 1.6.0_13
* import statements as follows:
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,
Solved! Go to Solution.
05-28-2009 09:55 AM
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:
05-28-2009 11:05 AM
05-28-2009 11:12 AM
There is one folder, with the following files:
05-28-2009 11:25 AM
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"
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:
If you don't have a domain you can use your name. Not exactly unique, but probably close enough for a phone app:
05-28-2009 12:08 PM
That did it!
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?
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...
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.