JDCB error using xPages Extension Library JDBC Query - xpages

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>
Created xpage with view panel using JDBC Query pointing to jdcb connection
Xpage application properties have relational and extlib libraries checked

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

Did you check that the OSGi driver was loaded properly? Try
tell http osgi ss oracle
to check

Related

Domino 9 Update site osgi class not found

I'm trying to use an Updatesite.nsf to deploy jar to a test server. I can see it in this case the jdbc driver plugin at the server console using the http osgi ss command. But when I use it I get a java.lang.ClassNotFoundException com.mysql.jdbc.driver. What I'm missing or doing wrong. Thank you
The immediate answer is that the code that's calling Class.forName will need to have the MySQL driver in its classloader one way or another, which an XPage or in-NSF Java won't have by default.
To expand on it a bit:
If you're trying to call it from an XPage or Java code in an NSF, it would have to be part of an XPages Library from another plugin, which in turn depends on and re-exports the driver plugin.
If you're trying to call it from another plugin, that other plugin should have a Require-Bundle or Import-Package entry to bring it in.
The class will be available to NSFs by default if you plunk it in jvm/lib/ext, though that admittedly gives up the niceties of OSGi-based deployment.
The reason it works for the XPages JDBC support is that the wrapped plugins created by the wizard in Designer include a special extension point to provide the driver class to the ExtLib code that wants it, but they don't make it automatically available to XPages apps themselves.

Looking for a good Cassandra GUI Client Tool

Kindly suggest a good client GUI tool for Cassandra or Please Share the download link of the DataStax DevCenter old version (V1.6.0). Currently we are using cqlsh to connect Cassandra. I couldn't find a better GUI for Cassandra.
Found (and tested) description how to connect using only open-source via DBeaver:
https://javaresolutions.blogspot.com/2018/04/opensource-db-ui-tool-for-cassandra-db.html
Download dbeaver (Community Edition)
Download cassandra jdbc jar files: http://www.dbschema.com/cassandra-jdbc-driver.html (Downloading and Testing the Driver Binaries section have links to binary and source)
extract cassandra jdbc zip
run dbeaver
go to Database > Driver Manager
click New
Fill in details as follow:
Driver Name: Cassandra (or whatever you want it to say)
Driver Type: Generic
Class Name: com.dbschema.CassandraJdbcDriver
URL Template: jdbc:cassandra://{host}[:{port}][/{database}]
Default Port: 9042
Embedded: no
Category:
Description: Cassandra (or whatever you want it to say)
click Add File and add all of the jars in the cassandra jdbc zip
click Find Class to make sure the Class Name is found okay
click OK
Create New Connection, selecting the database driver you just added
Here is the only open source and running example I found
https://github.com/Kindrat/cassandra-client for ready to run jar, you can use https://github.com/ozkanpakdil/cassandra-client/releases/download/v0.0.0/cassadra-client-0.0.0-0-exec.jar I built in my linux mint, GUI looks little bit demo like but I connected to my local cassandra and saw a table and data in the UI.
Not open source options below, I tested 2 of them and they are working, I can suggest datagrip which works fast and nice.
https://www.jetbrains.com/datagrip/download/#section=linux
https://www.mongodbmanager.com/download <<-- idi not test this one
https://razorsql.com/download.html
You may also look to the Cassandra interpreter in the Apache Zeppelin. The upcoming 0.9.0 release (0.9.0-preview2 is already available) contains a lot of changes in supporting Cassandra.

Apache POI Can't read content types part

In Java I have developed a simple program to read DOCX documents. Then I tryed to deploy jar libraries on Oracle database 11g (Java 1.6 version) with loadjava tool. All classes on datbase side are "Valid".
Whe I run the Java stored procedure on database I get exception:
org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read content types part !
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:41)
at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:120)
at Docx.loadFromBlob(Docx:38)
Caused by: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Can't read content types part !
at
org.apache.poi.openxml4j.opc.internal.ContentTypeManager.<init>(ContentTypeManager.java:107)
at org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager.<init>(ZipContentTypeManager.java:56)
at
org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:167)
at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:662)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:269)
at
org.apache.poi.util.PackageHelper.open(PackageHelper.java:39)
Docx file is fine because I can open it with Java on my client. Also the Java version on my database is the same as on client side (NetBeans)
regards
Peter

Unable to load Oracle JDBC driver in JSF application on Tomcat 7

I wrote a JSF application that uses a connection to an Oracle database. I verified on my local Tomcat (version 7.0) that everything works well. Then when being deployed to a server with a Tomcat 7 that I don't administrate, I get the following error thrown:
Caused by:
java.lang.NoClassDefFoundError - Could not initialize class oracle.jdbc.driver.OracleDriver
On my local system I have the Oracle JDBC Driver (version 11.2.0.4) in CATANIA_HOME/lib. According to the information I have of my deployment server, they use the exact same driver.
At the moment I am using a very basic JSF software that does nothing else than execute
Class.forName("oracle.jdbc.driver.OracleDriver");
on page load. Again, works fine on my local system. Fails on the deployment server. I figured that maybe they missed to include the driver, although they wrote they put it in. So I added the ojdbc5.jar to WEB-INF/lib. However then I get a SealingViolation thrown, which seems to indicate that the class loader found TWO resources containing the oracle driver.
If would be very happy if you were to give me some hints as to how I might solve this problem.
Thanks
Just put the driver jars in your WEB-INF/lib folder, in my case, I put ojdbc6.jar, you must have one ojdbc6.jar in your project, hope this help

Is there any way to migrate the built-in usergrid db

I've been running usergrid-stack commit 08f26cc865c96185d11990bf622730beff59971a for a while using the built-in cassandra db.
I need to migrate to another server and thought I'd take the chance to update.
I tried copying the folder standalone/target/tmp to the new installation but doing so gives me the error below.
null; Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Cannot create property=hinted_handoff_throttle_delay_in_ms for JavaBean=org.apache.cassandra.config.Config#6b7b9f29; Unable to find property 'hinted_handoff_throttle_delay_in_ms' on class: org.apache.cassandra.config.Config
Invalid yaml; unable to start server. See log for stacktrace.
Is there any way to migrate the db to a newer version?
If not, is there at least a way to migrate the db using the old version?
iirc hinted_handoff_throttle_delay_in_ms is a setting from Cassandra 1.1 which was removed in Cassandra 1.2 so you might need to edit the conf file (cassandra.yaml) and remove this setting.

Resources