I had 10 threads parsing your files for hours, but didn't see any
exception. Guess now I need your Java source and possibly other xml/xsd
files. (It'd be great if there is a zip file with a script that can
reproduce the problem.)

BTW, what JRE are you using? Do you cache the grammars (using a grammar
pool)? Are you using a one-way or multi-way machine?

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/14/2003 01:49                                          
                                                
                      PM                                                        
                                                
                      Please respond to                                         
                                                
                      xerces-j-user                                             
                                                
                                                                                
                                                
                                                                                
                                                




Thank you for responding.  I've had this problem for a while, and I
switched
to 2.3.0 as soon as it came out but that didn't help.  I just now switched
to the jar files that were dated February 13th.

I've run several more tests, where I have 8 threads parsing 14 files.
There's another message that pops up occasionally during the .parse phase,
and this one totally wipes out the thread that was doing the parsing:
      java.lang.NullPointerException
      at org.apache.xerces.impl.xs.XMLSchemaValidator.<init>(Unknown
Source)

I thought my original problem was gone, but it came back after the 5th time
I ran my test (the NullPointerException with no stack trace).  Also, the
ClassCastException from my second posting on this subject reappeared as
well.  Attached is an example of one of my files and its schema.  I'm
simply
reading in the file and parsing it into SQL statements, which I pass to
another function.  Let me know if you'll need some of my code.

Thanks for your help,
Angela

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 14, 2003 6:25 AM
To: [EMAIL PROTECTED]
Subject: RE: having trouble with SAX Parser and multiple threads


> 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]




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

#### XMLData.xsd has been removed from this note on February 19 2003 by
Sandy Gao
#### Etest2.xml has been removed from this note on February 19 2003 by
Sandy Gao

Attachment: ATTOQ8J6
Description: Binary data

Attachment: ATTLZ7SH
Description: Binary data

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

Reply via email to