java xml-rpc

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

java xml-rpc

Mina Amin
Dear all ...
   I'm developing a bugzilla client under java application that use bugzilla xml-rpc API, when using the "User.login" method a cast exception occurs.. any help
 
NOTE: i'm using java 6 with apach xml-rpc library
 
 


Make your little one a shining star! Shine on!
Reply | Threaded
Open this post in threaded view
|

Re: java xml-rpc

Mads Bondo Dydensborg
mandag 24 September 2007 skrev Mina Amin:
> Dear all ...
>    I'm developing a bugzilla client under java application that use bugzilla
xml-rpc API, when using the "User.login" method a cast exception occurs.. any
help

The text of the exception would probably be helpful.

Regards,

Mads

--
Med venlig hilsen/Regards

Systemudvikler/Systemsdeveloper cand.scient.dat, Ph.d., Mads Bondo Dydensborg
Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 44 86 77 34
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: java xml-rpc

Max Kanat-Alexander
In reply to this post by Mina Amin
On Mon, 24 Sep 2007 13:20:59 +0000 Mina Amin <[hidden email]>
wrote:
>    I'm developing a bugzilla client under java application that use
> bugzilla xml-rpc API, when using the "User.login" method a cast
> exception occurs.. any help NOTE: i'm using java 6 with apach xml-rpc
> library

        You're going to have to be way more specific than that. Show us
what code you wrote, and show us the exact error.

        Also, you're probably better off asking the people who wrote
the library, instead of us. As long as you're following the Bugzilla
API, you should be fine. Just realize that all arguments are a hash (a
Map in Java terms).

        -Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla Services. And Everything Else, too.
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: java xml-rpc

Jochen Wiedmann
On 9/25/07, Max Kanat-Alexander <[hidden email]> wrote:

>         Also, you're probably better off asking the people who wrote
> the library, instead of us. As long as you're following the Bugzilla
> API, you should be fine. Just realize that all arguments are a hash (a
> Map in Java terms).

Depends. I am the author of the latest version of Apache XML-RPC, and
am listening here. There seems to be a problem indeed, whether its in
the Bugzilla code or in the Apache XML-RPC code, I do not know.
However, this is the third such bug report I've seen.

In both previous cases, I asked the reporters for traces generated
with Wireshark or tcpmon, but never got such a trace.


Jochen


--
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: java xml-rpc

Mina Amin
In reply to this post by Mina Amin
This is the code, i use to invoke the Bugzilla API, also I'm using version 3.0.1 and when invoking the Version API it return the it correctly.
but the problem with the User.login API.
 
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();

config.setServerURL(new URL("http://<VMware virtual IP>/bugzilla/xmlrpc.cgi"));


 


XmlRpcClient client = new XmlRpcClient();

client.setConfig(config);

 


Object result = client.execute("User.login", new Object[] {"[hidden email]", "password"});


System.out.println(result);


Note that execute takes a list or object[] as its second parameter.


and the exception is


Exception in thread "main" java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer


at org.apache.xmlrpc.parser.XmlRpcResponseParser.addResult(XmlRpcResponseParser.java:58)


at org.apache.xmlrpc.parser.RecursiveTypeParserImpl.endValueTag(RecursiveTypeParserImpl.java:71)


at org.apache.xmlrpc.parser.XmlRpcResponseParser.endElement(XmlRpcResponseParser.java:183)


at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)


at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)


at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)


at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)


at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)


at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)


at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)


at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)


at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)


at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)


at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)


at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:175)


at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:145)


at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)


at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:44)


at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)


at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)


at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:136)


at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:125)

at com.newportmediainc.bzc.executer.BZCApplication.main(BZCApplication.java:31)
 
and the TCP dump using wireshark
faultString

Can't use string ("[hidden email]") as a HASH ref while "strict refs" in use at Bugzilla/WebService/User.pm line 39.\n
faultcode
 


server // i think this is the problem as it must return a numerical code.


I believe that the problem in how to send a parameters with the method name. so if anyone did it via java and apach xml-rpc please give a hand.


 


