camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Franz Forsthofer (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-6781) IntrospectionSupport.setProperty ClassCastException if you have overloaded methods
Date Tue, 24 Sep 2013 11:52:04 GMT
Franz Forsthofer created CAMEL-6781:
---------------------------------------

             Summary: IntrospectionSupport.setProperty ClassCastException if you have overloaded
methods
                 Key: CAMEL-6781
                 URL: https://issues.apache.org/jira/browse/CAMEL-6781
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.12.0, 2.11.1
            Reporter: Franz Forsthofer


If you use DefaultComponent.setProperties(config, parameters) with a config object having
overloaded methods you can get the following Exception:

org.apache.camel.NoSuchBeanException: Found bean: myExpression in JNDI Context: javax.naming.InitialContext@7f597bc4
of type: org.apache.camel.builder.ExpressionBuilder$31 expected type was: class java.lang.String
	at org.apache.camel.impl.JndiRegistry.lookupByNameAndType(JndiRegistry.java:60)
	at org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookupByNameAndType(PropertyPlaceholderDelegateRegistry.java:63)
	at org.apache.camel.util.CamelContextHelper.lookup(CamelContextHelper.java:121)
	at org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:499)
	at org.apache.camel.util.EndpointHelper.setReferenceProperties(EndpointHelper.java:271)
	at org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:263)
	at org.apache.camel.impl.DefaultComponentReferencePropertiesTest$MyComponent.createEndpoint(DefaultComponentReferencePropertiesTest.java:94)
	at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:120)
	at org.apache.camel.impl.DefaultComponentReferencePropertiesTest.testCallExpressionSetter(DefaultComponentReferencePropertiesTest.java:152)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at org.apache.camel.TestSupport.runBare(TestSupport.java:58)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:255)
	at junit.framework.TestSuite.run(TestSuite.java:250)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassCastException: Cannot cast org.apache.camel.builder.ExpressionBuilder$31
to java.lang.String
	at java.lang.Class.cast(Class.java:3084)
	at org.apache.camel.impl.JndiRegistry.lookupByNameAndType(JndiRegistry.java:56)
	... 28 more



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message