zoukankan      html  css  js  c++  java
  • Class org.apache.struts2.json.JSONWriter can not access a member of class oracle.jdbc.driver.Physica

    产生这个错误的原因是因为我的oracle数据库中有一个CLOB字段,查询出来的时候要转换为JSON而报错。

    Class org.apache.struts2.json.JSONWriter can not access a member of class oracle.jdbc.driver.PhysicalConnection with modifiers "public"


    取出来的JSON数据是这样的
    [{STATE=0, REUSER=a, ANONYMIS=否, TEXT=oracle.sql.CLOB@40a04430, CHANNELTYPE=用户交互, ID=1111, OPENIS=是}]

    TEXT=oracle.sql.CLOB@40a04430因为它无法转成json
    处理方法网上查了一大堆,大部分都是说Json Plugin会序列化整个Action
    <result type="json"></result>中添加includePropertiesexcludeProperties过滤掉不需要被序列号的属性。觉得有些复杂,可能还要用一些正则之类的。而我不需要过滤,而是正需要那个CLOB值。

    解决办法是在oracle取数据的时候就直接将CLOB转换成varchar2类型
    TO_CHAR(text)

  • 相关阅读:
    Kafka 生产者 自定义分区策略
    同步互斥
    poj 1562 Oil Deposits(dfs)
    poj 2386 Lake Counting(dfs)
    poj 1915 KnightMoves(bfs)
    poj 1664 放苹果(dfs)
    poj 1543 Perfect Cubes (暴搜)
    poj 1166 The Clocks (暴搜)
    poj 3126 Prime Path(bfs)
    处理机调度
  • 原文地址:https://www.cnblogs.com/itmyhome/p/4131376.html
Copyright © 2011-2022 走看看