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

NPE while invoking EP with Token EP #180

Open
lasanthaS opened this issue Aug 27, 2020 · 0 comments
Open

NPE while invoking EP with Token EP #180

lasanthaS opened this issue Aug 27, 2020 · 0 comments

Comments

@lasanthaS
Copy link
Contributor

lasanthaS commented Aug 27, 2020

Description:

While invoking an endpoint with Token endpoint specified in the HTTP sink, the following exception occurs.

ERROR {io.siddhi.core.stream.StreamJunction} - Error in 'SiddhiApp' after consuming events from Stream 'FooStream', null. Hence, dropping event 'Event{timestamp=1598441762269, data=[***], isExpired=false}' java.lang.NullPointerException
	at io.siddhi.extension.io.http.sink.updatetoken.HttpRequest.sendPostRequest(HttpRequest.java:127)
	at io.siddhi.extension.io.http.sink.updatetoken.HttpsClient.getPasswordGrantAccessToken(HttpsClient.java:95)
	at io.siddhi.extension.io.http.sink.HttpSink.getAccessToken(HttpSink.java:817)
	at io.siddhi.extension.io.http.sink.HttpSink.setAccessToken(HttpSink.java:844)
	at io.siddhi.extension.io.http.sink.HttpSink.sendOauthRequest(HttpSink.java:668)
	at io.siddhi.extension.io.http.sink.HttpSink.publish(HttpSink.java:607)
	at io.siddhi.core.stream.output.sink.Sink.publish(Sink.java:182)
	at io.siddhi.extension.map.json.sinkmapper.JsonSinkMapper.mapAndSend(JsonSinkMapper.java:209)
	at io.siddhi.core.stream.output.sink.SinkMapper.mapAndSend(SinkMapper.java:180)
	at io.siddhi.core.stream.output.sink.SinkCallback.receive(SinkCallback.java:55)
	at io.siddhi.core.stream.StreamJunction.sendEvent(StreamJunction.java:199)
	at io.siddhi.core.stream.StreamJunction$Publisher.send(StreamJunction.java:474)
	at io.siddhi.core.stream.input.InputDistributor.send(InputDistributor.java:34)
	at io.siddhi.core.stream.input.InputEntryValve.send(InputEntryValve.java:45)
	at io.siddhi.core.stream.input.InputHandler.send(InputHandler.java:78)
	at org.wso2.carbon.siddhi.editor.core.internal.DebuggerEventStreamService.pushEvent(DebuggerEventStreamService.java:70)
	at org.wso2.carbon.event.simulator.core.internal.generator.SingleEventGenerator.sendEvent(SingleEventGenerator.java:85)
	at org.wso2.carbon.event.simulator.core.impl.SingleApiServiceImpl.runSingleSimulation(SingleApiServiceImpl.java:17)
	at org.wso2.carbon.event.simulator.core.api.SingleApi.runSingleSimulation(SingleApi.java:63)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.wso2.msf4j.internal.router.HttpMethodInfo.invokeResource(HttpMethodInfo.java:187)
	at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:143)
	at org.wso2.msf4j.internal.MSF4JHttpConnectorListener.dispatchMethod(MSF4JHttpConnectorListener.java:218)
	at org.wso2.msf4j.internal.MSF4JHttpConnectorListener.lambda$onMessage$0(MSF4JHttpConnectorListener.java:129)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Affected Product Version:

  • WSO2 Streaming Integrator Tooling 1.0.0
  • WSO2 Identity server 5.10.0

Steps to reproduce:

The sample Siddhi file is as follows.

@App:name("SiddhiApp")

@sink(type='http', 
    publisher.url='http://jsonplaceholder.typicode.com/posts', 
    method="POST",
    headers="'Content-Type: application/json'",
    oauth.username="***",
    oauth.password="***",
    consumer.key="***",
    consumer.secret="***",
    token.url='https://localhost:9443/oauth2/token',
    ssl.verification.disabled="true",
    @map(
        type='json'
    ))
define stream FooStream (id int);

define stream BarStream(id int);

from BarStream 
select *
insert into FooStream;
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