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

Webhook class crashes if response is malformed #2

Open
tobwiens opened this issue Aug 17, 2016 · 1 comment
Open

Webhook class crashes if response is malformed #2

tobwiens opened this issue Aug 17, 2016 · 1 comment
Labels

Comments

@tobwiens
Copy link
Contributor

tobwiens commented Aug 17, 2016

The webhook class crashes if the response is malformed.

Let the webhook class connect to ncat:

  • Start ncat on trydev and let it listen to 8099
ncat -l 8099
  • Connect webhook to ncat
// Please fill variables
String method = "POST"
String url = "http://localhost:8099/notification-service/notifications"
String headers = "{key0 = value0}" //Example: "{key0 = value0, key1 = value1, ...}"
String content = "{\n" +
"\"date\": \"2016-08-17T08:30:22.862Z\" \n" +
"\"description\": \"some description\",\n" +
"\"notificationId\": 0\n" +
"}"

// Don't change code below
import org.ow2.proactive.addons.webhook.Webhook;
Webhook.execute ( method, url, headers, content);
  • Write a few lines into ncat
  • Webhook crashes

Following exception is thrown:

[email protected];12:36:25] POST Response Code :: -1 
[[email protected];12:36:25] Failed to execute task: javax.script.ScriptException: org.ow2.proactive.addons.webhook.exception.UnsuccessfulRequestException: POST Response Code :: -1 
[[email protected];12:36:25] at org.ow2.proactive.scheduler.task.executors.InProcessTaskExecutor.execute(InProcessTaskExecutor.java:195) 
[[email protected];12:36:25] at org.ow2.proactive.scheduler.task.executors.InProcessTaskExecutor.execute(InProcessTaskExecutor.java:134) 
[[email protected];12:36:25] at org.ow2.proactive.scheduler.task.executors.forked.env.ExecuteForkedTaskInsideNewJvm.fromForkedJVM(ExecuteForkedTaskInsideNewJvm.java:88) 
[[email protected];12:36:25] at org.ow2.proactive.scheduler.task.executors.forked.env.ExecuteForkedTaskInsideNewJvm.main(ExecuteForkedTaskInsideNewJvm.java:78) 
[[email protected];12:36:25] Caused by: org.ow2.proactive.scripting.ScriptException: javax.script.ScriptException: org.ow2.proactive.addons.webhook.exception.UnsuccessfulRequestException: POST Response Code :: -1 
[[email protected];12:36:25] at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:159) 
[[email protected];12:36:25] at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:130) 
[[email protected];12:36:25] at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249) 
[[email protected];12:36:25] at org.ow2.proactive.scripting.Script.execute(Script.java:319) 
[[email protected];12:36:25] at org.ow2.proactive.scripting.ScriptHandler.handle(ScriptHandler.java:76) 
[[email protected];12:36:25] at org.ow2.proactive.scheduler.task.executors.InProcessTaskExecutor.execute(InProcessTaskExecutor.java:191) 
[[email protected];12:36:25] ... 3 more 
@tobwiens
Copy link
Contributor Author

@mbenguig Is that behavior intended? Or is it a bug?

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

No branches or pull requests

2 participants