Wednesday, 26 November 2008

java.lang.ClassCastException: oracle.sql.BLOB

This is by far the most annoying problem I've ever had. What ClassCastException??? This is my code:

oracle.sql.BLOB blob = (oracle.sql.BLOB) resultSet.getObject("fileBlob");

It turned out that there are 2 Oracle JDBC jars in my Tomcat directory (common/lib and WEB-INF/lib), so I removed the one from WEB-INF, restarted the application, and it all worked fine.
Share |