CLOB字段 JPA配置后台报错,求大神

问题描述

实体类属性配置如下:@Lob@Basic(fetch=FetchType.LAZY)@Column(name="NOTICE_CONTENT",columnDefinition="CLOB",nullable=true)publicStringgetNoticeContent(){returnnoticeContent;}或@Lob@Type(type="org.springframework.orm.hibernate3.support.ClobStringType")@Column(name="NOTICE_CONTENT",columnDefinition="CLOB")publicStringgetNoticeContent(){returnnoticeContent;}数据库中NOTICE_CONTENT的字段定义为clob;Java类里通过方法查询表中的信息时报错如下:严重:Servlet.service()forservletjspthrewexceptionjava.lang.IllegalStateException:Cannotconvertvalueoftype[com.sun.proxy.$Proxy47implementingjava.sql.Clob,org.hibernate.engine.jdbc.WrappedClob,java.io.Serializable]torequiredtype[java.lang.String]forproperty'noticeContent':nomatchingeditorsorconversionstrategyfoundatorg.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:264)atorg.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:448)atorg.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:494)atorg.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1097)atorg.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:882)。。。。。。Causedby:ognl.MethodFailedException:Method"queryBaseInfo"failedforobjectcom.xx.xxx.notice.action.NoticeInfoAction@2f6a54dfatcom.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.callMethod(CompoundRootAccessor.java:244)~[xwork-core-2.3.4.jar:2.3.4]atognl.OgnlRuntime.callMethod(OgnlRuntime.java:1353)~[ognl-3.0.5.jar:na]atognl.ASTMethod.getValueBody(ASTMethod.java:90)~[ognl-3.0.5.jar:na]atognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)~[ognl-3.0.5.jar:na]atognl.SimpleNode.getValue(SimpleNode.java:258)~[ognl-3.0.5.jar:na]atognl.Ognl.getValue(Ognl.java:494)~[ognl-3.0.5.jar:na]atognl.Ognl.getValue(Ognl.java:596)~[ognl-3.0.5.jar:na]atognl.Ognl.getValue(Ognl.java:566)~[ognl-3.0.5.jar:na].....Causedby:org.springframework.beans.ConversionNotSupportedException:Failedtoconvertpropertyvalueoftype'com.sun.proxy.$Proxy47implementingjava.sql.Clob,org.hibernate.engine.jdbc.WrappedClob,java.io.Serializable'torequiredtype'java.lang.String'forproperty'noticeContent';nestedexceptionisjava.lang.IllegalStateException:Cannotconvertvalueoftype[com.sun.proxy.$Proxy47implementingjava.sql.Clob,org.hibernate.engine.jdbc.WrappedClob,java.io.Serializable]torequiredtype[java.lang.String]forproperty'noticeContent':nomatchingeditorsorconversionstrategyfoundatorg.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:463)~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]atorg.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:494)~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]atorg.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1097)~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]atorg.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:882)~[spring-beans-3.2.3.RELEASE.jar:3.2.3.RELEASE]。。。。。。。。。

解决方案

时间: 2024-08-31 00:40:31

CLOB字段 JPA配置后台报错,求大神的相关文章

spring 配置dubbo报错 求大神指导

问题描述 Multiple annotations found at this line:- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'dubbo:module'.- schema_reference.4: Failed to read schema document 'http://code.alibabatech.com/schem

大数据-orcale大量数据分组查询报错求大神指点

问题描述 orcale大量数据分组查询报错求大神指点 对一个表数据进行分组查询,但是数据量太大了,当时是3000w条,跑着就报错了,数据库内部错误,也不是很懂.想请教下group by的时候是否数据量太多会报错,如果是它可以承受多大的数据量分组查询. 解决方案 肯定会报错,数据量大就会请求超时 解决方案二: 建议使用索引,给需要分组的字段加索引 解决方案三: 你可以试试根据你当前数据库的配置情况,进行分组查询的时候,使用多线程的方式进行查询 例如: select /*+ parallel(t,1

用的spring mvc 添加了分页 功能后一直报错 求大神解决

问题描述 用的spring mvc 添加了分页 功能后一直报错 求大神解决 org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver]Resolving exception from handler [com.app.controller.ManageController@185c0de]: java.lang.NumberFormatException: For input s

虚拟机下构架hadoop测试跑wordcount报错,求大神帮帮忙.

问题描述 虚拟机下构架hadoop测试跑wordcount报错,求大神帮帮忙. 用虚拟机虚拟一台namenode,三台datanode,配置完成可以运行起来,也可以在网页中查看状态,但是跑wordcount时出现了task id:attempt_1441184180788_0001 status:failed的错误,也没有抛出,实在没有办法,具体问题截屏如下,望大神们给予帮助 解决方案 http://www.cnblogs.com/madyina/p/3708153.html 解决方案二: 几台

node js-linux下安装node.js报错,求大神解决

问题描述 linux下安装node.js报错,求大神解决 目前正要部署应用到linux服务器上 在安装node.js时各种报错,首先是python版本问题,后来装了python2.7.5, 在执行./configure时,出现这个错误 ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/local/lib/python2.7/hashlib.py", line

<mvc:default-servlet-handler/>报错 求大神解答

问题描述 <mvc:default-servlet-handler/>报错 求大神解答 我从新导入的项目 在原来的机子上没有问题 但是导入到新的机子就有问题了 不能识别mvc:default-servlet-handler/标签 报错:cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:default-servlet-handler/&

Genymoation安装之后打开虚拟机报错求大神指点

问题描述 Genymoation安装之后打开虚拟机报错求大神指点 错误是这样的 求大神指点,谢谢 解决方案 多启动几次,如果还不行,就启动virtualbox,在里面看看对应的虚拟机是否正常可以启动,或者先关掉它

树形 递归-java 递归报错 求大神帮忙

问题描述 java 递归报错 求大神帮忙 private List<Post> getPostLower(List<Post> PostTops){ List<Post> postAll=new ArrayList<Post>(); // 上级 for(Post post:PostTops){ //查询到下级 List<Post> posts=basService.queryPostByParentId(post.getPostId()); //

mac 下编译 ffmpeg的 libaacplus-2.0.2 总是报错求大神解决办法,谁能教我再mac下编译ffmpeg也行

问题描述 mac 下编译 ffmpeg的 libaacplus-2.0.2 总是报错求大神解决办法,谁能教我再mac下编译ffmpeg也行 make[2]: Nothing to be done for `all'. Making all in frontend gcc -DHAVE_CONFIG_H -I. -I.. -I../include -I../src -g -O2 -c -o main.o main.c main.c:89:46: warning: data argument not