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
New Developer
Posts: 8
Registered: ‎09-17-2008
My Device: Not Specified

DocumentBuilder a signed Library?

[ Edited ]

Hi there! Here's my problem. I made an application that reads an XML file and parses it using a Document Builder. Here's a snippet:

 

DocumentBuilder _builder;
Document _doc;
InputStream _input;
FileConnection _fc;
String _path = "file:///SDCard/BlackBerry/MyFile.xml";

try{
_fc = (FileConnection)Connector.open(_path,Connector.READ_WRITE);

// If no exception is thrown, then the URI is valid, but the file may or may not exist.
if (!_fc.exists())
_fc.create(); // Create the file if it doesn't exist.

_builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
_input = _fc.openInputStream();
_doc = _builder.parse( _input );
}catch(IOException e){
System.out.println(e.getMessage());
}catch(ParserConfigurationException e){
System.out.println(e.getMessage());
}

 

When I run it on my simulator it works ok, but when I run it on a Blackberry an error appears saying: "Error starting <app>: Module <app> must be signed with the RIM Runtime Code Signing Key (RRT)". When the DocumentBuilderFactory and the DocumentBuilder are commented, the application works fine on a Blackberry. So I checked on the API but it doesn't say that those Libraries are signed. Anybody knows how I can fix this?

 

Message Edited by calo_11 on 10-02-2008 01:47 PM
Message Edited by calo_11 on 10-02-2008 01:49 PM
BlackBerry Development Advisor
Posts: 15,300
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: DocumentBuilder a signed Library?

What BlackBerry model and handheld software version are you testing with?  This can be found under Options, About on the BlackBerry. 

 

Have you created an auto start application?  Auto start applications do require signing.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Highlighted
New Developer
Posts: 8
Registered: ‎09-17-2008
My Device: Not Specified

Re: DocumentBuilder a signed Library?

This is what the Blackberry says:

 Blackberry 8700

Wireless Handheld (EDGE)

v4.2.1.108 (Platform 2.3.0.86)

 

I dont know what an auto start application is, but I don't think i'm doing one. I just have an UiApplication that pushes a Screen that does all the things I said before.
BlackBerry Development Advisor
Posts: 15,300
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: DocumentBuilder a signed Library?

There is no work around for signing requirements.  The BlackBerry Simulator by default does not enforce signing to allow for easier testing and debugging.  Signature keys can be ordered here: 

 

http://na.blackberry.com/eng/developers/downloads/api.jsp

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Developer
Posts: 1
Registered: ‎04-16-2009
My Device: Not Specified

Re: DocumentBuilder a signed Library?

I have the same experience, where my application requires a key to run on a live device (in this case, a BlackBerry 8130 v4.3.0.71 platform 3.1.0.37) when I use the DocumentBuilderFactory, but it does not when this usage is removed.

 

This behavior is completely undocumented and difficult to discover.  The javadoc does not say that any of the classes in the net.rim.device.api.xml.parsers package require signing.  Further, the jde compiles code using this package without complaint, even if none of the restricted APIs are allowed. Also, the code thus compiled runs just fine on a simulator.  Only when deploying to a live Blackberry does this behavior show up.

 

I like to think that restricting the use of the package is an error that will be fixed in future versions.