You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by robert sanford <rs...@nolimitsystems.com> on 2000/08/28 16:08:46 UTC

in progress exception

i am getting an exception that essentially says:
   "cannot set validation to true because i'm busy."
(stack trace below).

i am using the exact same code that i have been using
with the exception of setting validation to true and
specifying a schema to validate against in my test data.

i am in a multi-threaded environment that makes use of
multiple parser instances stored in an object pool. when
the parser is finished (either successfully or when it
throws an exception) it is placed back in the pool for
the next client to use.

is the validation setting a static one? if one parser
is parsing and another is in progress will this exception
be thrown?

am i missing something?

thanks,

rjsjr

stack trace for the exception is:
+ org.xml.sax.SAXNotSupportedException: PAR004 Cannot
setFeature(http://xml.org/sax/features/validation): parse is in progress.
+ at org.apache.xerces.framework.XMLParser.setValidation(XMLParser.java:380)
+ at org.apache.xerces.framework.XMLParser.setFeature(XMLParser.java:1046)
+ at org.apache.xerces.parsers.DOMParser.setFeature(DOMParser.java:647)



Re: in progress exception

Posted by Eric Ye <er...@locus.apache.org>.
You will get this exception if your program trys to change settings when the
parser instance is still parsing( hasn't return from parse() method).
It is not required to call reset() method before every invocation.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "robert sanford" <rs...@nolimitsystems.com>
To: <xe...@xml.apache.org>; "robert sanford"
<rs...@nolimitsystems.com>
Sent: Monday, August 28, 2000 8:20 AM
Subject: Re: in progress exception


> not that either from looking at the code.
>
> i am now thinking i need to call reset() before every
> invocation? if this is the case then why would it have
> worked before i was using validation but not after?
>
> rjsjr
>
> ----- Original Message -----
> From: "robert sanford" <rs...@nolimitsystems.com>
> To: <xe...@xml.apache.org>
> Sent: Monday, August 28, 2000 9:47 AM
> Subject: Re: in progress exception
>
>
> > okay, another question that may be more relevant after i
> > looked at the setValidation code...
> >
> > if i throw an exception in my ErrorHandler, does the parser
> > catch that exception, reset fParseInProgress and then re-
> > throw that exception or does it just let the exception fly?
> >
> > rjsjr
> >
> > ----- Original Message -----
> > From: "robert sanford" <rs...@nolimitsystems.com>
> > To: <xe...@xml.apache.org>
> > Sent: Monday, August 28, 2000 9:08 AM
> > Subject: in progress exception
> >
> >
> > > i am getting an exception that essentially says:
> > >    "cannot set validation to true because i'm busy."
> > > (stack trace below).
> > >
> > > i am using the exact same code that i have been using
> > > with the exception of setting validation to true and
> > > specifying a schema to validate against in my test data.
> > >
> > > i am in a multi-threaded environment that makes use of
> > > multiple parser instances stored in an object pool. when
> > > the parser is finished (either successfully or when it
> > > throws an exception) it is placed back in the pool for
> > > the next client to use.
> > >
> > > is the validation setting a static one? if one parser
> > > is parsing and another is in progress will this exception
> > > be thrown?
> > >
> > > am i missing something?
> > >
> > > thanks,
> > >
> > > rjsjr
> > >
> > > stack trace for the exception is:
> > > + org.xml.sax.SAXNotSupportedException: PAR004 Cannot
> > > setFeature(http://xml.org/sax/features/validation): parse is in
> progress.
> > > + at
> > org.apache.xerces.framework.XMLParser.setValidation(XMLParser.java:380)
> > > + at
> org.apache.xerces.framework.XMLParser.setFeature(XMLParser.java:1046)
> > > + at
org.apache.xerces.parsers.DOMParser.setFeature(DOMParser.java:647)
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


Re: in progress exception

Posted by robert sanford <rs...@nolimitsystems.com>.
not that either from looking at the code.

i am now thinking i need to call reset() before every
invocation? if this is the case then why would it have
worked before i was using validation but not after?

rjsjr

----- Original Message -----
From: "robert sanford" <rs...@nolimitsystems.com>
To: <xe...@xml.apache.org>
Sent: Monday, August 28, 2000 9:47 AM
Subject: Re: in progress exception


> okay, another question that may be more relevant after i
> looked at the setValidation code...
>
> if i throw an exception in my ErrorHandler, does the parser
> catch that exception, reset fParseInProgress and then re-
> throw that exception or does it just let the exception fly?
>
> rjsjr
>
> ----- Original Message -----
> From: "robert sanford" <rs...@nolimitsystems.com>
> To: <xe...@xml.apache.org>
> Sent: Monday, August 28, 2000 9:08 AM
> Subject: in progress exception
>
>
> > i am getting an exception that essentially says:
> >    "cannot set validation to true because i'm busy."
> > (stack trace below).
> >
> > i am using the exact same code that i have been using
> > with the exception of setting validation to true and
> > specifying a schema to validate against in my test data.
> >
> > i am in a multi-threaded environment that makes use of
> > multiple parser instances stored in an object pool. when
> > the parser is finished (either successfully or when it
> > throws an exception) it is placed back in the pool for
> > the next client to use.
> >
> > is the validation setting a static one? if one parser
> > is parsing and another is in progress will this exception
> > be thrown?
> >
> > am i missing something?
> >
> > thanks,
> >
> > rjsjr
> >
> > stack trace for the exception is:
> > + org.xml.sax.SAXNotSupportedException: PAR004 Cannot
> > setFeature(http://xml.org/sax/features/validation): parse is in
progress.
> > + at
> org.apache.xerces.framework.XMLParser.setValidation(XMLParser.java:380)
> > + at
org.apache.xerces.framework.XMLParser.setFeature(XMLParser.java:1046)
> > + at org.apache.xerces.parsers.DOMParser.setFeature(DOMParser.java:647)
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>


Re: in progress exception

Posted by robert sanford <rs...@nolimitsystems.com>.
okay, another question that may be more relevant after i
looked at the setValidation code...

if i throw an exception in my ErrorHandler, does the parser
catch that exception, reset fParseInProgress and then re-
throw that exception or does it just let the exception fly?

rjsjr

----- Original Message -----
From: "robert sanford" <rs...@nolimitsystems.com>
To: <xe...@xml.apache.org>
Sent: Monday, August 28, 2000 9:08 AM
Subject: in progress exception


> i am getting an exception that essentially says:
>    "cannot set validation to true because i'm busy."
> (stack trace below).
>
> i am using the exact same code that i have been using
> with the exception of setting validation to true and
> specifying a schema to validate against in my test data.
>
> i am in a multi-threaded environment that makes use of
> multiple parser instances stored in an object pool. when
> the parser is finished (either successfully or when it
> throws an exception) it is placed back in the pool for
> the next client to use.
>
> is the validation setting a static one? if one parser
> is parsing and another is in progress will this exception
> be thrown?
>
> am i missing something?
>
> thanks,
>
> rjsjr
>
> stack trace for the exception is:
> + org.xml.sax.SAXNotSupportedException: PAR004 Cannot
> setFeature(http://xml.org/sax/features/validation): parse is in progress.
> + at
org.apache.xerces.framework.XMLParser.setValidation(XMLParser.java:380)
> + at org.apache.xerces.framework.XMLParser.setFeature(XMLParser.java:1046)
> + at org.apache.xerces.parsers.DOMParser.setFeature(DOMParser.java:647)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>