> Are there some static elements in the SAXParser, SAXParserFactory, or
> XMLReader?  Is there something in the Xerces implementation that wouldn't
> allow me to have multiple independent SAXParser, SAXParserFactory, or
> XMLReader objects in different threads parsing different files?

There shouldn't be. If there is, then it's a bug.

What version of Xerces are you using? Could you try the latest 2.3.0? We
did have threading problems in earlier versions, but most known problems
are fixed.

If the same problem exists in 2.3.0, could you provide a copy of your
xml/xsd files to reproduce the problem?

Thanks,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
[EMAIL PROTECTED]



                                                                                
                                                
                      "MOLNAR,ANGELA                                            
                                                
                      (HP-SanDiego,ex1)        To:       "'[EMAIL PROTECTED]'" 
<[EMAIL PROTECTED]>        
                      "                        cc:                              
                                                
                      <[EMAIL PROTECTED]        Subject:  RE: having trouble 
with SAX Parser and multiple threads                
                      .com>                                                     
                                                
                                                                                
                                                
                      02/13/2003 04:33                                          
                                                
                      PM                                                        
                                                
                      Please respond to                                         
                                                
                      xerces-j-user                                             
                                                
                                                                                
                                                
                                                                                
                                                



I'm also getting this error periodically on the Parser.parse(CurrentFile,
XMLHandler) line of my code:
             java.lang.ClassCastException:
org.apache.xerces.util.XMLAttributesImpl
      at
org.apache.xerces.impl.xs.XMLSchemaValidator.processOneAttribute(Unknown
Source)
      at
org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown
Source)
      at
org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
Source)
      at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
Source)
      at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
      at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRoot

ElementHook(Unknown Source)
      at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc

her.dispatch(Unknown Source)
      at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(unknown
Source)
      at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
      at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:281)
      at HighVolumeParser.validateAndParse(HighVolumeParser.java:173)
      at
com.hp.cv.gradebook.AbstractFileParser.run(AbstractFileParser.java:186)
      at HighVolumeParser.run(HighVolumeParser.java:145)

Again, it seems to happen at random intervals to different threads.  Do any
of you know what could cause this?

Thanks,
Angela


-----Original Message-----
From: MOLNAR,ANGELA (HP-SanDiego,ex1) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 12, 2003 4:43 PM
To: '[EMAIL PROTECTED]'
Subject: having trouble with SAX Parser and multiple threads


Hi,

I'm spawning a bunch of threads from my main application, and each thread
creates its own instance of a SAXParserFactory, a SAXParser, and an
XMLReader.  Each thread then gets handed different xml files to parse.  My
problem is I'm getting NullPointerException errors during the parsing phase
(in the SAXParser.parse call).  The errors seem random - they appear in one
or two threads some of the time with different files, and it's not giving
me
a stack trace (I don't get the errors when I run it in my development
environment).  All of the files that I'm testing with are valid files.

Are there some static elements in the SAXParser, SAXParserFactory, or
XMLReader?  Is there something in the Xerces implementation that wouldn't
allow me to have multiple independent SAXParser, SAXParserFactory, or
XMLReader objects in different threads parsing different files?

Thanks,
Angela




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to