IBMStreams/streamsx.inet

Operator HTTPRequest throws exception when used with content type: application/octet-stream

joergboe opened this issue · 2 comments

The following code :

	stream<int32 sequence, int32 size, rstring status, int32 stat, rstring err, rstring contentEncoding, rstring contentType, rstring respData, list<rstring> responseHeader> ResponseStream as O
					= HTTPRequest(SenderStream as I) {
		param
			fixedUrl: $url;
			fixedMethod: POST;
			outputBody : "respData";
			outputStatus : "status";
			outputStatusCode : "stat";
			outputContentEncoding : "contentEncoding";
			outputContentType : "contentType";
			outputHeader : "responseHeader";
			errorDiagnostics : "err";
			fixedContentType : "application/octet-stream";
			requestBodyAttribute : text;
			sslAcceptAllCertificates: true;
		config
			placement: partitionColocation("sender");
	}

Throws exception:
CDIST0220E Argument of fixedContentType: 'application/octet-stream' is invalid.

17 Aug 2020 16:33:54.681+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_javaop M[?:com.ibm.streams.operator.internal.jni.JNIBridge.:-1] - CDIST0220E Argument of fixedContentType: 'application/octet-stream' is invalid.

17 Aug 2020 16:33:54.681+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_javaop M[?:?:0] - java.lang.IllegalArgumentException: CDIST0220E Argument of fixedContentType: 'application/octet-stream' is invalid.

17 Aug 2020 16:33:54.682+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_javaop M[?:?:0] - com.ibm.streamsx.inet.http.HTTPRequestOperAPI.initialize(HTTPRequestOperAPI.java:520)
17 Aug 2020 16:33:54.682+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_javaop M[?:?:0] - com.ibm.streamsx.inet.http.HTTPRequestOperClient.initialize(HTTPRequestOperClient.java:68)
17 Aug 2020 16:33:54.682+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_javaop M[?:?:0] - com.ibm.streamsx.inet.http.HTTPRequestOper.initialize(HTTPRequestOper.java:86)
17 Aug 2020 16:33:54.682+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_javaop M[?:?:0] - com.ibm.streams.operator.internal.runtime.api.OperatorAdapter.initialize(OperatorAdapter.java:756)
17 Aug 2020 16:33:54.683+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_javaop M[?:?:0] - com.ibm.streams.operator.internal.jni.JNIBridge.(JNIBridge.java:292)
Exception in thread "Thread-20" java.lang.IllegalArgumentException: CDIST0220E Argument of fixedContentType: 'application/octet-stream' is invalid.
at com.ibm.streamsx.inet.http.HTTPRequestOperAPI.initialize(HTTPRequestOperAPI.java:520)
at com.ibm.streamsx.inet.http.HTTPRequestOperClient.initialize(HTTPRequestOperClient.java:68)
at com.ibm.streamsx.inet.http.HTTPRequestOper.initialize(HTTPRequestOper.java:86)
at com.ibm.streams.operator.internal.runtime.api.OperatorAdapter.initialize(OperatorAdapter.java:756)
at com.ibm.streams.operator.internal.jni.JNIBridge.(JNIBridge.java:292)
17 Aug 2020 16:33:54.683+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_function M[JavaOp.cpp:newBridge:1665] - CDISR5126E: A Java exception occurred at Operator.initialize() during the JavaOp invocation.
17 Aug 2020 16:33:54.686+0200 [26825] ERROR #splapplog,J[0],P[0],ResponseStream,spl_pe M[PEImpl.cpp:logTerminatingException:2249] - CDISR5033E: An exception occurred during the execution of the ResponseStream operator. Processing element number 0 is terminating.
17 Aug 2020 16:33:54.687+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_operator M[PEImpl.cpp:handleOperatorFailure:688] - CDISR5030E: An exception occurred during the execution of the ResponseStream operator. The exception is: A Java exception occurred at Operator.initialize() during the JavaOp invocation.
17 Aug 2020 16:33:54.687+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_pe M[PEImpl.cpp:process:1527] - CDISR5079E: An exception occurred during the processing of the processing element. The error is: A Java exception occurred at Operator.initialize() during the JavaOp invocation..
17 Aug 2020 16:33:54.687+0200 [26825] ERROR #splapptrc,J[0],P[0],ResponseStream,spl_operator M[PEImpl.cpp:process:1565] - CDISR5053E: Runtime failures occurred in the following operators: ResponseStream.

apache client:
org.apache.http.entity.ContentType ctt = ContentType.getByMimeType("application/octet-stream");
delivers null
but:

String str = ContentType.APPLICATION_OCTET_STREAM.getMimeType();

delivers : application/octet-stream

See also:
jira