Martin Desruisseaux created SIS-632:
---------------------------------------
Summary: NotSerializableException during CRS serialization
Key: SIS-632
URL: https://issues.apache.org/jira/browse/SIS-632
Project: Spatial Information Systems
Issue Type: Task
Components: Metadata, Referencing
Affects Versions: 1.6, 1.5, 1.4
Reporter: Martin Desruisseaux
Assignee: Martin Desruisseaux
Fix For: 1.7
The following test case throws {{java.io.NotSerializableException}}:
{code:java}
public class SerializationTest {
public static void main(String[] args) throws Exception {
CoordinateReferenceSystem crs = CRS.forCode("EPSG:3857");
var buffer = new ByteArrayOutputStream();
try (var out = new ObjectOutputStream(buffer)) {
out.writeObject(crs);
}
}
}
{code}
This is caused by the {{org.apache.sis.metadata.sql}} module which creates
non-serializable {{java.lang.reflect.Proxy}} (actually, the non-serializable
object is the invocation handler).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)