问题描述
测试源码如下:ApplicationContextctx=newClassPathXmlApplicationContext("spring-config.xml");AdministrationhistoryServiceIadministrationhistoryService=(AdministrationhistoryServiceI)ctx.getBean("administrationhistoryService");SessionFactorysessionFactory=(SessionFactory)ctx.getBean("sessionFactory");Administrationhistoryash=newAdministrationhistory();ash.setId(UUIDUtil.getUUID());Strings1="1231dsdgasf范德萨范德萨范德萨范德萨d的飒飒大";Clobclob=Hibernate.getLobCreator(sessionFactory.openSession()).createClob(s1);ash.setOrganabstrat(clob);administrationhistoryService.save(ash);在保存的时候,执行到这行出错:administrationhistoryService.save(ash);错误如下:java.lang.AbstractMethodError:org.apache.commons.dbcp.DelegatingPreparedStatement.setCharacterStream(ILjava/io/Reader;J)Vatorg.hibernate.type.descriptor.sql.ClobTypeDescriptor$4$1.doBind(ClobTypeDescriptor.java:114)atorg.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:93)atorg.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:280)atorg.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:275)atorg.hibernate.type.AbstractSingleColumnStandardBasicType.nullSafeSet(AbstractSingleColumnStandardBasicType.java:57)atorg.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2786)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3064)atorg.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3509)atorg.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:88)atorg.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:377)atorg.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:369)atorg.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:286)atorg.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339)atorg.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)atorg.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234)atorg.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404)atorg.hibernate.engine.transaction.internal.jdbc.JdbcTransaction.beforeTransactionCommit(JdbcTransaction.java:101)atorg.hibernate.engine.transaction.spi.AbstractTransactionImpl.commit(AbstractTransactionImpl.java:175)atorg.springframework.orm.hibernate4.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:554)atorg.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:755)atorg.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:724)atorg.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:475)atorg.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:270)atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)atorg.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)atorg.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)atcom.sun.proxy.$Proxy25.save(UnknownSource)atcom.fangneng.test.ClobTest.test(ClobTest.java:58)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)atjava.lang.reflect.Method.invoke(Method.java:606)atorg.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)atorg.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)atorg.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)atorg.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)atorg.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)atorg.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)atorg.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)atorg.junit.runners.ParentRunner$3.run(ParentRunner.java:231)atorg.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)atorg.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)atorg.junit.runners.ParentRunner.access$000(ParentRunner.java:50)atorg.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)atorg.junit.runners.ParentRunner.run(ParentRunner.java:300)atorg.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)atorg.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)哪位大哥帮解决下,不胜感激啊
解决方案
解决方案二:
自己顶啊,谢谢啊