Camel
  1. Camel
  2. CAMEL-4236

When performing lookup in registry and having expected type as parameter, then report better failure if ClassCastException

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.0
    • Fix Version/s: 2.8.0
    • Component/s: camel-core
    • Labels:
      None

      Description

      When Camel lookup in the registry, it may lookup in different runtime registries, such as OSGi blueprint. If an explicit type has been provided as a parameter you will get a ClassCastException if the type does not match. But you cannot see which types was a stake. So we should provide a better exception.

      Caused by: java.lang.ClassCastException
      at java.lang.Class.cast(Class.java:2990)[:1.6.0_24]
      at org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:43)
      at org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:47)
      at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:54)
      ... 42 more

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Claus Ibsen
            Reporter:
            Claus Ibsen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development