xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From il...@ca.ibm.com
Subject RE: adding xalan & xerces.jar to classpath (sequence problem)
Date Tue, 17 Dec 2002 21:18:52 GMT
Hi,

In Xalan 2.2, the xerces.jar packaged with Xalan included the JAXP code,
including javax.xml.parsers.SAXParserFactory.  (Now Xerces packages the
JAXP code in the xmlParserAPIs.jar).   Xalan packaged a superset of these
classes (we also included the TrAX interfaces) in xml-apis.jar.  However,
although we packaged an overlapping set of classes, we sometimes had
different implementations.  (We're working on using a common set of JAXP
classes that will be located in the xml-commons project.)

So, I went and had a look at the SAXParserFactory.java implementations in
xerces.jar and xml-apis.jar and they are different.  In particular, the
code which returns an instance of a SAXParserFactory is different.
SAXParserFactory.newInstance() uses an ordered lookup procedure for
identifying which SAXParserFActory to return.  If it gets to the end of the
lookup procedure and hasn't figured out what to return, it uses a fallback
mechanism, which is a hardcoded class name.  In xml-apis.jar (the version
you're working with) the hardcoded class name is null!  In xerces.jar, it
is probably org.apache.xerces.jaxp.SAXParserFactoryImpl although I don't
have the xerces source to verify.

The error message that you're seeing corresponds to the message you would
see if the SAXParserFactory tried the fallback class name and it was null.

So, an interesting question (to me) is why all the other steps in the
lookup procedure failed.   Here are the steps it uses:

* If set, use the javax.xml.parsers.SAXParserFactory system property.

* Use JAVA_HOME\lib\jaxp.properties file (if it exists) and look for the
key above.

* Use the Services API as specified in the JAR specification to search jars
in the
  classpath for a SAXParserFactory

* Fallback to a hardcoded default class name

As an experiment you could try setting the
javax.xml.parsers.SAXParserFactory system property to
org.apache.xerces.jaxp.SAXParserFactoryImpl and see if that helps.

Ilene.




                                                                                         
                                             
                      IrisAL@Sycron-IT.                                                  
                                             
                      com                      To:       Christian.Hujer@itcqis.com, xalan-j-users@xml.apache.org
                     
                                               cc:                                       
                                             
                      12/17/2002 08:07         Subject:  RE: adding xalan & xerces.jar
to classpath (sequence problem)                 
                      AM                                                                 
                                             
                                                                                         
                                             
                                                                                         
                                             



Thanx for your response Christian!
I'm using the jdk1.3.1 in a Windows2000 environment with xalan2.2
I have looked in the FAQ and nothing seems to answer to my problem...

Greetz.




Mime
View raw message