Dan -

Thanks for the quick response!  Maybe someday I'll get a few minutes and
work with the source tree and submit some code.  Until then, thanks for
helping me out.

There was a related change checked in right afterward that included this
snippet:

  -    private static final String DEFAULT_PARSER
= "uk.co.wilson.xml.MinML";
  +    private static final String DEFAULT_PARSER = MinML.class.getName();

While I generally applaud the avoidance of quoted strings like this, in
this case the old way is preferred.  This change which asks the MinML class
for its name requires that the MinML class always be bundled with the
XML-RPC classes.  I suspect this is an unintended consequence of the
update.  As it turns out, since we aren't using that parser in our app we
don't include it in our JAR file.

Can you please change this back (with a comment explaining the situation)
or, alternatively, state formally that it is a new *requirement* that MinML
be bundled?  I would prefer to leave them unbundled but I will accept your
decision.

Stuart


|---------+---------------------------->
|         |           Daniel Rall      |
|         |           <dlr@finemaltcodi|
|         |           ng.com>          |
|         |           Sent by:         |
|         |           dlr@finemaltcodin|
|         |           g.com            |
|         |                            |
|         |                            |
|         |           02/19/2002 09:32 |
|         |           PM               |
|         |           Please respond to|
|         |           rpc-dev          |
|         |                            |
|---------+---------------------------->
  
>------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                          |
  |       To:       [EMAIL PROTECTED]                                             
                                          |
  |       cc:                                                                          
                                          |
  |       Subject:  Re: Running XmlRpcClient from an applet                            
                                          |
  
>------------------------------------------------------------------------------------------------------------------------------|




Hey Stuart, thanks for the note.  I just check code implementing your
work-around into CVS.  If you'd like to add some sort of factory for
parser creation, there would be interested in that.

http://jakarta.apache.org/site/source.html

                             Thanks, Dan


"Stuart Roll" <[EMAIL PROTECTED]> writes:

> Greetings -
>
> <apologies in advance if this is the wrong mailing list for this topic>
>
> I got a nasty little suprise when I tried to use XML-RPC from within an
> unsigned applet.  The XmlRpcClient's worker threads are instances of
XmlRpc
> and XmlRpc.parse() contains the following code:
>
>       if (parserClass == null) {
>           // try to get the name of the SAX driver from the System
> properties
>           setDriver (System.getProperty ("sax.driver",
> "uk.co.wilson.xml.MinML"));
>       }
>
> If you don't set a parser class explicitly (through XmlRpc.setDriver()),
> XmlRpc will check the system property shown above and use it's default if
> that isn't set.  Unfortunately, in an unsigned applet the applet is
> prohibited from examining that system property and a SecurityException is
> thrown (which isn't handled by XML-RPC).
>
> To make matters worse, XmlRpcClient does not provide a means to set the
> parser that its workers will use.  Since the XmlRpcClient.Worker class
> (which extends XmlRpc) has package access, you can't even subclass
> XmlRpcClient to override the behavior.  Alas, all my hacks failed me and
I
> had to modify the library itself.
>
> 1 - At the very least, the snippet above should read something like:
>       if (parserClass == null) {
>           // try to get the name of the SAX driver from the System
> properties
>           try {
>             setDriver (System.getProperty ("sax.driver",
> "uk.co.wilson.xml.MinML"));
>           } catch (SecurityException e) {
>             setDriver ("uk.co.wilson.xml.MinML");
>           }
>       }
>
> 2 - For those who don't want to use the default parser, what should we
do?
> Should the various client and server/servlet objects each provide a means
> to set the parser class for their worker threads?  Perhaps someone has a
> clever suggestion like a worker thread factory callback or somesuch.
>
> In my case, I've modified the XML-RPC library to change the default to be
> the Xerces parser and added the try-catch block shown above but I'd like
to
> see a proper fix.
>
> Stuart




Reply via email to