This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Web Services and the fly likes Serialization Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Serialization Error" Watch "Serialization Error" New topic

Serialization Error

Pinik Tilli

Joined: Jul 19, 2006
Posts: 19

I am getting an error when i invoke the operation in a webservice.
one of my webservice method is shown below. This method returns Object[]. When i invoke this method i am getting the error as discussed before.
Error --- no serializer is registered for (class org.apache.commons.beanutils.BasicDynaBean, null).

// queryValueMap contains{key - type @List , value -type @List}
// This hashmap value is the list object which contains BasicDynaBean objects.

public Object[] getRowValues() {
Object[] a =null;
Iterator keyIter = queryValueMap.keySet().iterator();
List list = (List);
List valueList = (List) queryValueMap.get(list);

a = valueList.toArray();

return a;

Any help is appreciable. And if i need to Serialize and deserialize how can i do that.
Hope to get some solution.

Pinik Tilli

Joined: Jul 19, 2006
Posts: 19
And here is the error description.
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="" xmlns:xsd="" xmlns:xsi="" xmlns:ns0="http://dataaccess/types/" xmlns:ns1=""><env:Body><env:Fault><faultcode>env:Server</faultcode>
<faultstring>Internal Server Error (serialization error: no serializer is registered for (class org.apache.commons.beanutils.BasicDynaBean, null))</faultstring></env:Fault></env:Body></env:Envelope>

I am using RowSetDynaClass for representing the results of an SQL query.

Peer Reynders

Joined: Aug 19, 2005
Posts: 2922
Hi "Nalini T"
  • Your display name still doesn't quite comply with the JavaRanch official policy on registered names. "with a first and last name" "You can even use initials for the first name if you like." So if you simply want to swap the initial to the front then that would be fine.
  • Please do not post the same message multiple times, either in the same forum or across different JavaRanch forums. You can delete your own messages by "editing" them and checking the "Delete Post? (check box, if yes)" checkbox, should you accidentally create multiple messages.
  • Ease Up (in reference to your original message and the impression that multiple identical messages leave).
  • Respect Your Coranchers Privacy
  • In your original message you stated that the problem was solved.

  • Your code and error message shows that you still haven't addressed the issue: the object hidden away in the object array still has to be serialized. So if that object doesn't have a default serializer/de-serializer pair you will have write one.

    See Java API for XML-Based RPC (JAX-RPC) Specification 1.1 (JSR-101); Section: 19 Appendix: Serialization Framework

    The other alternative is to extract the information from the object into variables with a data type that has default serialization/de-serialization support and send those variables instead.
    Section: 5 Java to XML/WSDL Mapping

    The best alternative is to design your service WSDL-first (possibly defining your data XML Schemas separately) using the supported XSD types as outlined in 18. Appendix: XML Schema Support and then use the WSDL2Java tool to generate the stubs. Then you can unload the data form your original objects and load the data into instances of the classes provided by the stub.
    Section: 4 WSDL/XML to Java Mapping
    John Kouch

    Joined: Dec 10, 2002
    Posts: 4
    I had the same problem recently. I resolved it by returning one of my own objects that extends java.lang.Object. I use Rational App Developer for an IDE, and the Serialize and Deserialize classes were automatically created once I started using my own class instead of Object. Instead of returning Object[] I return an array of my own class like this:

    return (MyClass[])listObj.toArray(new MyClass[0]);

    I hope this helps.
    Peer Reynders

    Joined: Aug 19, 2005
    Posts: 2922
    Welcome back to JavaRanch "John K",

    If I could divert your attention to the JavaRanch official policy on registered names. Please adjust your display name here in accordance with the policy. Why not use the latter part of your publicly visible email address?
    Thank You.
    Pinik Tilli

    Joined: Jul 19, 2006
    Posts: 19
    Hi Peer and John,

    Thanks for the reply. I have resolved the error by extracting the information from bean object. I have put the property name and its value from bean in to the hashtable. And now webservice is working fine with no exceptions.

    I agree. Here's the link:
    subject: Serialization Error