Running apache xmlrpc with gij 3.3.1

Everton da Silva Marques everton@lab.ipaccess.diveo.net.br
Mon Sep 22 19:14:00 GMT 2003


On Mon, Sep 22, 2003 at 08:14:55PM +0200, Michael Koch wrote:
>> Look into the code of org.apache.xmlrpc.XmlRpcClient
> $Worker.execute(java.lang.String,
> > java.util.Vector) to see why the exception might be thrown. Perhaps 
> something returns a wrong value or something like that.

Thanks for helping!
Ok, I have found these methods:
 public XmlRpcClient(String url) throws MalformedURLException
 {
 this(new URL(url));
 }
 public XmlRpcClient(String hostname, int port) throws MalformedURLException
 {
 this(new URL("http://" + hostname + ':' + port + "/RPC2"));
 }
As the test code was calling XmlRpcClient("http://127.0.0.1:1234"),
I think the exception was being thrown due to the missing "/RPC2" suffix.
Then I fixed this, but now gij issues:
$ gij-3.3 -classpath build:../lib/servlet.jar:../lib/xmlrpc.jar echo.EchoClient
Exception in thread "main" java.lang.IllegalAccessError
 at _Jv_ResolvePoolEntry(java.lang.Class, int) (/usr/lib/libgcj.so.4.0.0)
 at uk.co.wilson.xml.MinML.parse(java.io.Reader) (Unknown Source)
 at uk.co.wilson.xml.MinML.parse(org.xml.sax.InputSource) (Unknown Source)
 at org.apache.xmlrpc.XmlRpc.parse(java.io.InputStream) (Unknown Source)
 at org.apache.xmlrpc.XmlRpcClient$Worker.execute(java.lang.String, java.util.Vector) (Unknown Source)
 at org.apache.xmlrpc.XmlRpcClient.execute(java.lang.String, java.util.Vector) (Unknown Source)
 at echo.EchoClient.main(java.lang.String[]) (Unknown Source)
$
The method uk.co.wilson.xml.MinML.parse(java.io.Reader) is:
 public void parse(final Reader in) throws SAXException, IOException {
 final Vector attributeNames = new Vector();
 final Vector attributeValues = new Vector();
 final AttributeList attrs = new AttributeList() {
 public int getLength() {
 return attributeNames.size();
 }
 public String getName(final int i) {
 return (String)attributeNames.elementAt(i);
 }
 public String getType(final int i) {
 return "CDATA";
 }
 public String getValue(final int i) {
 return (String)attributeValues.elementAt(i);
 }
 public String getType(final String name) {
 return "CDATA";
 }
 public String getValue(final String name) {
 final int index = attributeNames.indexOf(name);
 return (index == -1) ? null : (String)attributeValues.elementAt(index);
 }
 };
Does anyone see anything wrong in the code above?
Maybe gij from CVS could give better results?
Thanks,
Everton


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /