The rules component is failing when many threads call simultaneously to the same drools service.
Some part of the code when singletonRuntime is created should be part of a synchronized block.
Apart from this, the way the globals are initialized is not correct. Should be preserved the Result in case a previous Result has been included as part of the globals map variable.
Bugzilla description:
Description of problem:
A rules service with a REST binding throws errors when subjected to moderate threading.
Partial stack trace: Caused by: java.lang.ClassCastException: org.jboss.resteasy.core.ServerResponse cannot be cast to org.switchyard.quickstarts.rest.binding.SamManager at com.sun.proxy.$Proxy307.getOrder(Unknown Source) at sun.reflect.GeneratedMethodAccessor186.invoke(Unknown Source) [:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_51] at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.6.Final-redhat-1.jar:2.3.6.Final-redhat-1]
(SamManager is the desired result object type)
|