[ http://issues.apache.org/jira/browse/AXIS-1772?page=comments#action_58231 ] toby cabot commented on AXIS-1772: ----------------------------------
Hi dims, thanks for the response. The problem is still in the latest CVS. The problem is that the classes that get generated by wsdl2java claim to be serializable but they sometimes aren't. Most of the time they are, but if have a schema using the "any" feature and add an element in the place where the "any" feature allows, the object in the generated class's _any field will not serialize. I found a few problems: src/org/apache/axis/description/JavaServiceDesc.java isn't declared serializable, and it has a field called skelMethod that's a java.lang.reflect.Method (which isn't serializable). src/org/apache/axis/description/OperationDesc.java is declared Serializable but has a skelMethod field. I tried an experiment where I tried to work around those problems by declaring the fields transient, but it appears that there are other fields that are non-serializable. Since I'm not up on that code I don't want to monkey around with it. Unfortunately, it's hard to come up with a really simple test case since it's a somewhat complex problem. I've built a small webapp that demonstrates the problem. It's too big to attach to this report but you can download it from http://www.caboteria.org/~tobyc/1772-testcase.jar . Unpack the jar and run "ant" and it will build test.war in the build directory. I tested it with tomcat. When you start tomcat open a web browser and go to http://localhost:8080/test/ and you should get a form with two different XML fragments. One contains the XML that Axis would send over the wire if you used the client-side classes. It works fine. The other has an extra element where the schema allows it. This request will cause the server-side stub to throw when it tries to serialize the wsdl2java-generated class. HTH, please let me know if you bump into any problems getting the test case to work. > CLONE -MessageElement is not (Java) serializable > ------------------------------------------------ > > Key: AXIS-1772 > URL: http://issues.apache.org/jira/browse/AXIS-1772 > Project: Axis > Type: Bug > Components: Serialization/Deserialization > Versions: 1.1 > Reporter: toby cabot > Attachments: 1772-testcase.jar > > a part of the request/response xml schema of our web service uses an > <xsd:any> element to transport arbitrary xml content. > using wsdl2java to generate the java beans, the <xsd:any> content is > represented using an array of MessageElement objects, available via the > get_any() method. > when trying to pass around the generated java beans using native java > serialization (e.g., in a remote ejb call) a NotSerializableException occurs, > if the java bean contains a MessageElement as described above. > although the MessageElement implements the java.io.Serializable interface, i > suspect it is in fact not serializable because (at least in my case) it > somehow references an OperationDesc object which is not serializable. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira
