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

dubbo 服务提供者使用JPA 一对多关联,并关闭懒加载查询时,消费者调用服务抛出com.alibaba.com.caucho.hessian.io.HessianFieldException #2069

Closed
13289872326 opened this issue Jul 12, 2018 · 4 comments
Labels
type/bug Bugs to being fixed
Milestone

Comments

@13289872326
Copy link

[DEBUG] [2018-07-12 14:58:45,030] [http-nio-9306-exec-7] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254): Returning cached instance of singleton bean 'basicErrorController'
[DEBUG] [2018-07-12 14:58:45,047] [http-nio-9306-exec-7] org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:277): Written [{timestamp=Thu Jul 12 14:58:45 CST 2018, status=500, error=Internal Server Error, message=Failed to invoke the method listAllCustomOrdersByCustomNoAndState in the service com.hlink.merchant.order.service.OrderQueryService. Tried 2 times of the providers [192.168.50.100:8109] (1/1) from the registry 192.168.50.241:2181 on the consumer 192.168.50.236 using the dubbo version 2.6.1. Last error is: Failed to invoke remote method: listAllCustomOrdersByCustomNoAndState, provider: dubbo://192.168.50.100:8109/com.hlink.merchant.order.service.OrderQueryService?anyhost=true&application=DC-WEB-Store&check=false&default.service.filter=merchantDubboFilter&default.timeout=10000&dubbo=2.6.2&generic=false&interface=com.hlink.merchant.order.service.OrderQueryService&methods=listAllOrderOneDayNeedPrint,listOrderByTableIdToday,listHistoryAllOrder,listHistoryOrderOneMonth,listHistoryOrderOneWeek,searchOrderByOrderNo,listAllOrder,listAllOrderTodayByPrintAndPayState,getOrderPayState,getByOrderNo,listOrderByTableNameToday,listAllCustomOrdersByCustomNoAndState,listAllCustomOrdersByCustomNoToday,listOrderByLastOrderNo,listAllCustomOrdersByCustomNo,listOrderByLastOrderTime,listAllOrderToday,listOrderLog&pid=7540&register.ip=192.168.50.236&remote.timestamp=1531374823311&retries=1&side=consumer&timeout=3000&timestamp=1531359418921, cause: com.alibaba.com.caucho.hessian.io.HessianFieldException: com.hlink.merchant.order.entity.Order.orderItemSet: java.util.Set cannot be assigned from null
com.alibaba.com.caucho.hessian.io.HessianFieldException: com.hlink.merchant.order.entity.Order.orderItemSet: java.util.Set cannot be assigned from null
at com.alibaba.com.caucho.hessian.io.JavaDeserializer.logDeserializeError(JavaDeserializer.java:173)
at com.alibaba.com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:408)
at com.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:273)
at com.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:200)
at com.alibaba.com.caucho.hessian.io.SerializerFactory.readObject(SerializerFactory.java:525)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2791)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2731)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2260)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2705)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2260)
at com.alibaba.com.caucho.hessian.io.CollectionDeserializer.readLengthList(CollectionDeserializer.java:119)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2163)
at com.alibaba.com.caucho.hessian.io.JavaDeserializer$ObjectListFieldDeserializer.deserialize(JavaDeserializer.java:516)
at com.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:273)
at com.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:200)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2789)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2128)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2057)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2101)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2057)
at com.alibaba.dubbo.common.serialize.hessian2.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:80)
at com.alibaba.dubbo.common.serialize.hessian2.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:84)
at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:81)
at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:110)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:88)
at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:121)
at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:82)
at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:44)
at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalDecoder.messageReceived(NettyCodecAdapter.java:133)
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
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)
Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection, could not initialize proxy - no Session
at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:582)
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:201)
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:561)
at org.hibernate.collection.internal.PersistentSet.add(PersistentSet.java:185)
at com.alibaba.com.caucho.hessian.io.CollectionDeserializer.readLengthList(CollectionDeserializer.java:119)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2163)
at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2057)
at com.alibaba.com.caucho.hessian.io.JavaDeserializer$ObjectFieldDeserializer.deserialize(JavaDeserializer.java:404)
... 42 more
, path=/order/user/4028b2e4643f49a80164400d99420010/orderform_u}] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@587e5365]
[DEBUG] [2018-07-12 14:58:45,048] [http-nio-9306-exec-7] org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1076): Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
[DEBUG] [2018-07-12 14:58:45,048] [http-nio-9306-exec-7] org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1000): Successfully completed request

@13289872326
Copy link
Author

此异常抛出极不规律,时有时无,时好时坏,极其影响正常的业务开发,恳请贵方提供一个良好的解决方案

@lovepoem
Copy link
Member

A bug same as :
#146

@lovepoem
Copy link
Member

lovepoem commented Jul 12, 2018

What's the dubbo version of your project ? @13289872326
I fix it in apache/dubbo-hessian-lite#2, it belongs to 2.7.x
Next I will patch it to the 2.5.x and 2.6.x branches;

diecui1202 pushed a commit to apache/dubbo-hessian-lite that referenced this issue Jul 13, 2018
* fix Set Vector Serialize data lost apache/dubbo#2069 apache/dubbo#146

* update .travis.yml

* update

* update test

* update test

* update test

* change travis jdk version
@lovepoem
Copy link
Member

lovepoem commented Jul 13, 2018

close this via apache/dubbo-hessian-lite#2. You can have a try

@lovepoem lovepoem added this to the 2.6.4 milestone Jul 14, 2018
@diecui1202 diecui1202 modified the milestones: 2.6.4, 2.6.3 Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Bugs to being fixed
Projects
None yet
Development

No branches or pull requests

3 participants