Error during REST API call in Sailpoint ISC

I’m doing REST API call via a rule in ISC VA using the below code for it:

import java.net.HttpURLConnection;
import java.net.URL;

 URL requestUrl = new URL(url);
 HttpURLConnection connection = (HttpURLConnection) requestUrl.openConnection();
 connection.setRequestMethod("POST");


This code was working until yesterday and today it is failing with error

Error in method invocation: Cannot access method setRequestMethod(java.lang.String) in ‘class sun.net.www.protocol.https.HttpsURLConnectionImpl’ :java.lang.IllegalAccessException: class bsh.Reflect cannot access class sun.net.www.protocol.https.HttpsURLConnectionImpl (in module java.base) because module java.base does not export sun.net.www.protocol.https to unnamed module @470f1802 : at Line: 143 : in file: inline evaluation of: ``import ……..

I can see this happened in IIQ and the suggestion is update tomcat server with the option

--add-exports java.base/sun.net.www.protocol.https=ALL-UNNAMED

Has anyone encountered a similar issue before in ISC VA? If so, I’d appreciate any suggestions or guidance on how to fix it in the ISC VA environment.

Thanks

Mathew

Which type of rule are you trying to do this in? There is limited functionality within certain types of rules in ISC due to it’s multi-tenant architecture.

1 Like

I am using in JDBCProvision rule. It was working as expected until yesterday.

can you try below ?

import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;

URL requestUrl = new URL(url);
HttpURLConnection connection = (HttpURLConnection) requestUrl.openConnection();

if (connection instanceof HttpsURLConnection)

{
HttpsURLConnection httpsConnection = (HttpsURLConnection) connection;
httpsConnection.setRequestMethod(“POST”);
} else

{
connection.setRequestMethod(“POST”);
}

Hello,

Welcome to SailPoint COmmunity!

It seems that you application is suing OOTB web service connector, correct? If yes, then why you are using a JDBC provisioning rule. You should be using AfterWebServiceOperationsRule connector rule if you are calling a REST API of the source to perform certain operations. The JDBC provisioning rule is used for JDBC based connector sources.

Thank You,

Regards,

Rohit Wekhande.

We are facing the same issue on a Web Services source that uses a connector rule for one of the HTTP operations.
In our case, we need to convert Base64 to binary before performing a POST.

Is it possible that SailPoint made adjustments to the ISC VAs that are now preventing this from working?

1 Like

Today I am no longer getting this error for the same code.

As per the discussion on the same error in IIQ, it says it is because

“The error you’re encountering is due to changes in Java module access controls introduced in Java 9 and later versions. Java 17 enforces stricter encapsulation, and HttpsURLConnectionImpl is part of a package that is not exported to unnamed modules, which includes BeanShell.”

Error during REST API call in Sailpoint using JDK17 - IdentityIQ (IIQ) / IIQ Discussion and Questions - SailPoint Developer Community

Thank you all who replied to this discussion.

Regards

Mathew

We’re also no longer seeing the error, but does this mean the stricter encapsulation in Java 17 has been temporarily reverted in ISC, or can we consider this a permanent fix/revert?

I’d like to know if this issue might reoccur in the future, since it suddenly stopped working before.

Yes, I am also wondering the same like can it happen in production in future, did they refreshed/reverted something in VA, I am considering to raise this issue with SailPoint and get an answer.

Regards

Mathew

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.