HI,
i have used the cxf-codegen-plugin to generate JaxB objects.

With default generation, one of my element is defined as
"javax.xml.ws.wsaddressing.W3CEndpointReference"
As this class is not serializable and not simple tu use i have set an
option to use the cxf addressing.

I used the following options :
<defaultOptions>
  <bindingFiles>

<bindingFile>${basedir}/src/main/resources/jaxws-binding.xml</bindingFile>
  </bindingFiles>
  <noAddressBinding>true</noAddressBinding>
</defaultOptions

In my jaxws-binding.xml i force the generation to be serializable (i need
it).


I have the following generated class :

package org.apache.cxf.ws.addressing;

...
public class EndpointReferenceType
    implements Serializable {
        private final static long serialVersionUID = 42L;
       @XmlElement(name = "Address", required = true)
        protected AttributedURIType address;
        @XmlElement(name = "ReferenceParameters")
        protected ReferenceParametersType referenceParameters;
        @XmlElement(name = "Metadata")
        protected MetadataType metadata;
        @XmlAnyElement(lax = true)
        protected List<Object> any;
        @XmlAnyAttribute
        private Map<QName, String> otherAttributes = new HashMap<QName,
String>();

        ...
}

So I expect that org.apache.cxf.ws.addressing.EndpointReferenceType is
serializable.

But when i try to serialize it, i have the following error :
java.io.NotSerializableException:
org.apache.cxf.ws.addressing.EndpointReferenceType
        at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
        at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
        at
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
        at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
        at
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
        at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
        at java.util.ArrayList.writeObject(ArrayList.java:570)

Looking to stack trace i suppose that the List<Object> any is the problem.

How can i resolve this ?

Thanks for answers

Regards

Hervé

Reply via email to