Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

SOAPFaultException is Serializable, but field fault is not #203

Open
Tomas-Kraus opened this issue Jun 2, 2022 · 0 comments
Open

SOAPFaultException is Serializable, but field fault is not #203

Tomas-Kraus opened this issue Jun 2, 2022 · 0 comments

Comments

@Tomas-Kraus
Copy link
Member

This issue is referenced from https://bugs.openjdk.java.net/browse/JDK-8136994

FULL PRODUCT VERSION :
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
Linux 2.6.32.12-0.7-default eclipse-ee4j/metro-jax-ws#1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
javax.xml.ws.soap.SOAPFaultException is Serializable (as all Throwable(s)), but the private field "fault" (class javax.xml.soap.SOAPFault) is not.
This violates the serialization protocol and produces a java.io.NotSerializableException if a SOAPFaultException must be serialized (e.g. because of a remote service call).

ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Serialize a SOAPFaultException.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
serialization should work, without throwing exception.
ACTUAL -
java.io.NotSerializableException: com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.io.;
import javax.xml.soap.
;
import javax.xml.ws.soap.*;

public class SOAPFaultExceptionSerializationTest {

public static void main(String args[]) throws java.lang.Exception { 
    SOAPFaultException exception = new SOAPFaultException(SOAPFactory.newInstance().createFault()); 
    new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(exception); 
} 

}
---------- END SOURCE ----------

Source: javaee/metro-jax-ws#1216
Author: LanceAndersen

@lukasj lukasj transferred this issue from eclipse-ee4j/metro-jax-ws Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant