You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Benjamin Jones <be...@integretechpub.com> on 2004/03/31 00:25:39 UTC

Continuing problems calling CreateXMLReader( )

When I try to make an XML Reader using 
XMLReaderFactory.CreateXMLReader(vendorClass), I have the following very 
specialized problem.

(a.) The vendorClass (in this case "org.xml.xerces.parsers.SAXParser") 
can (repeat, can as in yes it can) be instantiated,

BUT

(b.) I get a ClassNotFoundException on the line (line 10, below) where 
CreateXMLReader is invoked. 

What am I missing here?  One gracious answer from the ground (thanks 
purushotham!) suggests to make a single zip file, instead of several 
archives.  No change in the behavior ensues.

Here is the part of the called method that is blowing the ClassNotFound 
Exception on line 10, followed by the <applet> tag, followed by the 
exception text.  Note that I do not get a ClassNotFound Exception before 
line 10.


1  public String xpath(String xml, String xpath) {
2        String result = "";
3       SAXSource xmlsrc=new SAXSource(new InputSource(new 
StringReader(xml)));
4        XMLReader newRead = null;
5        org.apache.xerces.parsers.SAXParser Monkey=new
6                             org.apache.xerces.parsers.SAXParser();
7        System.out.println(Monkey.getClass());
8        try{
9            newRead=
10              
XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
11        }
12        catch (Exception e){
13            e.printStackTrace(System.err);
14           return (null);
15       }
        

=========================   HTML applet tag =========================

<applet id="thang" codebase="." code="ben.applet.xml.xpathApplet" 
archive="classes.jar,saxon7.jar,xercesImpl.jar" HEIGHT="50" 
WIDTH="100"></applet>


========================  Exception String ============================
Clear classloader cache ... completed.

class org.apache.xerces.parsers.SAXParser

java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

    at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)

    at ben.applet.xml.xpathApplet.xpath(Unknown Source)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org