0
votes

Hi,

My product is migrating to websphere 8.5.5.2 from Jboss6 along with database branded data direct jar. During the database query, we have received the below error.

java.sql.SQLException: [Product][Oracle JDBC Driver]This driver is locked for use with embedded applications.

During analysis, came across the below code

((com.myproduct.jdbcx.oraclebase.BaseConnectionWrapper)
 (com.ibm.ws.rsadapter.jdbc.WSJdbcUtil.getNativeConnection(
 (com.ibm.ws.rsadapter.jdbc.WSJdbcConnection)connect))).unlock ("key");

where getting com.ibm.ws.rsadapter.jdbc.WSJdbcConnection ClassNotFOundException. I tried few options like keeping com.ibm.ws.runtime.jar in server JVM classpath. I causes many other issues and also server is not getting started. Its failing to intialize because of the other files dependencies. runtime.jar is located at C:/PROGRA~1/IBM/WebSphere/AppServer/plugins.

Could any one please tell me, If i want to make use of the jars located at plugins folder, what is the configuration required to do in WAS 8.5.5.2? These classes are not exposed to my application. The following classloader is responsible to load the OSGI classes as per my knowledge but this is not happening in my application case. "7-Module-com.ibm.ws.classloader.CompoundClassLoader"

I have done a sample application where i can able to access the above missing(IBM) classes automatically without any configuration under the same deployment environment. I can see them in CompoundClassLoader mentioned above. I dont know why these classes for missing for my application.

Many thanks for your supports in advance.

1
Those classes are automatically in the application classpath once you deploy the application on server. Can you post the full error log so that we can identify the issue. Also, try stetting the classloader to PARENT_FIRST and then try.Prerak Tiwari
FWIW, I was told that (at least some) jars under plugins are not available to applications. ibm.com/developerworks/community/forums/html/…dbreaux

1 Answers

0
votes

com.ibm.ws.rsadapter.jdbc.WSJdbcUtil.getNativeConnection() has been deprecated for quite a while and is not intended for external use, so getting the ClassNotFoundException is probably intended.

Can you instead use the jdbc unwrap method?

connect.unwrap(com.myproduct.jdbcx.oraclebase.BaseConnectionWrapper.class);

This way you won't need the WebSphere classes at all and can still get at your underlying connection.