thx.


 


Mina





> Date: Mon, 24 Sep 2007 16:17:21 -0700
> From: [hidden email]
> To: [hidden email]
> Subject: Re: java xml-rpc
>
> On Mon, 24 Sep 2007 13:20:59 +0000 Mina Amin <[hidden email]>
> wrote:
> > I'm developing a bugzilla client under java application that use
> > bugzilla xml-rpc API, when using the "User.login" method a cast
> > exception occurs.. any help NOTE: i'm using java 6 with apach xml-rpc
> > library
>
> You're going to have to be way more specific than that. Show us
> what code you wrote, and show us the exact error.
>
> Also, you're probably better off asking the people who wrote
> the library, instead of us. As long as you're following the Bugzilla
> API, you should be fine. Just realize that all arguments are a hash (a
> Map in Java terms).
>
> -Max
> --
> http://www.everythingsolved.com/
> Competent, Friendly Bugzilla Services. And Everything Else, too.


More photos; more messages; more whatever – Get MORE with Windows Live™ Hotmail®. NOW with 5GB storage. Get more!
Reply | Threaded
Open this post in threaded view
|

Re: java xml-rpc

Jochen Wiedmann
In reply to this post by Mads Bondo Dydensborg
On 9/24/07, Mads Bondo Dydensborg <[hidden email]> wrote:

> The text of the exception would probably be helpful.

The exception is a ClassCastException. I do not know, whether Bugzilla
produces wrong output (causing Apache XML-RPC to cast the object to a
wrong type) or whether the bug is in Apache XML-RPC. That's the reason
I am asking for a trace of the HTTP traffic.

Jochen

--
Look, that's why there's rules, understand? So that you think before
you break 'em.

    -- (Terry Pratchett, Thief of Time)
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: java xml-rpc

Max Kanat-Alexander
In reply to this post by Mina Amin
On Tue, 25 Sep 2007 14:09:43 +0000 Mina Amin <[hidden email]>
wrote:
> IP>client.execute("User.login", new Object[] {"[hidden email]",
> IP>"password"});

        Like I said, User.login takes *named* parameters, not
positional parameters.

> faultString Can't use string ("<email
> account>") as a HASH ref while "strict refs" in use at
> account>Bugzilla/WebService/User.pm line 39.\nfaultcode server // i

        And on top of that, something isn't processing the returned
fault properly.

        -Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla Services. And Everything Else, too.
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: java xml-rpc

Mads Bondo Dydensborg
onsdag 26 September 2007 skrev Max Kanat-Alexander:
> On Tue, 25 Sep 2007 14:09:43 +0000 Mina Amin <[hidden email]>
> wrote:

> > faultString Can't use string ("<email
> > account>") as a HASH ref while "strict refs" in use at
> > account>Bugzilla/WebService/User.pm line 39.\nfaultcode server // i
>
> And on top of that, something isn't processing the returned
> fault properly.

Are you sure about this? The fault is an perl semantics error - are you sure
that an error _number_ is returned in this case?

I ask, because I seem to recall having similar problems with the .net stuff I
made.

I agree that the arguments are not passed correctly.

Mads

--
Med venlig hilsen/Regards

Systemudvikler/Systemsdeveloper cand.scient.dat, Ph.d., Mads Bondo Dydensborg
Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 44 86 77 34
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>
Reply | Threaded
Open this post in threaded view
|

Re: java xml-rpc

Max Kanat-Alexander
On Thu, 27 Sep 2007 08:51:56 +0200 Mads Bondo Dydensborg <[hidden email]>
wrote:
> Are you sure about this? The fault is an perl semantics error - are
> you sure that an error _number_ is returned in this case?

        Hrm...I wonder, actually. You know, you might be on to
something. I don't think we actually install a $SIG{__DIE__} handler,
and we should!

        -Max
--
http://www.everythingsolved.com/
Competent, Friendly Bugzilla Services. And Everything Else, too.
-
To view or change your list settings, click here:
<http://bugzilla.org/cgi-bin/mj_wwwusr?user=lists@...>