[SoapRMI] xpp potential cleanup/reset problem

Aleksander Slominski aslom_at_cs.indiana.edu
Mon, 29 Jul 2002 10:55:07 -0400


"CHEN,SHIH-CHANG (HP-NewJersey,ex2)" wrote:

> > what is the parser state (getEventType()) just before last next()?
>
> 0 (start_document): nost
> 1, 2, 3 or 4: sometime ?

those copnstants are defined in interface XmlPullParser - to have more frindly messages use:
* System.out.println(XmlPullParser.TYPES[ parser.getEventType() ]);
* or even better to see actual input and positions
System.out.println(parser.getPositionDescritption());


> > did you make sure that only one thread at any time is accessing
> > parser instance. the easiest approach is to use pool of parser
> > instances that are reused to handle requests (typically each request
> > gets its own parser instance and not shared with other thread).
>
> I also suspect my ide (eclipse) or servlet engine(Tomcat404) has
> threading problems. But a servlet instance is supposed to run in
> one thread. And Servlent container will take care of servlet instance
> pooling. In my case, a parser instance is cached in a servlet instance.
>
> I will using pooling if I cannot solve this problem. Attachment
> is my servlet for server-side. In client-side, I use WebLoad5 to simulate
> concurrent
> 10 http clients.(http://www.radview.com/products/WebLOAD.asp)

i think we have the problem - unless you explicitly make servlet instance thread save