This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.3
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.3 by this push:
new 96bf731971 [Task] move jdk-ser to spi-extensions (#14369)
96bf731971 is described below
commit 96bf73197125f81d14f9fa2c75e330d04f1140f6
Author: 王聪洋 <[email protected]>
AuthorDate: Fri Sep 6 10:44:13 2024 +0800
[Task] move jdk-ser to spi-extensions (#14369)
* first commit
* temp
---
.artifacts | 1 -
dubbo-config/dubbo-config-api/pom.xml | 7 --
.../apache/dubbo/config/AbstractConfigTest.java | 2 +-
.../dubbo-demo-spring-mvc-rest-consumer/pom.xml | 5 -
.../dubbo-demo-spring-mvc-rest-provider/pom.xml | 5 -
.../dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml | 5 -
.../dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml | 5 -
dubbo-distribution/dubbo-all-shaded/pom.xml | 8 --
dubbo-distribution/dubbo-all/pom.xml | 8 --
dubbo-distribution/dubbo-bom/pom.xml | 5 -
dubbo-rpc/dubbo-rpc-dubbo/pom.xml | 6 --
.../dubbo-serialization-jdk/pom.xml | 44 --------
.../serialize/java/CompactedJavaSerialization.java | 58 ----------
.../serialize/java/CompactedObjectInputStream.java | 63 -----------
.../java/CompactedObjectOutputStream.java | 43 --------
.../common/serialize/java/JavaObjectInput.java | 89 ----------------
.../common/serialize/java/JavaObjectOutput.java | 61 -----------
.../common/serialize/java/JavaSerialization.java | 82 ---------------
.../nativejava/NativeJavaObjectInput.java | 117 ---------------------
.../nativejava/NativeJavaObjectOutput.java | 114 --------------------
.../nativejava/NativeJavaSerialization.java | 83 ---------------
...org.apache.dubbo.common.serialize.Serialization | 3 -
dubbo-serialization/pom.xml | 1 -
dubbo-test/dubbo-dependencies-all/pom.xml | 5 -
dubbo-test/dubbo-test-spring/pom.xml | 5 -
25 files changed, 1 insertion(+), 824 deletions(-)
diff --git a/.artifacts b/.artifacts
index 2c21cd0bca..92f7a1615c 100644
--- a/.artifacts
+++ b/.artifacts
@@ -88,7 +88,6 @@ dubbo-serialization
dubbo-serialization-api
dubbo-serialization-fastjson2
dubbo-serialization-hessian2
-dubbo-serialization-jdk
dubbo-spring-boot
dubbo-spring-boot-actuator
dubbo-spring-boot-actuator-compatible
diff --git a/dubbo-config/dubbo-config-api/pom.xml
b/dubbo-config/dubbo-config-api/pom.xml
index dbccd5841c..3a29c6c757 100644
--- a/dubbo-config/dubbo-config-api/pom.xml
+++ b/dubbo-config/dubbo-config-api/pom.xml
@@ -145,13 +145,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.parent.version}</version>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-multicast</artifactId>
diff --git
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java
index 963e44eb28..599b55e78f 100644
---
a/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java
+++
b/dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java
@@ -77,7 +77,7 @@ class AbstractConfigTest {
protocolConfig.setName("dubbo");
protocolConfig.setHost("host");
protocolConfig.setSerialization("fastjson2");
-
protocolConfig.setPreferSerialization("hessian2,java,compactedjava,nativejava");
+ protocolConfig.setPreferSerialization("hessian2");
ConfigValidationUtils.validateProtocolConfig(protocolConfig);
}
diff --git
a/dubbo-demo/dubbo-demo-xml/dubbo-demo-spring-mvc-rest-consumer/pom.xml
b/dubbo-demo/dubbo-demo-xml/dubbo-demo-spring-mvc-rest-consumer/pom.xml
index e0c96b82fe..46cafa0047 100644
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-spring-mvc-rest-consumer/pom.xml
+++ b/dubbo-demo/dubbo-demo-xml/dubbo-demo-spring-mvc-rest-consumer/pom.xml
@@ -108,11 +108,6 @@
<artifactId>dubbo-serialization-fastjson2</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.springframework</groupId>
diff --git
a/dubbo-demo/dubbo-demo-xml/dubbo-demo-spring-mvc-rest-provider/pom.xml
b/dubbo-demo/dubbo-demo-xml/dubbo-demo-spring-mvc-rest-provider/pom.xml
index b9320cc504..aba2a7387a 100644
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-spring-mvc-rest-provider/pom.xml
+++ b/dubbo-demo/dubbo-demo-xml/dubbo-demo-spring-mvc-rest-provider/pom.xml
@@ -108,11 +108,6 @@
<artifactId>dubbo-serialization-fastjson2</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.springframework</groupId>
diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml
b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml
index 25a3ee5e53..cbd5e6d60c 100644
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml
+++ b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-consumer/pom.xml
@@ -100,11 +100,6 @@
<artifactId>dubbo-serialization-fastjson2</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-rpc-triple</artifactId>
diff --git a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml
b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml
index 16a2a5a6a0..2869a1dbff 100644
--- a/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml
+++ b/dubbo-demo/dubbo-demo-xml/dubbo-demo-xml-provider/pom.xml
@@ -102,11 +102,6 @@
<artifactId>dubbo-serialization-fastjson2</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-rpc-triple</artifactId>
diff --git a/dubbo-distribution/dubbo-all-shaded/pom.xml
b/dubbo-distribution/dubbo-all-shaded/pom.xml
index 2e06f08271..eafb65386d 100644
--- a/dubbo-distribution/dubbo-all-shaded/pom.xml
+++ b/dubbo-distribution/dubbo-all-shaded/pom.xml
@@ -418,13 +418,6 @@
<scope>compile</scope>
<optional>true</optional>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- <optional>true</optional>
- </dependency>
<!-- Transitive dependencies -->
<dependency>
@@ -520,7 +513,6 @@
<include>org.apache.dubbo:dubbo-serialization-api</include>
<include>org.apache.dubbo:dubbo-serialization-hessian2</include>
<include>org.apache.dubbo:dubbo-serialization-fastjson2</include>
- <include>org.apache.dubbo:dubbo-serialization-jdk</include>
<include>org.apache.dubbo:dubbo-plugin-loom</include>
<include>io.netty:*</include>
</includes>
diff --git a/dubbo-distribution/dubbo-all/pom.xml
b/dubbo-distribution/dubbo-all/pom.xml
index b42a5dcc6a..2f7828fe80 100644
--- a/dubbo-distribution/dubbo-all/pom.xml
+++ b/dubbo-distribution/dubbo-all/pom.xml
@@ -418,13 +418,6 @@
<scope>compile</scope>
<optional>true</optional>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- <scope>compile</scope>
- <optional>true</optional>
- </dependency>
<!-- Transitive dependencies -->
<dependency>
@@ -519,7 +512,6 @@
<include>org.apache.dubbo:dubbo-serialization-api</include>
<include>org.apache.dubbo:dubbo-serialization-hessian2</include>
<include>org.apache.dubbo:dubbo-serialization-fastjson2</include>
- <include>org.apache.dubbo:dubbo-serialization-jdk</include>
<include>org.apache.dubbo:dubbo-plugin-loom</include>
</includes>
</artifactSet>
diff --git a/dubbo-distribution/dubbo-bom/pom.xml
b/dubbo-distribution/dubbo-bom/pom.xml
index 2e805de08f..4a0a8cc29d 100644
--- a/dubbo-distribution/dubbo-bom/pom.xml
+++ b/dubbo-distribution/dubbo-bom/pom.xml
@@ -462,11 +462,6 @@
<artifactId>dubbo-serialization-fastjson2</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- </dependency>
<!-- spring-boot -->
<dependency>
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/pom.xml
b/dubbo-rpc/dubbo-rpc-dubbo/pom.xml
index 660a701ea1..d78a4a3430 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/pom.xml
+++ b/dubbo-rpc/dubbo-rpc-dubbo/pom.xml
@@ -69,12 +69,6 @@
<version>${project.parent.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.parent.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>javax.validation</groupId>
diff --git a/dubbo-serialization/dubbo-serialization-jdk/pom.xml
b/dubbo-serialization/dubbo-serialization-jdk/pom.xml
deleted file mode 100644
index 53009e13c8..0000000000
--- a/dubbo-serialization/dubbo-serialization-jdk/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization</artifactId>
- <version>${revision}</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <packaging>jar</packaging>
- <name>${project.artifactId}</name>
- <description>The jdk serialization module of dubbo project</description>
- <properties>
- <skip_maven_deploy>false</skip_maven_deploy>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-api</artifactId>
- <version>${project.parent.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>hessian-lite</artifactId>
- </dependency>
- </dependencies>
-</project>
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedJavaSerialization.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedJavaSerialization.java
deleted file mode 100644
index b87e75c006..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedJavaSerialization.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.java;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.serialize.ObjectInput;
-import org.apache.dubbo.common.serialize.ObjectOutput;
-import org.apache.dubbo.common.serialize.Serialization;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import static
org.apache.dubbo.common.serialize.Constants.COMPACTED_JAVA_SERIALIZATION_ID;
-
-/**
- * Compacted java serialization implementation
- *
- * <pre>
- * e.g. <dubbo:protocol serialization="compactedjava" />
- * </pre>
- */
-public class CompactedJavaSerialization implements Serialization {
-
- @Override
- public byte getContentTypeId() {
- return COMPACTED_JAVA_SERIALIZATION_ID;
- }
-
- @Override
- public String getContentType() {
- return "x-application/compactedjava";
- }
-
- @Override
- public ObjectOutput serialize(URL url, OutputStream out) throws
IOException {
- return new JavaObjectOutput(out, true);
- }
-
- @Override
- public ObjectInput deserialize(URL url, InputStream is) throws IOException
{
- return new JavaObjectInput(is, true);
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedObjectInputStream.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedObjectInputStream.java
deleted file mode 100644
index 045fec3b14..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedObjectInputStream.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.java;
-
-import org.apache.dubbo.common.utils.ClassUtils;
-
-import java.io.EOFException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectStreamClass;
-import java.io.StreamCorruptedException;
-
-/**
- * Compacted java object input implementation
- */
-public class CompactedObjectInputStream extends ObjectInputStream {
- private ClassLoader mClassLoader;
-
- public CompactedObjectInputStream(InputStream in) throws IOException {
- this(in, Thread.currentThread().getContextClassLoader());
- }
-
- public CompactedObjectInputStream(InputStream in, ClassLoader cl) throws
IOException {
- super(in);
- mClassLoader = cl == null ? ClassUtils.getClassLoader() : cl;
- }
-
- @Override
- protected ObjectStreamClass readClassDescriptor() throws IOException,
ClassNotFoundException {
- int type = read();
- if (type < 0) {
- throw new EOFException();
- }
- switch (type) {
- case 0:
- return super.readClassDescriptor();
- case 1:
- Class<?> clazz = loadClass(readUTF());
- return ObjectStreamClass.lookup(clazz);
- default:
- throw new StreamCorruptedException("Unexpected class
descriptor type: " + type);
- }
- }
-
- private Class<?> loadClass(String className) throws ClassNotFoundException
{
- return mClassLoader.loadClass(className);
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedObjectOutputStream.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedObjectOutputStream.java
deleted file mode 100644
index d93108311a..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/CompactedObjectOutputStream.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.java;
-
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamClass;
-import java.io.OutputStream;
-
-/**
- * Compacted java object output implementation
- */
-public class CompactedObjectOutputStream extends ObjectOutputStream {
- public CompactedObjectOutputStream(OutputStream out) throws IOException {
- super(out);
- }
-
- @Override
- protected void writeClassDescriptor(ObjectStreamClass desc) throws
IOException {
- Class<?> clazz = desc.forClass();
- if (clazz.isPrimitive() || clazz.isArray()) {
- write(0);
- super.writeClassDescriptor(desc);
- } else {
- write(1);
- writeUTF(desc.getName());
- }
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaObjectInput.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaObjectInput.java
deleted file mode 100644
index bbdd02ffaf..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaObjectInput.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.java;
-
-import org.apache.dubbo.common.serialize.nativejava.NativeJavaObjectInput;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.lang.reflect.Type;
-
-/**
- * Java object input implementation
- */
-public class JavaObjectInput extends NativeJavaObjectInput {
- public static final int MAX_BYTE_ARRAY_LENGTH = 8 * 1024 * 1024;
-
- public JavaObjectInput(InputStream is) throws IOException {
- super(new ObjectInputStream(is));
- }
-
- public JavaObjectInput(InputStream is, boolean compacted) throws
IOException {
- super(compacted ? new CompactedObjectInputStream(is) : new
ObjectInputStream(is));
- }
-
- @Override
- public byte[] readBytes() throws IOException {
- int len = getObjectInputStream().readInt();
- if (len < 0) {
- return null;
- }
- if (len == 0) {
- return new byte[0];
- }
- if (len > MAX_BYTE_ARRAY_LENGTH) {
- throw new IOException("Byte array length too large. " + len);
- }
-
- byte[] b = new byte[len];
- getObjectInputStream().readFully(b);
- return b;
- }
-
- @Override
- public String readUTF() throws IOException {
- int len = getObjectInputStream().readInt();
- if (len < 0) {
- return null;
- }
-
- return getObjectInputStream().readUTF();
- }
-
- @Override
- public Object readObject() throws IOException, ClassNotFoundException {
- byte b = getObjectInputStream().readByte();
- if (b == 0) {
- return null;
- }
-
- return getObjectInputStream().readObject();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T> T readObject(Class<T> cls) throws IOException,
ClassNotFoundException {
- return (T) readObject();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T> T readObject(Class<T> cls, Type type) throws IOException,
ClassNotFoundException {
- return (T) readObject();
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaObjectOutput.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaObjectOutput.java
deleted file mode 100644
index 0e78747c91..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaObjectOutput.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.java;
-
-import org.apache.dubbo.common.serialize.nativejava.NativeJavaObjectOutput;
-
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-
-/**
- * Java object output implementation
- */
-public class JavaObjectOutput extends NativeJavaObjectOutput {
- public JavaObjectOutput(OutputStream os) throws IOException {
- super(new ObjectOutputStream(os));
- }
-
- public JavaObjectOutput(OutputStream os, boolean compact) throws
IOException {
- super(compact ? new CompactedObjectOutputStream(os) : new
ObjectOutputStream(os));
- }
-
- @Override
- public void writeUTF(String v) throws IOException {
- if (v == null) {
- getObjectOutputStream().writeInt(-1);
- } else {
- getObjectOutputStream().writeInt(v.length());
- getObjectOutputStream().writeUTF(v);
- }
- }
-
- @Override
- public void writeObject(Object obj) throws IOException {
- if (obj == null) {
- getObjectOutputStream().writeByte(0);
- } else {
- getObjectOutputStream().writeByte(1);
- getObjectOutputStream().writeObject(obj);
- }
- }
-
- @Override
- public void flushBuffer() throws IOException {
- getObjectOutputStream().flush();
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaSerialization.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaSerialization.java
deleted file mode 100644
index 1962ab4123..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/java/JavaSerialization.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.java;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
-import org.apache.dubbo.common.logger.LoggerFactory;
-import org.apache.dubbo.common.serialize.ObjectInput;
-import org.apache.dubbo.common.serialize.ObjectOutput;
-import org.apache.dubbo.common.serialize.Serialization;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static
org.apache.dubbo.common.constants.LoggerCodeConstants.PROTOCOL_UNSAFE_SERIALIZATION;
-import static
org.apache.dubbo.common.serialize.Constants.JAVA_SERIALIZATION_ID;
-
-/**
- * Java serialization implementation
- *
- * <pre>
- * e.g. <dubbo:protocol serialization="java" />
- * </pre>
- */
-public class JavaSerialization implements Serialization {
- private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(JavaSerialization.class);
- private static final AtomicBoolean warn = new AtomicBoolean(false);
-
- @Override
- public byte getContentTypeId() {
- return JAVA_SERIALIZATION_ID;
- }
-
- @Override
- public String getContentType() {
- return "x-application/java";
- }
-
- @Override
- public ObjectOutput serialize(URL url, OutputStream out) throws
IOException {
- if (warn.compareAndSet(false, true)) {
- logger.error(
- PROTOCOL_UNSAFE_SERIALIZATION,
- "",
- "",
- "Java serialization is unsafe. Dubbo Team do not recommend
anyone to use it."
- + "If you still want to use it, please follow [JEP
290](https://openjdk.java.net/jeps/290)"
- + "to set serialization filter to prevent
deserialization leak.");
- }
- return new JavaObjectOutput(out);
- }
-
- @Override
- public ObjectInput deserialize(URL url, InputStream is) throws IOException
{
- if (warn.compareAndSet(false, true)) {
- logger.error(
- PROTOCOL_UNSAFE_SERIALIZATION,
- "",
- "",
- "Java serialization is unsafe. Dubbo Team do not recommend
anyone to use it."
- + "If you still want to use it, please follow [JEP
290](https://openjdk.java.net/jeps/290)"
- + "to set serialization filter to prevent
deserialization leak.");
- }
- return new JavaObjectInput(is);
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaObjectInput.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaObjectInput.java
deleted file mode 100644
index 74431832ff..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaObjectInput.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.nativejava;
-
-import org.apache.dubbo.common.serialize.ObjectInput;
-import org.apache.dubbo.common.utils.Assert;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.lang.reflect.Type;
-
-/**
- * Native java object input implementation
- */
-public class NativeJavaObjectInput implements ObjectInput {
-
- private final ObjectInputStream inputStream;
-
- public NativeJavaObjectInput(InputStream is) throws IOException {
- this(new ObjectInputStream(is));
- }
-
- protected NativeJavaObjectInput(ObjectInputStream is) {
- Assert.notNull(is, "input == null");
- inputStream = is;
- }
-
- protected ObjectInputStream getObjectInputStream() {
- return inputStream;
- }
-
- @Override
- public Object readObject() throws IOException, ClassNotFoundException {
- return inputStream.readObject();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T> T readObject(Class<T> cls) throws IOException,
ClassNotFoundException {
- return (T) readObject();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public <T> T readObject(Class<T> cls, Type type) throws IOException,
ClassNotFoundException {
- return (T) readObject();
- }
-
- @Override
- public boolean readBool() throws IOException {
- return inputStream.readBoolean();
- }
-
- @Override
- public byte readByte() throws IOException {
- return inputStream.readByte();
- }
-
- @Override
- public short readShort() throws IOException {
- return inputStream.readShort();
- }
-
- @Override
- public int readInt() throws IOException {
- return inputStream.readInt();
- }
-
- @Override
- public long readLong() throws IOException {
- return inputStream.readLong();
- }
-
- @Override
- public float readFloat() throws IOException {
- return inputStream.readFloat();
- }
-
- @Override
- public double readDouble() throws IOException {
- return inputStream.readDouble();
- }
-
- @Override
- public String readUTF() throws IOException {
- return inputStream.readUTF();
- }
-
- @Override
- public byte[] readBytes() throws IOException {
- int len = inputStream.readInt();
- if (len < 0) {
- return null;
- } else if (len == 0) {
- return new byte[] {};
- } else {
- byte[] result = new byte[len];
- inputStream.readFully(result);
- return result;
- }
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaObjectOutput.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaObjectOutput.java
deleted file mode 100644
index a3274094db..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaObjectOutput.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.nativejava;
-
-import org.apache.dubbo.common.serialize.ObjectOutput;
-import org.apache.dubbo.common.utils.Assert;
-
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-
-/**
- * Native java object output implementation
- */
-public class NativeJavaObjectOutput implements ObjectOutput {
-
- private final ObjectOutputStream outputStream;
-
- public NativeJavaObjectOutput(OutputStream os) throws IOException {
- this(new ObjectOutputStream(os));
- }
-
- protected NativeJavaObjectOutput(ObjectOutputStream out) {
- Assert.notNull(out, "output == null");
- this.outputStream = out;
- }
-
- protected ObjectOutputStream getObjectOutputStream() {
- return outputStream;
- }
-
- @Override
- public void writeObject(Object obj) throws IOException {
- outputStream.writeObject(obj);
- }
-
- @Override
- public void writeBool(boolean v) throws IOException {
- outputStream.writeBoolean(v);
- }
-
- @Override
- public void writeByte(byte v) throws IOException {
- outputStream.writeByte(v);
- }
-
- @Override
- public void writeShort(short v) throws IOException {
- outputStream.writeShort(v);
- }
-
- @Override
- public void writeInt(int v) throws IOException {
- outputStream.writeInt(v);
- }
-
- @Override
- public void writeLong(long v) throws IOException {
- outputStream.writeLong(v);
- }
-
- @Override
- public void writeFloat(float v) throws IOException {
- outputStream.writeFloat(v);
- }
-
- @Override
- public void writeDouble(double v) throws IOException {
- outputStream.writeDouble(v);
- }
-
- @Override
- public void writeUTF(String v) throws IOException {
- outputStream.writeUTF(v);
- }
-
- @Override
- public void writeBytes(byte[] v) throws IOException {
- if (v == null) {
- outputStream.writeInt(-1);
- } else {
- writeBytes(v, 0, v.length);
- }
- }
-
- @Override
- public void writeBytes(byte[] v, int off, int len) throws IOException {
- if (v == null) {
- outputStream.writeInt(-1);
- } else {
- outputStream.writeInt(len);
- outputStream.write(v, off, len);
- }
- }
-
- @Override
- public void flushBuffer() throws IOException {
- outputStream.flush();
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaSerialization.java
b/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaSerialization.java
deleted file mode 100644
index ea37e998a8..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/java/org/apache/dubbo/common/serialize/nativejava/NativeJavaSerialization.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.dubbo.common.serialize.nativejava;
-
-import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
-import org.apache.dubbo.common.logger.LoggerFactory;
-import org.apache.dubbo.common.serialize.ObjectInput;
-import org.apache.dubbo.common.serialize.ObjectOutput;
-import org.apache.dubbo.common.serialize.Serialization;
-import org.apache.dubbo.common.serialize.java.JavaSerialization;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static
org.apache.dubbo.common.constants.LoggerCodeConstants.PROTOCOL_UNSAFE_SERIALIZATION;
-import static
org.apache.dubbo.common.serialize.Constants.NATIVE_JAVA_SERIALIZATION_ID;
-
-/**
- * Native java serialization implementation
- *
- * <pre>
- * e.g. <dubbo:protocol serialization="nativejava" />
- * </pre>
- */
-public class NativeJavaSerialization implements Serialization {
- private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(JavaSerialization.class);
- private static final AtomicBoolean warn = new AtomicBoolean(false);
-
- @Override
- public byte getContentTypeId() {
- return NATIVE_JAVA_SERIALIZATION_ID;
- }
-
- @Override
- public String getContentType() {
- return "x-application/nativejava";
- }
-
- @Override
- public ObjectOutput serialize(URL url, OutputStream output) throws
IOException {
- if (warn.compareAndSet(false, true)) {
- logger.error(
- PROTOCOL_UNSAFE_SERIALIZATION,
- "",
- "",
- "Java serialization is unsafe. Dubbo Team do not recommend
anyone to use it."
- + "If you still want to use it, please follow [JEP
290](https://openjdk.java.net/jeps/290)"
- + "to set serialization filter to prevent
deserialization leak.");
- }
- return new NativeJavaObjectOutput(output);
- }
-
- @Override
- public ObjectInput deserialize(URL url, InputStream input) throws
IOException {
- if (warn.compareAndSet(false, true)) {
- logger.error(
- PROTOCOL_UNSAFE_SERIALIZATION,
- "",
- "",
- "Java serialization is unsafe. Dubbo Team do not recommend
anyone to use it."
- + "If you still want to use it, please follow [JEP
290](https://openjdk.java.net/jeps/290)"
- + "to set serialization filter to prevent
deserialization leak.");
- }
- return new NativeJavaObjectInput(input);
- }
-}
diff --git
a/dubbo-serialization/dubbo-serialization-jdk/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization
b/dubbo-serialization/dubbo-serialization-jdk/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization
deleted file mode 100644
index bc1e4ef00d..0000000000
---
a/dubbo-serialization/dubbo-serialization-jdk/src/main/resources/META-INF/dubbo/internal/org.apache.dubbo.common.serialize.Serialization
+++ /dev/null
@@ -1,3 +0,0 @@
-java=org.apache.dubbo.common.serialize.java.JavaSerialization
-compactedjava=org.apache.dubbo.common.serialize.java.CompactedJavaSerialization
-nativejava=org.apache.dubbo.common.serialize.nativejava.NativeJavaSerialization
\ No newline at end of file
diff --git a/dubbo-serialization/pom.xml b/dubbo-serialization/pom.xml
index 0fed5f14fc..079f6710ec 100644
--- a/dubbo-serialization/pom.xml
+++ b/dubbo-serialization/pom.xml
@@ -30,7 +30,6 @@
<modules>
<module>dubbo-serialization-api</module>
<module>dubbo-serialization-hessian2</module>
- <module>dubbo-serialization-jdk</module>
<module>dubbo-serialization-fastjson2</module>
</modules>
<properties>
diff --git a/dubbo-test/dubbo-dependencies-all/pom.xml
b/dubbo-test/dubbo-dependencies-all/pom.xml
index 1955d20c2d..30a4f583eb 100644
--- a/dubbo-test/dubbo-dependencies-all/pom.xml
+++ b/dubbo-test/dubbo-dependencies-all/pom.xml
@@ -355,11 +355,6 @@
<artifactId>dubbo-serialization-fastjson2</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- </dependency>
<!-- spring-boot -->
<dependency>
diff --git a/dubbo-test/dubbo-test-spring/pom.xml
b/dubbo-test/dubbo-test-spring/pom.xml
index 3cfab27e72..b7164f413f 100644
--- a/dubbo-test/dubbo-test-spring/pom.xml
+++ b/dubbo-test/dubbo-test-spring/pom.xml
@@ -124,11 +124,6 @@
<artifactId>dubbo-serialization-fastjson2</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.dubbo</groupId>
- <artifactId>dubbo-serialization-jdk</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>