You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Simon Kitching <si...@ecnetwork.co.nz> on 2002/05/13 00:48:31 UTC

digester needs SAXParser.getXMLReader

I have been using digester with java1.4 quite happily.
I now need to deploy the app on java1.3; I expected to have to place a
suitable xml parser implementation in the classpath.
 
However, it appears that Digester needs the following method:
   javax.xml.parsers.SAXParser.getXMLReader
This is not provided by either Xerces 2.0.1 OR crimson 1.1.3 (I get
NoSuchMethod and javap on the class doesn't show it).
 
The java 1.4 docs indicate that this method should exist; there is no
"since version x" note on this method,
so I have no idea if it is a "new" method or not.
 
Any suggestions how I can use Digester on java 1.3?
 
Thanks,
 
Simon

RE: digester needs SAXParser.getXMLReader

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
Aha!

I took a look at Tomcat4, and saw it uses Xerces-J 1.4.x.
So I downloaded that and took a look at javax.xml.parsers.SAXParsers in
the xerces.jar
file in that distribution - and bingo, it has the getXMLReader() method.

So this looks to me like a bug (missing method required by JAXP1.1) in
crimson 1.1.3, 
AND Xerces-J 2.0.1. But whatever version of Crimson is bundled with java
1.4 DOES have 
the method. Odd.

Anyway, I will take this up on the xerces mail list.

Users of Digester, though, might want to note that Crimson 1.1.3 and
Xerces 2.0.1 don't
work with it (through no fault of the Digester code).

I have also noted bugzilla#4591, marked resolved by Craig McClanahan
2002-01-27
  "fixed: there is now a new getXMLReader method..."
Unfortunately, using this new method has caused incompatibility with
certain
xml parsers. Still the parsers' fault though, if they claim JAXP1.1
compatibility 
& don't provide all the methods :-(

Cheers,

Simon


-----Original Message-----
From: Simon Kitching [mailto:simon@ecnetwork.co.nz] 
Sent: Tuesday, May 14, 2002 11:05 AM
To: 'Jakarta Commons Developers List'
Subject: RE: digester needs SAXParser.getXMLReader 


Robert, thanks for taking the time to reply. 

Unfortunately, it looks like crimson/apache already have the JAXP api
bundled with them. There are certainly lots of javax.xml.* classes in
the jar files. The url <http://xml.apache.org/~edwingo/jaxp-faq.html>
also contains this statement: In JAXP RI 1.1.3, which includes the
Apache Crimson 1.1.3 parser, both API and implementation classes are
contained in the same jar files: crimson.jar for the parser and
xalan.jar for the XSLT processor.


I should have been more specific in my original email; in particular I
should have said:
* Digester needs method javax.xml.parsers.SAXParser.getXMLReader().
* crimson 1.1.3 provides an implementation of class
javax.xml.parsers.SAXParser; this
  implementation has most of the methods that JAXP 1.1 docs say it
should have - 
  _except_ for the getXMLReader() method.
* xerces-J 2.0.1 has the same issue. The parser now comes in two jars,
one "xercesImpl.jar"
  that provides the actual parser, and one "xmlParserAPIs.jar" that
presumably provides 
  wrappers to map standard apis to the implementation. The
xercesImpl.jar, like crimson 1.1.3,
  provides a javax.xml.parsers.SAXParser class, and this is also without
the getXMLReader()
  method.

Reading the javadoc for javax.xml.parsers.SAXParser more carefully, I
see:

<begin extract from javadoc>
public abstract class SAXParser
extends java.lang.Object

Defines the API that wraps an XMLReader implementation class. In JAXP
1.0, this class wrapped the Parser interface, however this interface was
replaced by the XMLReader. 
<end extract from javadoc>

This implies that the getXMLReader() method was introduced in JAXP1.1
(the method doesn't say but I presume it was introduced when the
underlying class became an XMLReader).

Xerces 2.0.1 claims to implement JAXP1.1, as does Crimson 1.1.3.
Therefore, surely, they should have the getXMLReader() method..but they
don't. And surely I don't need an additional library, otherwise there
would be two implementations of the javax.xml.parsers.SAXParser class...

On the other hand, there must surely be people using digester on java
1.3. As digester is part of Tomcat4, and it works, maybe I need to look
at what xml lib Tomcat 4 bundles?

Still puzzled; anyone got any ideas?

Simon

-----Original Message-----
From: robert burrell donkin [mailto:robertdonkin@mac.com] 
Sent: Tuesday, May 14, 2002 4:38 AM
To: Jakarta Commons Developers List
Subject: Re: digester needs SAXParser.getXMLReader 


hi simon

i think that this is a SAX/JAXP setup problem rather than a digester 
problem.

you need JAXP in your classpath. this is included with java 1.4 but not
in 
previous jdk's.

i think that if you want to use crimson you need to include jaxp.jar 
(available from sun, i think). if you are using xerces then i think that

you'll need to download a xml-api.jar compatible with the xerces version

from xml.apache.org. full details on how to set up JAXP can be found in 
the documentation for the parser of your choice.

- robert

On Sunday, May 12, 2002, at 11:48 PM, Simon Kitching wrote:

> I have been using digester with java1.4 quite happily.
> I now need to deploy the app on java1.3; I expected to have to place a

> suitable xml parser implementation in the classpath.
>
> However, it appears that Digester needs the following method:
>    javax.xml.parsers.SAXParser.getXMLReader
> This is not provided by either Xerces 2.0.1 OR crimson 1.1.3 (I get
> NoSuchMethod and javap on the class doesn't show it).
>
> The java 1.4 docs indicate that this method should exist; there is no
> "since version x" note on this method, so I have no idea if it is a 
> "new" method or not.
>
> Any suggestions how I can use Digester on java 1.3?
>
> Thanks,
>
> Simon


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: digester needs SAXParser.getXMLReader

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
Robert, thanks for taking the time to reply. 

Unfortunately, it looks like crimson/apache already have the JAXP
api bundled with them. There are certainly lots of javax.xml.* classes
in the jar files.
The url <http://xml.apache.org/~edwingo/jaxp-faq.html> also contains
this statement:
In JAXP RI 1.1.3, which includes the Apache Crimson 1.1.3 parser, both
API and implementation classes are contained in the same jar files:
crimson.jar for the parser and xalan.jar for the XSLT processor.


I should have been more specific in my original email; in particular I
should have said:
* Digester needs method javax.xml.parsers.SAXParser.getXMLReader().
* crimson 1.1.3 provides an implementation of class
javax.xml.parsers.SAXParser; this
  implementation has most of the methods that JAXP 1.1 docs say it
should have - 
  _except_ for the getXMLReader() method.
* xerces-J 2.0.1 has the same issue. The parser now comes in two jars,
one "xercesImpl.jar"
  that provides the actual parser, and one "xmlParserAPIs.jar" that
presumably provides 
  wrappers to map standard apis to the implementation. The
xercesImpl.jar, like crimson 1.1.3,
  provides a javax.xml.parsers.SAXParser class, and this is also without
the getXMLReader()
  method.

Reading the javadoc for javax.xml.parsers.SAXParser more carefully, I
see:

<begin extract from javadoc>
public abstract class SAXParser
extends java.lang.Object

Defines the API that wraps an XMLReader implementation class. In JAXP
1.0, this class wrapped the Parser interface, however this interface was
replaced by the XMLReader. 
<end extract from javadoc>

This implies that the getXMLReader() method was introduced in JAXP1.1
(the method doesn't say but I
presume it was introduced when the underlying class became an
XMLReader).

Xerces 2.0.1 claims to implement JAXP1.1, as does Crimson 1.1.3.
Therefore, surely, they should have the getXMLReader() method..but they
don't. And surely I don't need an additional library, otherwise there
would be two implementations of the javax.xml.parsers.SAXParser class...

On the other hand, there must surely be people using digester on java
1.3. As digester is part of Tomcat4,
and it works, maybe I need to look at what xml lib Tomcat 4 bundles?

Still puzzled; anyone got any ideas?

Simon

-----Original Message-----
From: robert burrell donkin [mailto:robertdonkin@mac.com] 
Sent: Tuesday, May 14, 2002 4:38 AM
To: Jakarta Commons Developers List
Subject: Re: digester needs SAXParser.getXMLReader 


hi simon

i think that this is a SAX/JAXP setup problem rather than a digester 
problem.

you need JAXP in your classpath. this is included with java 1.4 but not
in 
previous jdk's.

i think that if you want to use crimson you need to include jaxp.jar 
(available from sun, i think). if you are using xerces then i think that

you'll need to download a xml-api.jar compatible with the xerces version

from xml.apache.org. full details on how to set up JAXP can be found in 
the documentation for the parser of your choice.

- robert

On Sunday, May 12, 2002, at 11:48 PM, Simon Kitching wrote:

> I have been using digester with java1.4 quite happily.
> I now need to deploy the app on java1.3; I expected to have to place a

> suitable xml parser implementation in the classpath.
>
> However, it appears that Digester needs the following method:
>    javax.xml.parsers.SAXParser.getXMLReader
> This is not provided by either Xerces 2.0.1 OR crimson 1.1.3 (I get 
> NoSuchMethod and javap on the class doesn't show it).
>
> The java 1.4 docs indicate that this method should exist; there is no 
> "since version x" note on this method, so I have no idea if it is a 
> "new" method or not.
>
> Any suggestions how I can use Digester on java 1.3?
>
> Thanks,
>
> Simon


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: digester needs SAXParser.getXMLReader

Posted by robert burrell donkin <ro...@mac.com>.
hi simon

i think that this is a SAX/JAXP setup problem rather than a digester 
problem.

you need JAXP in your classpath. this is included with java 1.4 but not in 
previous jdk's.

i think that if you want to use crimson you need to include jaxp.jar 
(available from sun, i think). if you are using xerces then i think that 
you'll need to download a xml-api.jar compatible with the xerces version 
from xml.apache.org. full details on how to set up JAXP can be found in 
the documentation for the parser of your choice.

- robert

On Sunday, May 12, 2002, at 11:48 PM, Simon Kitching wrote:

> I have been using digester with java1.4 quite happily.
> I now need to deploy the app on java1.3; I expected to have to place a
> suitable xml parser implementation in the classpath.
>
> However, it appears that Digester needs the following method:
>    javax.xml.parsers.SAXParser.getXMLReader
> This is not provided by either Xerces 2.0.1 OR crimson 1.1.3 (I get
> NoSuchMethod and javap on the class doesn't show it).
>
> The java 1.4 docs indicate that this method should exist; there is no
> "since version x" note on this method,
> so I have no idea if it is a "new" method or not.
>
> Any suggestions how I can use Digester on java 1.3?
>
> Thanks,
>
> Simon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: digester needs SAXParser.getXMLReader

Posted by Simon Kitching <si...@ecnetwork.co.nz>.
Hi,

Re previous email, I should have probably also included the following
info:

digester version: 1.2
I am also using xmlrules part of digester.

Error message (when trying crimson 1.1.3)
-----------------------------------------

running with classpath
[.:javalib/commons-beanutils.jar:javalib/commons-collections.jar:javalib
/commons-digester.jar:javalib/commons-logging.jar:javalib/crimson.jar:ja
valib/ecnutils.jar:javalib/log4j.jar:monitor.jar]

Exception in thread "main" java.lang.NoSuchMethodError:
javax.xml.parsers.SAXParser: method getXMLReader()Lorg/xml/sax/X
MLReader; not found
        at
org.apache.commons.digester.Digester.getXMLReader(Digester.java:607)
        at
org.apache.commons.digester.Digester.parse(Digester.java:1302)
        at
org.apache.commons.digester.xmlrules.FromXmlRuleSet.addRuleInstances(Fro
mXmlRuleSet.java:137)
        at
org.apache.commons.digester.Digester.addRuleSet(Digester.java:1396)
        at nz.co.ecn.postlink.heartbeat.Monitor.config(Monitor.java:164)
        at nz.co.ecn.postlink.heartbeat.Monitor.run(Monitor.java:316)
        at nz.co.ecn.postlink.heartbeat.Monitor.main(Monitor.java:413)

Thanks in advance...

Simon

-----Original Message-----
From: Simon Kitching [mailto:simon@ecnetwork.co.nz] 
Sent: Monday, May 13, 2002 10:49 AM
To: commons-dev@jakarta.apache.org
Subject: digester needs SAXParser.getXMLReader 


I have been using digester with java1.4 quite happily.
I now need to deploy the app on java1.3; I expected to have to place a
suitable xml parser implementation in the classpath.
 
However, it appears that Digester needs the following method:
   javax.xml.parsers.SAXParser.getXMLReader
This is not provided by either Xerces 2.0.1 OR crimson 1.1.3 (I get
NoSuchMethod and javap on the class doesn't show it).
 
The java 1.4 docs indicate that this method should exist; there is no
"since version x" note on this method, so I have no idea if it is a
"new" method or not.
 
Any suggestions how I can use Digester on java 1.3?
 
Thanks,
 
Simon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>