- 浏览: 23248 次
- 性别:
- 来自: 烟台
最新评论
Bean property 'lobHandler' is not writable or has an invalid setter method.
错误描述
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'lobHandler' of bean class [org.springframework.orm.hibernate4.LocalSessionFactoryBean]: Bean property 'lobHandler' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1427)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:589)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'lobHandler' of bean class [org.springframework.orm.hibernate4.LocalSessionFactoryBean]: Bean property 'lobHandler' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1044)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:904)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1424)
... 22 more
解决方法:将spring配置文件applicationContext.xml中的<bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true">
修改为
<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true">
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'lobHandler' of bean class [org.springframework.orm.hibernate4.LocalSessionFactoryBean]: Bean property 'lobHandler' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1427)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:589)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'lobHandler' of bean class [org.springframework.orm.hibernate4.LocalSessionFactoryBean]: Bean property 'lobHandler' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1044)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:904)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1424)
... 22 more
解决方法:将spring配置文件applicationContext.xml中的<bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true">
修改为
<bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true">
发表评论
-
ClassNotFoundException: org.springframework.web.context.ContextLoaderListener解决
2018-04-13 11:22 1462在搭建的时候,运行Tomcat就如下错误。错误描述:严重: ... -
ApplicationEventMulticaster not initialized和LifecycleProcessor not initialized解决
2018-04-13 10:49 729错误描述:java.lang.IllegalStateExce ... -
自定义404错误页面
2018-01-29 15:39 346为了让程序具有更好 ... -
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized
2018-01-25 15:20 1386[11-15 11:34:44][localhost-st ... -
No result defined for action xxx.EmployeeAction and result xxx
2018-01-24 18:29 605警告: Could not find action or r ... -
spring注解@Autowired、@Resource的区别
2018-01-24 16:11 5651、@Autowired与@Resource都可以用来注入 ... -
spring注解@Component、@Repository、@Service、@Controller的区别
2018-01-24 15:48 475现在Web应用程序绝大多数都是采用了经典的三层分层结构,因 ... -
spring注解@Service注解的使用
2018-01-24 14:36 2669要说明@Service注解的使用,就得说一下我们经常在s ... -
Struts2中Action由Struts2自己管理与由Spring管理的区别(转自别人)
2018-01-24 10:46 509struts2单独使用时,Action实例由struts2 ... -
Disabling contextual LOB creation as createClob() method threw error
2018-01-23 10:57 2159问题描述(红色java.lang.reflect.Invoca ... -
Unable to load configuration. - [unknown location]
2018-01-23 10:42 747问题描述: 严重: Dispatcher initializa ... -
在搭建过程中需要注意的一些小细节梳理
2018-01-23 09:54 362我是在Eclipse的Mars版本中进行搭建的,针对整合过程中 ... -
未找到类: org/apache/commons/io/FileUtils和org.apache.commons.lang3.StringUtils
2018-01-23 10:12 1543问题描述: 警告: Could not create JarE ... -
java.lang.NoClassDefFoundError: org/hibernate/engine/SessionFactoryImplementor
2018-01-23 08:48 776问题描述: 严重: Context initializatio ... -
java.lang.NoClassDefFoundError: Lorg/hibernate/cache/CacheProvider;问题解决
2018-01-22 16:42 1485搭建SSH(Struts2、Spring3、Hibernate ...
相关推荐
在Spring配置文件中,你需要创建一个`SessionFactory` bean,同时指定一个`lobHandler`属性,用于处理CLOB和BLOB类型的数据。这确保了Spring和Hibernate能够正确地与Oracle数据库交互处理大对象。 ```xml <bean ...
在配置完LobHandler后, 还需要将其注入到sessionFactory的Bean中,下面是调用后的sessionFactory Bean的配置: 代码 6 将lobHandler注入到sessionFactory中的配置 1. 2. … 3. <bean id="sessionFactory" 4. ...
LobHandler LobRetrievalFailureException LocalConnectionFactoryBean LocalContainerEntityManagerFactoryBean LocalDataSourceConnectionProvider LocalDataSourceConnectionProvider ...
<property name="lobHandler" ref="oracleLobHandlerBank" /> <!-- 其他Hibernate配置 --> </bean> ``` 5. **映射文件配置**: Hibernate使用HBM(Hibernate Mapping File)或XML/Annotated Entity Class来...
nested exception is org.hibernate.exception.ConstraintViolationException 此错误表示在执行批量更新操作时违反了数据库约束,可能是外键约束、唯一性约束等。检查相关的SQL语句和数据库结构,确保没有违反任何...
<property name="lobHandler" ref="lobHandler"/> </bean> ``` 其中,`hibernate.jdbc.batch_size`设置为0表示禁用批处理,这对于处理CLOB字段尤为重要,因为批处理可能会导致CLOB数据被截断。 #### 三、...
<property name="lobHandler"><ref bean="oracleLobHandler" /></property> </bean> <bean id="admindao" class="dao.impl.AdminDaoImpl"> <property name="sessionFactory" ref="sessionFactory"></property> </...
' is unrecognized or represents more than one time zone.`的错误时,这是由于服务器时间区域值未被正确识别或者表示多个时区。解决方法是在JDBC URL后面添加`serverTimezone`参数,将其值设置为`UTC`或其他特定...
2.jdbc.property填写正确 3.项目加载 运行 这里你将学习到: 前台: 公共类库 Juqery 公共组件 表格:jqueryeasyui datagrid 代码树:ztree 后台需要用的技术 1. 解析xml:dom4j.jar 2. 解析json:json-lib.jar ...
- 使用`lobHandler`:在处理大数据时,可以自定义`LobHandler`,优化读写性能。例如,使用`DefaultLobHandler`或`DirectBlobHandler`。 ```java LobCreator lobCreator = session.getLobHandler().getLobCreator...
`LocalSessionFactoryBean`是一个工厂Bean,它负责创建并配置Hibernate的`SessionFactory`。 在`LocalSessionFactoryBean`中,`getObject()`方法是FactoryBean接口要求实现的方法,它返回的是`SessionFactory`实例...
- 使用`lobHandler`:Hibernate提供`LobHandler`接口,可以自定义Clob和Blob的处理方式,提高性能,例如使用Oracle的NClob实现。 - 分块读写:对于大数据,可以使用`lobCreator.createClob()`创建可写Clob,然后...
1,小例子使用功能强大的Spring框架作为项目的管理...2,数据层使用JDBC,并使用Spring提供的LobHandler来处理大个资源,如图片等。 3,项目中集成使用quartz来进行调度。 4,Web层使用Struts2实成文件的上传与下载。