`
xjj1314
  • 浏览: 647 次
文章分类
社区版块
存档分类
最新评论

求解java.lang.IllegalStateException: getOutputStream() has already be

 
阅读更多

情况:

控制台打出java.lang.IllegalStateException: getOutputStream() has already been called for this response,页面没反应。

使用架构:easyui+sping3 MVC + jpa

页面用easyui-datagrid 查询并展示一个列表。

数据表结构:

order(

orderid

)

order_detail(

orderDetailId,

orderId

)


实体配置:

@Entity
@Table(name="ORDER")
@JsonIgnoreProperties( value={"hibernateLazyInitializer","handler"})
public class OrderBO extends BaseEntity {
    
    @Id  
    private String orderId;
    
    @OneToOne(targetEntity=OrderDetailBO.class,optional = true,fetch=FetchType.LAZY)
    @JoinColumn(name="orderId",insertable=true,updatable=true)
    private OrderDetailBO orderDetailBO;        
}

@Entity
@Table(name="ORDER_DETAIL")
@JsonIgnoreProperties( value={"hibernateLazyInitializer","handler"})
public class OrderDetailBO  extends BaseEntity{
    
    @Id      
    private String orderDetailId;
    private String orderId;    
    
    @OneToOne(targetEntity=OrderBO.class,optional = true,fetch=FetchType.LAZY)
    @JoinColumn(name="orderId",insertable=true,updatable=true)
    private OrderBO orderBO;        
}

service层查询hql:
select new map(orderDetailBo as orderDetailBo,orderDetailBo.orderDetailId as uid)
from OrderDetailBO orderDetailBo,OrdersBO ordersBo
where orderDetailBo.orderId = ordersBo.orderId

查询结果Map 返回页面报错java.lang.IllegalStateException: getOutputStream() has already been called for this response

经过反复调试,需要设置orderDetailBo.getOrderBO().setOrderDetailBO(null)可以解决。

为什么会是这样,请高手求解!!!

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics