Weird! I thought crimson.jar/jaxp.jar were included in rt.jar for jsk 1.4!!

I am trying a Wrox Books Example (Chapter 2 in Professional Java XML), and if I do this:

java BookMain

I get this error:

Exception in thread "main" java.lang.NullPointerException

at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)

at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)

at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)

at javax.xml.parsers.SAXParser.parse(SAXParser.java:346)

at wrox.book.BookMain.main(BookMain.java:34)

But if I do this:

java -Xbootclasspath:D:\jaxp\jaxp-1.1\crimson.jar;D:\jaxp\jaxp-1.1\jaxp.jar;D:\jdk1.4\jre\lib\rt.jar BookMain

Then it works!!!

What's up with that? Is there a later version of crimson in jaxp1.1 than jdk1.4? Is there a known bug?

[844 byte] By [6tr6tr] at [2007-9-26 2:16:19]
# 1
Yes, there are bugs. See http://xml.apache.org/crimson/ for a description. This bug is (probably) fixed in 1.1.1 which you can get at the same locaiton.
lk555 at 2007-6-29 9:14:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
how do i update the version in my rt.jar then? the rt.jar doesn't have crimson.jar in it, just all the classes (i think)
6tr6tr at 2007-6-29 9:14:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
anyone have any ideas? Anyone else get this problem?
6tr6tr at 2007-6-29 9:14:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

I found the same NullPointerException at the same place for the BookMain exercise. The solution (which took a while for me to determine) was to add a missing line in BookMain:

factory.setNameSpaceAware(true);

After that the code ran fine.

I'm surprised that the parsers die in such a case (rather than raising an exception saying they don't understand the namespace-related XML).

jwoodger at 2007-6-29 9:14:36 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...