• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Java API for XML - Install and run probs

 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I downloaded the XML api from sun - copying jaxp.jar, xalan.jar and crimson.jar into JAVA_HOME\jre\lib\ext as outlined at http://java.sun.com/xml/jaxp-1.1/install.html.
I tried to compile and run an example (DOMEcho.java). It compiled cleanly, but failed to run, stating:

Any ideas? Am I being particularly inept today and missing some obvious point? I'm using SDK 1.3 on Win2000.
help!
regards, Ben
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JAXP API implements the Interfaces defined by w3c which can be found at the w3 site.
You can download DOM2 Level jar file from
http://www.w3.org/DOM/DOMTM
and put them on your classpath.
And hopefully it should work..
 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for the quick reply, Mohit.
Unfortunately however, it's still not working. But I do have a new error message for a different class, which suggests what you told me has sorted something out at least. Now perhaps I'm missing some other .jar files, but where do I find them and what are they? And why don't Sun mention them on the download and install page?

cheers, Ben.
 
mohit joshi
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it is not there, it is not there..
try xml.jar from
http://www.doc.ic.ac.uk/~sjn5/xml-tr2/
which is what we are using but it looks like outdated to me
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
That is because of problem in classpath settings.U set classpath only for this jar file ie set classpath=c:\..\jaxp.jar and remove rest of the classpath files..
Hope this will work..
Regards,
Paramaguru
 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
That doesn't work I'm afraid. I don't have a classpath variable on my machine (Win 2000). Why do I need one? I have put the various xml'ing .jar files in the same directory as the core java .jar file (src.jar) and also in the jre\ext directory, which is all sun tell you to do. When I tried setting a CLASSPATH, I still get the same errors.
Can someone point me in the direction of some good documentation on installing the XML API perhaps, or offer a new plan of attack. This is confusing the hell outta me! How can this be so difficult?
cheers,
Ben
 
mohit joshi
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the W3C interfaces keep changing depending on DOM level. So it seems the DOM2 doesnt have org.xml.sax.SAXException in it.
If your JAXP ( which is developed by Sun ) still requires the class, try using xml.jar mentioned above which has this Class defined..
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree, it shouldn't be a classpath problem since it's in the lib\ext directory. Maybe you should try taking it out of the src.jar directory so there is only one reference to the file in the classpath. I'll try installing it myself (later, when I'm not so busy) and will let you know of the results.
Good luck!
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may have more than one JRE installed. This will definitely be true if you installed the plugin. Check the \Program Files\Javasoft\JRE directory. If one exists you need to place the jar files under each JRE you have installed in the <java version>\ext directory.


------------------
Jeremy Crosbie
Co-Author of Professional Java XML
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey! I got the exact same problem and I tried what jeremy crosbie said and it worked perfectly!!! Why two locations? I've never had to do this before. Is there any workaround or do I always have to deal with two directories?
 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Phew! I finally got the thing working! Thanks for all the advice, guys. Just made my first DOM using DOMEcho.java
I think the problem was (because I don't really understand the whole CLASSPATH thing due to inexperience) I was either not finding jaxp.jar, or, if I was, I was then not finding my present working directory because CLASSPATH was set to one or the other, not both. Clear? Thought not! Anyway, it works now.
I would still be interested to know why the documentation I found off the Sun XML download page told me to just drop the .jar file into \jre\ext? This seemed to work for a compile, but failed at runtime - can anyone explain why this was to me? I now have a CLASSPATH set also for finding the imports at runtime.
A further point. I wanted to use the XML API for an application I'm working on which generates technical reports in different formats (e.g. HTML, Rich Text, plain text) from an XML data file. The software needs to be used on a number of PC's with just the JRE installed. Will this be tricky as I will have to supply the additional XML classes with the app I have written? Opinions?
many thanks,
Ben.
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic