baztian/jaydebeapi

JayDeBeApi/JPype call deprecated Java 15 method

bb14742 opened this issue · 2 comments

The JayDeBeApi module relies on JPype. I am using JayDeBeApi to connect a Python program to a HANA database. I was able to make a connection to HANA using JayDeBeApi/JPype, but a co-worker of mine received the following error:

File "SSLSession.java", line 295, in javax.net.ssl.SSLSession.getPeerCertificateChain

“java.lang.UnsupportedOperationException: java.lang.UnsupportedOperationException: This method is deprecated and marked for removal. Use the getPeerCertificates() method instead.”.

The JPype module is referencing a deprecated Java method getPeerCertificateChain, which is no longer available in Java 15.

The code worked for me as I was using an older version of Java. Either JayDeBeApi needs to reference a different module than JPype or JPype needs to be modified to call getPeerCertificates().

This site states that getPeerCertificateChain has been removed from Java 15:
https://bugs.openjdk.java.net/browse/JDK-8241047

I believe you are barking up the wrong tree. JPype does not contain any calls to getPeerCertificates(). JPype is a bridge that allows arbitrary Java code to be executed. It does not call any database code unless you were using the jpype.dbapi2 module which is not happening here.

A scan of the two packages (JPype & JayDeBeAPI) show that the call did not originate from either.

~/$ cd jpype
~/jpype$ find . ! -type d | xargs grep Peer   # Nothing appears
~/jpype$ cd ../jaydebeapi/
~/jaydebeapi$ find . ! -type d | xargs grep Peer  # Nothing appears
~/jaydebeapi$

Therefore, there are two possibilities. The database driver code written in Java is out of date and has the bad call compiled in or the user code in Python is calling the getPeerCertificateChain. Neither JPype nor JayDeBeApi require modification.

When submitting a bug report please:

  • Provide sufficient information to identify the source of the error (a complete stacktrace or something showing what call was made).
  • Provide a way to replicate the error (sample code or similar)
  • Provide version information (perhaps the problem was in a previous version)
  • Verify that code actually exists in the package you are reporting the problem to, especially when there are multiple libraries (in this case user code, Python, JayDeBeAPI, JPype, Java, and HANA database driver).

I am closing this issue due to the explanation provided in JPype1: jpype-project/jpype#990