spring+hibernate工程使用JNDI连接部署至websphere,报错Caused by: java.lang.ClassNotFoundException: oracle.sql.BLO
来源:互联网 发布:美食app 知乎 编辑:程序博客网 时间:2024/06/10 04:39
spring+hibernate工程使用JNDI连接部署至websphere,保存oracle大字段报错Caused by: java.lang.ClassNotFoundException: oracle.sql.BLO。
org.springframework.dao.InvalidDataAccessApiUsageException: Couldn't initialize OracleLobHandler because Oracle driver classes are not available. Note that OracleLobHandler requires Oracle JDBC driver 9i or higher!; nested exception is java.lang.ClassNotFoundException: oracle.sql.BLOB
原文链接地址:http://windring.iteye.com/blog/108171
参考资料:http://my.oschina.net/u/218421/blog/38576
正文引用:
在spring里 插入 BLOB字段
kp.setContent(content.getBytes());
方法 :hibernate saveOrUpdate
报
Caused by: java.lang.ClassNotFoundException: oracle.sql.BLOB。
使用tomcat 没问题。
可服务器改为 WebSphere .就报错。
把Spring内置提供的NativeJdbcExtractor转换器 改了一下,结果:问题解决。
———————————————————————————————————————————————————————
总结如下:
1、对于我们的工程:
在发布环境中,要将nativeJdbcExtractor 换成 org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor
留意log4j日志,此时的blob字段的java类型为oracle.sql.Blob
2、Spring内置提供的NativeJdbcExtractor转换器有:
C3P0NativeJdbcExtractor
CommonsDbcpNativeJdbcExtractor
JBossNativeJdbcExtractor
NativeJdbcExtractor
NativeJdbcExtractorAdapter
SimpleNativeJdbcExtractor
WebLogicNativeJdbcExtractor
WebSphereNativeJdbcExtractor
XAPoolNativeJdbcExtractor
要根据不同服务器及时修改,以免浪费大量时间。
位于org\springframework\jdbc\support\nativejdbc下
在此总结。
- spring+hibernate工程使用JNDI连接部署至websphere,报错Caused by: java.lang.ClassNotFoundException: oracle.sql.BLO
- Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.jndi.JndiNameException
- Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.jndi.JndiNameException
- Caused by: java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory
- Caused by: java.lang.ClassNotFoundException
- Caused by: java.lang.ClassNotFoundException
- 关于Struts2 +hibernate 3+spring中的报错 1 Caused by: java.lang.NoSuchMethodError
- spring事务配置Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.SessionFactoryImplemento
- spring 整合hibernate Caused by: java.lang.ClassNotFoundException: javax.persistence.Entity
- Caused by: java.lang.ClassNotFoundException: org.hibernate.cache.CacheProvider
- Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition
- Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition
- Caused by: java.lang.ClassNotFoundException: org.hibernate.impl.SessionImpl
- Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition
- Caused by: java.lang.ClassNotFoundException: org.hibernate.cache.CacheProvider
- Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.Entity
- Caused by: java.lang.ClassNotFoundException: org.hibernate.cache.CacheProvider
- Caused by: java.lang.ClassNotFoundException: org.apache.shiro.spring.LifecycleBeanPostProcessor
- 从logstash -> output -> elasticsearch动态模板说起
- GCD的介绍和使用(一)
- #pragma预处理命令小纪
- ios webview清除缓存Cookie
- RecyclerView cardview点击效果
- spring+hibernate工程使用JNDI连接部署至websphere,报错Caused by: java.lang.ClassNotFoundException: oracle.sql.BLO
- Redis介绍及常用命令
- 房地产O2O应用中为什么很少提供社交入口?
- MySQL查询当前数据上一条和下一条的记录
- 搭建zookeeper-Kafka-Storm消息系统
- 分享一个css浏览器兼容重构代码
- [LeetCode] Remove Duplicates from Sorted Array & Remove Element
- nyoj 1119 士兵杀敌(三)【线段树】区间最值的差
- Tomcat线程数