Different java.protocol.handler.pkgs settings in Domino causing error in XPages java

115 Views Asked by At

I have two different java settings on two different domino servers using same version. 12.0.2 FP2.

here you see the settings found in System.properties for the servers:

Server 1 This one is working fine when using urlconnection

java.protocol.handler.pkgs=com.ibm.domino.internal.protocol

Server 2 This one is not working when using urlconnection

java.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol

update: I misstankenly put the wrong line on the wrong server initially, should be ok now,

---

Strangely when testing java.net.UrlConnection in an agent it works on both server. but when doing it in a java class that is used in XPages it does not work.

this is the error we get on server 2.

[1410:0011-0454] 2023-09-07 12:21:45 HTTP JVM: java.lang.ClassCastException: com.sun.net.ssl.internal. www.protocol.https.HttpsURLConnectionOldImpl incompatible with javax.net.ssl.HttpsURLConnection

what can be the reason for this setting begin different and how can I make them the same?

this is currently causing me to write different XPages java code based on which server the xpage/script is running on when making java.net.UrlConnection calls to https.

note: I only assume that value of java.protocol.handler.pkgs is the cause of this, it could ofcourse be something else but that is my best guess.

On server 2 we also have some other settings that is pointing to wrong path and is missing on server 1

enter image description here

2

There are 2 best solutions below

0
Thomas Adrian On BEST ANSWER

for some reason we can no longer reproduce the problem with urlconnection for server 2.

the only thing we can think of that has changed since we first discovered the problem is that we did a change to an internet site document to enable SSO.

Internet Site document -> Configuration -> TLS Options -> keyfileName and added the hostname there instead of the keyfile. (as described in the documentation when not using keyfiles)

2
John Dalsgaard On

Ok, I have not tested the exact same setup that you have as we see some other problems with 12.0.2 FP2 (eg. with the editor for richtext fields in XPages).

However, I have had to change some things in a class that we use to handle invalid SSL certs when calling adjacent systems. Originally, I used some IBM packages and at some point (11 or 12) those packages had disappeared from the product and I had to use the Sun classes instead - doing the same thing...

So my first attempt would be to change your server 2 to use the Sun handler. Agents are special creatures that really haven't been part of the more modern Java environment that XPages has used (I know there are some changes in 12.0.2 - but I haven't really tried them out). So that could explain why it works in Java agents - and not in XPages...

/John