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 thrown when starting and stopping siddhi app with multiple HTTP sources #161

Open
niveathika opened this issue Jan 9, 2020 · 0 comments

Comments

@niveathika
Copy link
Member

Description:
$subject

Stacktrace

[2020-01-09 13:26:16,561] ERROR {io.siddhi.core.stream.input.source.Source} - Error on 'JsonInputMapper'. Error while connecting at Source 'http' at 'PersonalDetailsDefaultMapping'. java.lang.NullPointerException
	at io.siddhi.extension.io.http.source.HttpConnectorRegistry.createHttpServerConnector(HttpConnectorRegistry.java:218)
	at io.siddhi.extension.io.http.source.HttpSource.connect(HttpSource.java:418)
	at io.siddhi.core.stream.input.source.Source.connectWithRetry(Source.java:160)
	at io.siddhi.core.SiddhiAppRuntimeImpl.startSources(SiddhiAppRuntimeImpl.java:502)
	at io.siddhi.core.SiddhiAppRuntimeImpl.start(SiddhiAppRuntimeImpl.java:427)
	at io.siddhi.distribution.editor.core.internal.DebugRuntime.start(DebugRuntime.java:93)
	at io.siddhi.distribution.editor.core.internal.DebugProcessorService.start(DebugProcessorService.java:42)
	at io.siddhi.distribution.editor.core.internal.EditorMicroservice.start(EditorMicroservice.java:761)
	at io.siddhi.distribution.editor.core.internal.EditorMicroservice.startWithVariables(EditorMicroservice.java:781)
	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$58(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)

Siddhi App:


/** 
{
    event : {
        "name" : "siddhi.user",
        "age" : "25"
        "address" : "20, Palm Groove, Colombo, Sri Lanka",
        "contact": "+9xxxxxxx1,+9xxxxxxx2"
    }
}
**/
@Source(type = 'http', receiver.url = 'http://localhost:8006/PersonalDetails', 
	@map(type = 'json'))
define stream PersonalDetailsDefaultMapping (name string, age int, address string, contact string);


/** 
{
    "name" : "siddhi.user",
    "age" : "25",
    "address" : {
        "number": "20",
        "lane": "Palm Groove",
        "city": "Colombo"
        "country": "Sri Lanka",
    },
    "contact": ["+9xxxxxxx1, +9xxxxxxx2"]
}
**/
@Source(type = 'http', receiver.url = 'http://localhost:8006/PersonalDetailsCustom', 
	@map(type = 'json', 
	       @attributes(name = 'name', age ='age', addressCountry = 'address.country', contact = 'contact[0]' ) ))
	       @sink(type='log') 
define stream PersonalDetailsCustomMapping (name string, age int, addressCountry string, contact string);


/** 
{
    person : [
                {
                    "name" : "siddhi.user",
                    "age" : "25",
                    "address" : {
                        "number": "20",
                        "lane": "Palm Groove",
                        "city": "Colombo"
                        "country": "Sri Lanka",
                    },
                    "contact": ["+9xxxxxxx1, +9xxxxxxx2"]
                }, 
                {
                    "name" : "siddhi.user",
                    "age" : "25",
                    "address" : {
                        "number": "20",
                        "lane": "Palm Groove",
                        "city": "Colombo"
                        "country": "Sri Lanka",
                    },
                    "contact": ["+9xxxxxxx1, +9xxxxxxx2"]
                }, 
                ]
                
}
**/
@Source(type = 'http', receiver.url = 'http://localhost:8006/PersonalDetailsMultiple', 
	@map(type = 'json', enclosing.element = 'person',
	       @attributes(name = 'name', age ='age', addressCountry = 'address.country', contact = 'contact' ) ))
	       @sink(type='log') 
define stream PersonalDetailsEnclosingElement (name string, age int, addressCountry string, contact string);

Affected Product Version:
Latest

OS, DB, other environment details and versions:
Siddhi tooling daily build 8/1/2020

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