How to resolve "javax.ws.rs.ProcessingException: java.net.SocketException: A system call received a parameter that is not valid." when using Invoke REST API in AIX
book
Article ID: KB0078311
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for REST and JSON
All
Description
Some customers might get exception "javax.ws.rs.ProcessingException: java.net.SocketException: A system call received a parameter that is not valid." when sending HTTPS request via Invoke REST API activity in AIX environment. Below is the exception example
========= Activity invocation failed at com.tibco.pe.plugin.Activity.postEval(Unknown Source) at com.tibco.pe.plugin.Activity.postEval(Unknown Source) at com.tibco.pe.core.TaskImpl.eval(Unknown Source) at com.tibco.pe.core.Job.a(Unknown Source) at com.tibco.pe.core.Job.k(Unknown Source) at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source) at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source) caused by: javax.ws.rs.ProcessingException: java.net.SocketException: A system call received a parameter that is not valid. at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:287) at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252) at org.glassfish.jersey.client.JerseyInvocation$2.call(JerseyInvocation.java:701) at org.glassfish.jersey.internal.Errors.process(Errors.java:315) at org.glassfish.jersey.internal.Errors.process(Errors.java:297) at org.glassfish.jersey.internal.Errors.process(Errors.java:228) at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444) at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:697) at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:448) at com.tibco.plugin.json.activities.RestActivity.sendReqeustWithBody(RestActivity.java:472) at com.tibco.plugin.json.activities.RestActivity.doPostAlike(RestActivity.java:452) at com.tibco.plugin.json.activities.RestActivity.doService(RestActivity.java:417) at com.tibco.plugin.json.activities.RestActivity$1.run(RestActivity.java:366) at com.tibco.pe.util.ThreadPool$ThreadPoolThread.run(Unknown Source) Caused by: java.net.SocketException: A system call received a parameter that is not valid. at java.net.SocketInputStream.socketRead(SocketInputStream.java:127) at java.net.SocketInputStream.read(SocketInputStream.java:181) at java.net.SocketInputStream.read(SocketInputStream.java:152) at com.ibm.jsse2.a.a(a.java:57) at com.ibm.jsse2.a.a(a.java:193) at com.ibm.jsse2.as.a(as.java:3) at com.ibm.jsse2.as.i(as.java:822) at com.ibm.jsse2.as.a(as.java:392) at com.ibm.jsse2.as.startHandshake(as.java:507) at com.ibm.net.ssl.www2.protocol.https.c.afterConnect(c.java:184) at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:21) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1296) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1271) at com.ibm.net.ssl.www2.protocol.https.b.getOutputStream(b.java:20) at org.glassfish.jersey.client.internal.HttpUrlConnector$4.getOutputStream(HttpUrlConnector.java:390) at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:200) at org.glassfish.jersey.message.internal.CommittingOutputStream.commitStream(CommittingOutputStream.java:194) at org.glassfish.jersey.message.internal.CommittingOutputStream.write(CommittingOutputStream.java:228) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$UnCloseableOutputStream.write(WriterInterceptorExecutor.java:299) at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:233) at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:303) at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:307) at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:153) at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:287) at org.glassfish.jersey.message.internal.ReaderWriter.writeToAsString(ReaderWriter.java:193) at org.glassfish.jersey.message.internal.AbstractMessageReaderWriterProvider.writeToAsString(AbstractMessageReaderWriterProvider.java:130) at org.glassfish.jersey.message.internal.StringMessageProvider.writeTo(StringMessageProvider.java:99) at org.glassfish.jersey.message.internal.StringMessageProvider.writeTo(StringMessageProvider.java:59) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:265) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:250) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) at org.glassfish.jersey.logging.LoggingInterceptor.aroundWriteTo(LoggingInterceptor.java:225) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) at org.glassfish.jersey.spi.ContentEncoder.aroundWriteTo(ContentEncoder.java:138) at org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:162) at org.glassfish.jersey.message.internal.MessageBodyFactory.writeTo(MessageBodyFactory.java:1130) at org.glassfish.jersey.client.ClientRequest.doWriteEntity(ClientRequest.java:517) at org.glassfish.jersey.client.ClientRequest.writeEntity(ClientRequest.java:499) at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:393) at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285) ... 13 more =========
Issue/Introduction
How to resolve "javax.ws.rs.ProcessingException: java.net.SocketException: A system call received a parameter that is not valid." when using Invoke REST API in AIX
Environment
Operation System: AIX
Resolution
This issue is due to the AIX environment uses "ibm" as security vendor, the behaviors in using SSLContext.getInstance("TLS") to set the protocol to TLS differ between the IBM and Oracle implementation. Thus in order to match the behaviors to oracle, a jvm parameter com.ibm.jsse2.overrideDefaultTLS needs to be set true explicitly in order to enable TLS v1.1 & v1.2 protocols (otherwise only TLSv1.0 is enabled by IBM). Please refer to the IBM document below for the details:
Customer can add below properties in .tra file to fix this issue. ========= java.property.com.ibm.jsse2.overrideDefaultTLS=true java.property.https.protocols=TLSv1.2 =========