Uploaded image for project: 'SwitchYard'
  1. SwitchYard
  2. SWITCHYARD-2590

Rules Component Singleton not working with multithreads

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      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)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                virchete David virgil naranjo
                Reporter:
                virchete David virgil naranjo
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: