JDCB error using xPages Extension Library JDBC Query

529 Views Asked by At

I'm trying to set up s prototype for accessing Oracle data in an xPage using the JDBC Query in the Extension Library. I'm getting the following errors:

Error while reading the relational data Error while loading connection cos11p Error loading JDBC driver class com.oracle.jdbc.driver_1.0.0.20141104-1319. If running the server, check that an OSGi plugin wrapper for the corresponding JDBC driver is available on the server, or that the corresponding package is available in the WEB-INF/lib directory. If running the studio, check that the corresponding package is available in your client library. java.sql.SQLException: Cannot create JDBC driver com.oracle.jdbc.driver_1.0.0.20141104-1319 Cannot create JDBC driver com.oracle.jdbc.driver_1.0.0.20141104-1319 java.lang.ClassNotFoundException: Cannot find class com.oracle.jdbc.driver_1.0.0.20141104-1319 in NSF Cannot find class com.oracle.jdbc.driver_1.0.0.20141104-1319 in NSF com.oracle.jdbc.driver_1.0.0.20141104-1319

Here is what I have done so far to set this up: 1. Installed latest version of extension library on the server 2. Installed JDBC driver on the server using the Open NTF wizard 3. created cos11p.jdbc connection file located in WebContent\WEB-INF\JDBC

<jdbc>
<driver>com.oracle.jdbc.driver_1.0.0.20141104-1319</driver>
<url>jdbc:oracle:thin:@//sodb2p.malt-o-meal.com:1521/cos11p</url>
<user>username</user>
<password>password</password>
</jdbc> 
  1. Created xpage with view panel using JDBC Query pointing to jdcb connection
  2. Xpage application properties have relational and extlib libraries checked
2

There are 2 best solutions below

2
On BEST ANSWER

That "JDBC driver class" from the error looks wrong. I believe it should be "oracle.jdbc.OracleDriver". In the JDBC driver plugin wizard, the "class" field should use that String I've quoted, which references a class within the JDBC driver you've downloaded (not the filename of the driver itself). It's a key part of getting the generated OSGi plugin to work correctly.

And in the JDBC file, you would then use the same class name in the "driver" parameter. I don't think there should be a date stamp in that parameter at all

1
On

Did you check that the OSGi driver was loaded properly? Try

tell http osgi ss oracle

to check