If I install UP1, can I still use the JDBC stuff? - xpages

I know you can't mix UP1 and the Extension Library, but, can you still use the new JDBC datasources?

Because the Extension Libray is open source, you could create an OSGi library that consists only of the JDBC data source features and install that atop UP1. That approach would allow you to use the "officially supported" version of everything else, treating only the JDBC data source as "use at your own risk".

Related

How can the client side validation be disabled in the python code generated from OpenAPI 3.x spec

I have an application, which needs to be tested using in-house developed python automation. Originally, the application was developed using Swagger 2.x spec. Now it is migrated to use Open API 3.x
When it was on Swagger 2.x spec, I used to use swagger-codegen-cli-2.4.21.jar to generate the python client libraries, which we eventually consumed to write our automation. With the 2.4.21 jar we could disable the client side validation (configuration.py)
But after moving to OpenAPI 3.x, I am not able to use 2.4.21 jar because its not supported. So I used 3.0.36 jar to generate the python client libraries. But this doesn't have the option to disable the client side validation (in configuration.py). This is actually creating lot of problems because we are getting ValueErrors during GET calls.
I see that there are some discussions happened on the same, but none of them are conclusive enough that it is actually fixed in 3.x
https://github.com/OpenAPITools/openapi-generator/pull/4137
https://github.com/swagger-api/swagger-codegen/issues/5530
https://github.com/swagger-api/swagger-codegen/pull/9717
So I need help to understand whether this is still a open issue (or) it is fixed in some 3.x release..? If its not fixed yet, is there a workaround to overcome this issue..?
As of now, we are commenting all the ValueErrors to get around the issue, but this is not recommended because we lose the validation capability during POST calls.
On python-nextgen (latest Python generator) it is not implemented (you can indicate which type of validation can be skipped using disabled_client_side_validations when creating the configuration object, maybe works for you?).
The configuration object also includes a property client_side_validation which seems to be intended for this purpose but at the moment there is no implementation.
The only option at the moment is to keep it or remove it for all operations.

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.

How to set threading mode in SQLite with Entity Framework?

I'm using SQLite with Entity Framework Core (RC1).
I read, that SQLite supports three different threading modes: Single-thread, Multi-thread and Serialized.
How do I set in run-time, which mode I want to use with my database?
Microsoft.Data.Sqlite references the SQLitePCRaw.bundle_e_sqlite3 NuGet package. That package contains a version of SQLite that has been compiled with SQLITE_THREADSAFE=1 (Serialized). Microsoft.Data.Sqlite doesn't currently expose an API to change this, nor did System.Data.SQLite.
See also aspnet/EntityFramework#5466.
It is accomplished by opening a database with the appropriate flags set. SQLITE_OPEN_NOMUTEX for multithread or SQLITE_OPEN_FULLMUTEX for serialized. It looks like flag setting is available through the C interface:
https://www.sqlite.org/c3ref/c_open_autoproxy.html
So if you aren't using the C interface directly, you are at the mercy of EF and whether they have decided to support flag setting on database open.

JDCB error using xPages Extension Library JDBC Query

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

How can I use an updated version of JavaMail in XPages?

I have a XPage application where I use JavaMail in one of my managed beans. Currently I have added the jar-file C:\Programme\IBM\Notes\framework\shared\eclipse\plugins\com.ibm.designer.lib.javamail_9.0.0.20130301-1431\lib\mail.jarto the build-path of the manged bean. This works well. But now I want to use a newer version of JavaMail as the Domino server uses version 1.3 but I need version 1.4.x.
I have downloaded the new JavaMail jar-files from Oracle. In Domino Designer (version 9) I add this jar-file to the new design element "Code / Jars" and remove the old jar-files from the build path.
My managed bean is still compiling and running as desired, but if I check the version the bean is using it reports still version 1.3. To check the version number I use the debug property of JavaMail and it's reporting version 1.3 to the domino server console.
Is there a way to tell the domino server to use the jar-files in the application (i.e. the nsf) and not his own? Is there another approach to update the JavaMail version?
The reason I want to use a newer version of JavaMail is as follows: I want to read mails from an imap server with ssl. To avoid the problem of importing ssl-certificates I simply want to trust all hosts. This can be be done via MailSSLSocketFactory, but this is only available since version 1.4.2. Therefore I want to use a newer version of JavaMail.
Another reason I want to use a newer version is as follows: the method "getSortedMessages" of "IMAPFolder" is only available since version 1.4.4. (and so are some other features of JavaMail).
This may be a little too late for you... I think the right approach may be to include the jar file as an OSGi plugin.
I have spent some time to figure out how to do that - and recently succeeded :-) I have described the steps to perform to make this work in two articles. The first is about wrapping a JAR into a plug-in: http://www.dalsgaard-data.eu/blog/wrap-an-existing-jar-file-into-a-plug-in/ - the second is about deployment (and there is a link in the first one).
/John
You can solve the problem by creating an OSGi plug-in that supersedes the one that sports the JavaMail library: com.ibm.designer.lib.javamail.
In order to do that do the following:
Create an OSGi plugin whose id is com.ibm.designer.lib.javamail (Dalsgaard's tutorial on how to do it)
Set its version to a higher number than the one the Domino server is shipped with (to know the version type tell http osgi ss com.ibm.designer.lib.javamail). As of now using 9.0.1.qualifier should be fine
Deploy the plugin either through an update site or by directly copying it under the domino\workspace\applications\eclipse\plugins folder.
Restart the HTTP service. The higher version - the one you created - will now be used
I've got the same problem here, but found a solution. Be warned, this is not the best answer but it will work. Simply download the latest javamail jar here and rename the jar file to 'mail.jar'. Just replace the current file in IBM\Notes\framework\shared\eclipse\plugins\com.ibm.designer.lib.javamail_9.0.0.20130301-1431\lib\mail.jar with this file. Quit the http task and restart it. The code will now work with the latest version.

Resources