diff --git a/pom.xml b/pom.xml index 6d58078..e172f81 100644 --- a/pom.xml +++ b/pom.xml @@ -22,6 +22,7 @@ 1.0.0-SNAPSHOT 1.0.0-SNAPSHOT + 1.9.13 4.1.24.Final 5.0.5.RELEASE @@ -48,6 +49,12 @@ ${overflow.crawler-java.version} + + org.codehaus.jackson + jackson-mapper-asl + ${jackson.mapper.version} + + io.netty netty-handler diff --git a/src/main/java/com/loafle/overflow/container/configuration/ContainerConfiguration.java b/src/main/java/com/loafle/overflow/container/configuration/ContainerConfiguration.java index 12920c4..4ae6747 100644 --- a/src/main/java/com/loafle/overflow/container/configuration/ContainerConfiguration.java +++ b/src/main/java/com/loafle/overflow/container/configuration/ContainerConfiguration.java @@ -14,6 +14,7 @@ import com.loafle.commons.server.socket.handler.codec.SocketServerProtocolHandle import com.loafle.overflow.container.Container; import com.loafle.overflow.container.server.handler.RPCServerHandler; +import org.codehaus.jackson.map.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; @@ -46,7 +47,7 @@ public class ContainerConfiguration { private RPCServerHandler rpcServerHandler; @Autowired(required = false) - private Gson gson; + private ObjectMapper objectMapper; @Bean(Server.CHANNEL_CLASS) public Class channelClass() { @@ -65,11 +66,7 @@ public class ContainerConfiguration { @Bean(Container.RPC_SERVER_CODEC) public RPCServerCodec rpcServerCodec() { - if (null != gson) { - return new JSONRPCServerCodec(gson); - } else { - return new JSONRPCServerCodec(); - } + return new JSONRPCServerCodec(this.objectMapper); } @Bean({Container.RPC_INVOKER, Container.RPC_REGISTRY})