Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Highlighted
New Developer
Posts: 6
Registered: ‎05-28-2009
My Device: Not Specified
Accepted Solution

Signed .code still generates unsigned error on device

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.

 

 signature tool

 

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

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Signed .code still generates unsigned error on device

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 ?

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Signed .code still generates unsigned error on device

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 ...

 

New Developer
Posts: 14
Registered: ‎08-18-2008
My Device: Not Specified

Re: Signed .code still generates unsigned error on device

Additionally, if code signing fails part way through (some .cod signed and some not) and you request signatures again, even though it is identified as success by the code signing tool, they are invalid when you try to install on the device and you will need to rebuild and resign.
New Developer
Posts: 6
Registered: ‎05-28-2009
My Device: Not Specified

Re: Signed .code still generates unsigned error on device

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

 

New Developer
Posts: 6
Registered: ‎05-28-2009
My Device: Not Specified

Re: Signed .code still generates unsigned error on device

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

New Developer
Posts: 6
Registered: ‎05-28-2009
My Device: Not Specified

Re: Signed .code still generates unsigned error on device

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

Developer
Posts: 132
Registered: ‎02-11-2009
My Device: Not Specified

Re: Signed .code still generates unsigned error on device

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.

New Developer
Posts: 6
Registered: ‎05-28-2009
My Device: Not Specified

Re: Signed .code still generates unsigned error on device

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

Developer
Posts: 132
Registered: ‎02-11-2009
My Device: Not Specified

Re: Signed .code still generates unsigned error on device

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.