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

                 Key: CAMEL-4236
                 URL: https://issues.apache.org/jira/browse/CAMEL-4236
             Project: Camel
          Issue Type: Improvement
          Components: camel-core
    Affects Versions: 2.7.0
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
            Priority: Minor
             Fix For: 2.8.0


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

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to