You are not logged in.
Pages: 1
Hello,
I'd like that a datasource uses a rest api.
First, i create a script to use the rest api but there is already a problem:
def connection = new URL( "https://[NUXEO]/nuxeo/site/api/v1/query?query=" +
URLEncoder.encode(
"SELECT * FROM Document", 'UTF-8' ) )
.openConnection() as HttpURLConnection
// set some headers
//connection.setRequestProperty( 'User-Agent', 'groovy-2.4.4' )
//connection.setRequestProperty( 'Accept', 'application/json' )
// get the response code - automatically sends the request
println connection.getInputStream()
I obtain this result
Script execution failed.
error message: javax.script.ScriptException: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext) (java.net.SocketException)
script arguments:
file: CartoNuxeoScript.groovy (id: 576037, line 35)
line number: 35 (25)
How can we use REST API ?
Thanks
Offline
Hi Stéphane,
this seems to be a java >= 9 issue, pls check here:
https://reportserver.net/en/tutorials/i … -practice/
If you use Java 9 or newer, you need some extra configuration which can be done in the setenv.sh of your Tomcat environment. Specifically, the following configuration is needed:
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED
-Djavax.net.ssl.trustStoreType=JKS
In particular, adding -Djavax.net.ssl.trustStoreType=JKS should solve your problem. But we recommend adding the other options as well.
For windows, you can find the guide here: https://reportserver.net/en/tutorials/i … n-windows/
Regards,
Eduardo
Offline
Hi Stéphane,
this seems to be related if you need more information:
https://github.com/jruby/jruby/issues/5808
https://bugs.openjdk.java.net/browse/JDK-8194702
Regards,
Eduardo
Offline
Hi Eduardo,
Very well, it's ok with the args you give
Thanks
Offline
Pages: 1