A "java.lang.ClassNotFoundException: oracle.sql.BLOB" exception occurs in Websphere Process Server (WPS)

Technote (troubleshooting)


Problem(Abstract)

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 Alias/Synonym

WPS

Rate this page:

(0 users)Average rating

Document information


More support for:

WebSphere Process Server
Artifact Loader/Resolver

Software version:

7.0.0.4

Operating system(s):

AIX

Reference #:

1633083

Modified date:

2013-04-18

Translate my page

Machine Translation

Content navigation