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.
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.
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:
Change it to the following code:
The problem should be resolved.
15 June 2018