jpype-project / jpype

JPype is cross language bridge to allow Python programs full access to Java class libraries.
http://www.jpype.org
Apache License 2.0
1.12k stars 181 forks source link

JayDeBeApi/JPype call deprecated Java 15 method #988

Closed bb14742 closed 3 years ago

bb14742 commented 3 years ago

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. JPype needs to be modified to call getPeerCertificates() instead of getPeerCertificateChain.

This site states that getPeerCertificateChain has been removed from Java 15:

https://bugs.openjdk.java.net/browse/JDK-8241047

Thrameos commented 3 years ago

JPype does not have getPeerCertificates() in the code base nor does the word Peer appear anywhere. JPype is a library that allows Python to call Java methods. The user code makes the call, we just are routing it. I also checked in JayDeBeAPI and the word "Peer" never appears in that codebase. Thus the error is likely in the user code base not the libraries.

I suggest reviewing the stack trace on the error to locate who made the call and updating it appropriately.