• 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

JAXP and Applet Problem

 
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have applet which uses jaxp-dom for processing XML on client side. For that I have imported the classes like..
import org.w3c.dom.* ;
import javax.xml.parsers.* ;
in my applet.I have jaxp.jar and crimson.jar in classpath of my system. MY JDK version is 1.3.1.
While compiling the applet,it compiled fine.
But when I open the HTMl having my applet, it gives following error in the java plug-in console.
ClassDefFoundError: javax/xml/parsers/DocumentBuilderFactory

Is it because JAXP classes are compiled in 1.4 later version and my plug-in is 1.3.1 ??
Thanks for the time.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where is the applet supposed to be finding the XML parser classes? The XML classes are not yet part of the standard Java applet plug-in.
If you end up having the applet download the parser classes from the server, that can be slow. Consider having the applet use a more compact parser. There is a nice one at:
http://kxml.enhydra.org/
Bill
 
L Goundalkar
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So is it the version compatibility problem. ??
Thanks
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not exactly - it is just that if you want your applet to do XML parsing you will have to supply the parser too, it is not part of the JVM in the browser.
The JAXP should work just fine in 1.3 Java.
Bill
 
L Goundalkar
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If that is case, then why I am getting this particular error while running the applet in a machine which has 1.3.1 JRE. !! ??
Can you please explain what exactly happens when I use XML parser in the applet and open a xml file which is in the server.
A article link is also fine.
Thanks for the time.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe I misunderstood - the browser is on a system that has JDK 1.3 and has JAXP installed where the browser can get it? The current JAXP should work with 1.3 or 1.4 JDK.
As far as an XML parser is concerned, any InputStream of characters will do - it doesn't care if they are being read from a server.
Bill
 
L Goundalkar
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok.
Let me finalise the short discussion with this last question.
1.I dont have JAXP installed on the system where I am opening the page with applet. It has JRE 1.3.1 installed. So why is it giving error.?
2. If I have JDK or JRE 1.4.x installed on the client system and I need to run my applet in a older version, Can I force it through <plugin> tag?
Thanks a lot.
 
reply
    Bookmark Topic Watch Topic
  • New Topic