Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

NullPointerException from call if null parameter in params array #53

Closed
kchvilyov opened this issue Mar 23, 2016 · 5 comments
Closed

NullPointerException from call if null parameter in params array #53

kchvilyov opened this issue Mar 23, 2016 · 5 comments

Comments

@kchvilyov
Copy link

Thank you for useful library!
If I if use one null parameter in params array(fullParams) of the call request:
result = client.call(method, fullParams);
I get Unprescribed exception:
java.lang.NullPointerException
at de.timroes.axmlrpc.serializer.SerializerHandler.serialize(SerializerHandler.java:220)
at de.timroes.axmlrpc.Call.getXMLParam(Call.java:82)
at de.timroes.axmlrpc.Call.getXML(Call.java:64)
at de.timroes.axmlrpc.XMLRPCClient$Caller.call(XMLRPCClient.java:653)
at de.timroes.axmlrpc.XMLRPCClient.call(XMLRPCClient.java:455)
That is of object=null in this code:
throw new XMLRPCException("No serializer found for type '"
+ object.getClass().getName() + "'.");
It looks better:

  1. to send this null parameter.
  2. return described by throws dXMLRPCException
@gturri
Copy link
Owner

gturri commented Mar 23, 2016

Hi,

As far as I understand, you have a rather clear idea of how this behavior should be enhanced. What about submitting a pull request (along with a unit test)?

Also, I would be grateful if you could propose this pull request on the fork https://github.com/gturri/aXMLRPC, since it's there that development in being continued (see #49)

@adadion
Copy link

adadion commented Nov 16, 2016

It happened to me just few days ago. And giving FLAGS_NIL did the trick!

XMLRPCClient client = new XMLRPCClient(url, XMLRPCClient.FLAGS_NIL);

@gturri
Copy link
Owner

gturri commented Nov 16, 2016

Thanks for this information!
I'll close this issue then.

@gturri gturri closed this as completed Nov 16, 2016
@agilanbu
Copy link

@adadion Thanks for your input. its worked for me.

@adadion
Copy link

adadion commented Oct 14, 2020

@adadion Thanks for your input. its worked for me.

You're welcome

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants