• Post Reply 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

parsing problem , in JBoss

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
am using Jboss 4.0.2 and trying to use crimson parser..
when i parse a file and display the document itself , this 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)
obj.newInstance();
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..

--------------------

hari
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you explain what it is you are trying to achieve? There doesn't seem to be much wrong with the first approach...
 
Hari Sundharesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the first case it parses the file and i get the document, but when i display the document, the message i get is #document :: null
the same document when converted to string and displayed works alright//


second case, when i explicitly define obj as crimson parser then the document is displayed alright..

i hav to display the document itself and incorparating changes as the second case, i hav to change a lot :roll:
 
reply
    Bookmark Topic Watch Topic
  • New Topic