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

BeanManagerProvider in deltaspike-core-api bundle references CDI containers of already uninstalled bundles

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 2.0
    • Fix Version/s: 2.1.0
    • Component/s: component-bean
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      1. Start karaf in debug mode
      2. Put a breakpoint here:
      https://github.com/apache/deltaspike/blob/deltaspike-0.4/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java#L152
      3. Attach your debugger to karaf in Eclipse
      4. Install a switchyard quickstart
      => You will see new item in private map bmInfos in BeanManagerProvider
      5. Uninstall quickstart
      6. Install it again
      => Now we have two CDI containers for our quickstart and some bundles can use the old one. It can result in ClassCastException...

      Show
      1. Start karaf in debug mode 2. Put a breakpoint here: https://github.com/apache/deltaspike/blob/deltaspike-0.4/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java#L152 3. Attach your debugger to karaf in Eclipse 4. Install a switchyard quickstart => You will see new item in private map bmInfos in BeanManagerProvider 5. Uninstall quickstart 6. Install it again => Now we have two CDI containers for our quickstart and some bundles can use the old one. It can result in ClassCastException ...
    • Bugzilla Update:
      Perform

      Description

      BeanManagerProvider in deltaspike-core-api bundle references CDI containers of already uninstalled bundles.

      https://github.com/apache/deltaspike/blob/deltaspike-0.4/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/api/provider/BeanManagerProvider.java#L96

      We can face serious problem if we use current version of arquillian-osgi-container. Arquillian bundle undeploys tested bundle but it holds old classloader because tested bundle was not uninstalled properly (deltaspike-core-api has reference to its classloader). When we execute arquillian test second time it can fail in the following place if some special conditions occurs:

      https://github.com/jboss-switchyard/core/blob/2.0.0.Alpha3/bus/camel/src/main/java/org/switchyard/bus/camel/CamelMessage.java#L76

      It results in the exception of this format:
      SWITCHYARD010813: Cannot convert from 'XXX' to 'XXX'. No registered Transformer available for transforming from 'XXX' to 'XXX'. A Transformer must be registered.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  igarashitm tomohisa igarashi
                  Reporter:
                  mbasovni Martin Basovnik
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: