Troubleshooting
Problem
If you use oracleLobHandler in Spring to read or write to the BLOB field in an application that is deployed on WebSphere Process Server, you might encounter a "java.lang.ClassNotFoundException: oracle.sql.BLOB" exception.
Symptom
You can see the following exception in the WebSphere Process Server log file:
Could not create Oracle LOB; nested exception is 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
Even if you have the correct Oracle JDBC driver version and have added it to the WebSphere Process Server library path, the issue persists. It gives the appearance that the WebSphere Process Server class loader is failing to load the Oracle JDBC driver.
Cause
This exception is caused by an incorrect oracleLobHandler interface selection in the Spring configuration. There is more than one oracleLobHandler defined within the Spring configuration. You must select the correct oracleLobHandler for the platform that you use. The problem is not caused by the WebSphere Process Server class loader.
Resolving The Problem
To resolve this issue, change the Spring configuration file.
Find the following line of code:
<bean id="nativeJdbcExtractor"
class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor" />
Change it to the following code:
<bean id="nativeJdbcExtractor"
class="org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor" />
The problem should be resolved.
Product Synonym
WPS
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21633083