Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

parsing problem in JBoss

Posts: 13
  • Mark post as helpful
  • send pies
  • Report post to moderator
when i parse a file and display the document itself , ithis is the prob i got
when i use this :

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(fileName_);
System.out.println(factory+" TESTING DOC::::" + document);

i get this output : TESTING DOC:::: #document :: null

when i explicitly specify the parser like this it works:

Class obj = Class.forName(
"org.apache.crimson.jaxp.DocumentBuilderFactoryImpl" );
DocumentBuilderFactory factory = (DocumentBuilderFactory)
DocumentBuilder builder = factory.newDocumentBuilder();
System.out.println("Parsing File:" +fileName_);
document = builder.parse(fileName_);
System.out.println(obj+" || " +factory+" TESTING DOC::::" + document);

any way i can correct it so the first one works? or i have to change a
lot in my app..
this wud be of grt help..
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't crosspost. It makes discussions harder to follow and is unlikely to get you a quicker response.

Since this isn't a JBoss question, please continue any discussions in the XML and Related Technologies forum.
[ December 13, 2005: Message edited by: Paul Sturrock ]
If you're gonna buy things, buy this thing and I get a fat kickback:
Java file APIs (DOC, XLS, PDF, and many more)
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!