NutzCN Logo
问答 nutzwk中调用insertOrUpdate出现序列化问题,请指教
发布于 1855天前 作者 baocj 1581 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk
 @Async
    public void sync(BaseModel o) {
        try {
            if (o instanceof Md_curve_energy) {
                //保存电量
                mdCurveEnergyService.insertOrUpdate(o);
                log.debug("电量保存成功");
            } else if (o instanceof Md_curve_ins) {


                mdCurveInsService.insertOrUpdate(o, null, FieldFilter.create(Md_curve_ins.class, true));

                log.debug("瞬时量保存成功");
            } else if (o instanceof Eics_terminal) {

            } else if (o instanceof Iot_frame_up) {
                iotFrameUpService.insert(o);//插入报文
                log.debug("上行报文保存成功");
                upTermInfo(o);//更新终端数据
                log.debug("更新终端最近通讯成功");
            } else {
                //do nothing
            }


        } catch (Throwable e) {
            log.info("insert data sync fail", e);
        }
    }
[INFO ] 22:13:02.520 [pool-2-thread-5] cn.wizzer.app.bp.modules.gw376.save.Save376Data - insert data sync fail
com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method insertOrUpdate in the service cn.wizzer.app.eics.modules.services.MdCurveInsService. Tried 3 times of the providers [192.168.1.57:15121] (1/1) from the registry 192.168.1.196:8848 on the consumer 192.168.1.57 using the dubbo version 2.6.6. Last error is: Failed to invoke remote method: insertOrUpdate, provider: dubbo://192.168.1.57:15121/cn.wizzer.app.eics.modules.services.MdCurveInsService?anyhost=true&application=wk-nb-service-bp-376&category=providers&check=false&dubbo=2.0.2&generic=false&interface=cn.wizzer.app.eics.modules.services.MdCurveInsService&methods=updateWithVersion,data,insertRelation,insertWith,insertOrUpdate,dao,getMaxId,getSubPath,query,count,getField,vDelete,listEntity,list,execute,fetchx,getMap,updateAndIncrIfMatch,updateLinks,getEntityClass,fetchLinks,updateRelation,fastInsert,update,insert,insertLinks,getParentPath,delete,updateIgnoreNull,listPageLinks,clear,getEntity,updateWith,fetch,getNutMap,exists,listPageMap,listPage&pid=2087&protocol=dubbo&qos.enable=false&register.ip=192.168.1.57&remote.timestamp=1571926303577&side=consumer&timestamp=1571926376235, cause: io.netty.handler.codec.EncoderException: java.lang.IllegalStateException: Serialized class org.nutz.dao.FieldFilter must implement java.io.Serializable
io.netty.handler.codec.EncoderException: java.lang.IllegalStateException: Serialized class org.nutz.dao.FieldFilter must implement java.io.Serializable
	at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:125)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:716)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:708)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:791)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:701)
	at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115)
	at com.alibaba.dubbo.remoting.transport.netty4.NettyClientHandler.write(NettyClientHandler.java:85)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:716)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:708)
	at io.netty.channel.AbstractChannelHandlerContext.access$1700(AbstractChannelHandlerContext.java:56)
	at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:1102)
	at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:1149)
	at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1073)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:416)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:515)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Serialized class org.nutz.dao.FieldFilter must implement java.io.Serializable
	at com.alibaba.com.caucho.hessian.io.SerializerFactory.getDefaultSerializer(SerializerFactory.java:401)
	at com.alibaba.com.caucho.hessian.io.SerializerFactory.getSerializer(SerializerFactory.java:375)
	at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:389)
	at com.alibaba.dubbo.common.serialize.hessian2.Hessian2ObjectOutput.writeObject(Hessian2ObjectOutput.java:88)
	at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.encodeRequestData(DubboCodec.java:183)
	at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encodeRequest(ExchangeCodec.java:235)
	at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:72)
	at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:38)
	at com.alibaba.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:70)
	at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)
	... 19 more

	at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:102)
	at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:244)
	at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:75)
	at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:52)
	at com.alibaba.dubbo.common.bytecode.proxy4.insertOrUpdate(proxy4.java)
	at cn.wizzer.app.bp.modules.gw376.save.Save376Data.sync(Save376Data.java:129)
	at cn.wizzer.app.bp.modules.gw376.save.Save376Data$$NUTZAOP._aop_invoke(Save376Data.java:1)
	at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57)
	at org.nutz.aop.interceptor.async._async_task.call(AsyncMethodInterceptor.java:43)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
1 回复

这些dubbo服务对象,不要直接调用它们的Dao接口的方法

要封装成service接口的业务方法

添加回复
请先登陆
回到顶部