Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
joergboe opened this issue Aug 17, 2020 · 2 comments

Comments

@joergboe
Copy link
Member

joergboe commented Aug 17, 2020

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.

@joergboe
Copy link
Member Author

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

@joergboe
Copy link
Member Author

See also:
jira

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant