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
Developer
sunil_garlapati
Posts: 69
Registered: ‎08-25-2008
My Device: Not Specified
Accepted Solution

Getting errors when using xml parsers in my client application.

Hi,

 

I am using JDE 4.5.0, Jdk 1.6.  In my application i need to read data from xml so i Used the below packages

 

import java.io.File;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

 

But while compiling it is showing

 

cannot resolve symbol
symbol  : class DocumentBuilderFactory
location: package parsers
import javax.xml.parsers.DocumentBuilderFactory;

 

cannot resolve symbol
symbol  : class File
location: package io
import java.io.File; ...............

 

Same type of java file which is using same packages is properly compile from other IDE (Editplus). why it is showing this compile time errors.  I gone through the sun forums they mentioned that "XML support is build into JVM 1.4 and newer. No need for additional JARs".  How i will fix this compile time errors.

 

Please give your suggestion, advanced thanks for the same.


Regards,

Sunil.G

BlackBerry Development Advisor
MSohm
Posts: 14,757
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Getting errors when using xml parsers in my client application.

java.io.File does not exist in the BlackBerry API set.  Please see the JavaDocs included with the BlackBerry JDE for a list of APIs in the BlackBerry API set.
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
Developer
sunil_garlapati
Posts: 69
Registered: ‎08-25-2008
My Device: Not Specified

Re: Getting errors when using xml parsers in my client application.

Thanks for your reply MSohm.

 

In my class used below classes so got that errors.

 

import javax.xml.parsers.DocumentBuilder;

import javax.xml.parsers.DocumentBuilderFactory;

 

now instead of these i used

 

import net.rim.device.api.xml.parsers.DocumentBuilder;
import net.rim.device.api.xml.parsers.DocumentBuilderFactory;

 

for Reading file i am using (instead of java.io.File)

 

InputStream inputStream = getClass().getResourceAsStream( _xmlFileName );
Document doc = db.parse( inputStream );