I have a Websphere application that tries to insert a new db table row containing a CLOB field. When there is little data to insert, say 2-3K, everything works well. However, for larger data volumes I get the following exception:
Here is the Java code:Code:Caused by: java.lang.ClassNotFoundException: oracle.sql.BLOB at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:402) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.springframework.jdbc.support.lob.OracleLobHandler.initOracleDriverClasses(OracleLobHandler.java:181)
Here is the Spring config:Code:protected String storeReport(Integer reportId, AreBatchReport report) throws XmlMappingException, IOException{ StringWriter writer = new StringWriter(); // Marshal the XML ObjectFactory fact = new ObjectFactory(); marshaller.marshal(fact.createAreBatchReport(report), new StreamResult(writer)); // Store it in the DB final int id = reportId.intValue(); final String xml = writer.getBuffer().toString(); jdbcTemplate.execute(storeXmlQuery, new AbstractLobCreatingPreparedStatementCallback(lobHandler){ @Override protected void setValues(PreparedStatement stmt, LobCreator lobCreator) throws SQLException, DataAccessException { lobCreator.setClobAsString(stmt, 1, xml); stmt.setInt(2, id); } }); return xml; }
I have tried to use DefaultLobHandler instead but it did not help.Code:<beans:bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler"> <beans:property name="nativeJdbcExtractor"> <beans:bean class="org.springframework.jdbc.support.nativejdbc.WebSphereNativeJdbcExtractor"/> </beans:property>
The application refers to com.springsource.oracle.jdbc-10.2.0.2.jar that contains among others oracle.sql.BLOB class. It seems that this jar is not used when trying to load the class.
Furthermore, the stack trace points out org.eclipse.osgi.framework.internal.core.BundleLoa der class. Does it mean that some OSGI configuration should be present to make it work?


Reply With Quote
