Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14411

Avoid using reflection when configuring DataFormats

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      See the following call path when a new DataFormat is configured in Camel Quarkus (against Camel 3.0.0). Note that the setLineSeparator() method is accessed using reflection there.

      Should this be fixed in Camel or should perhaps Camel Quarkus be adapted to use some generated configurer?

       at org.apache.camel.dataformat.base64.Base64DataFormat.setLineSeparator(Base64DataFormat.java:94)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at org.apache.camel.support.IntrospectionSupport.setProperty(IntrospectionSupport.java:715)
              at org.apache.camel.support.IntrospectionSupport.setProperty(IntrospectionSupport.java:795)
              at org.apache.camel.impl.engine.DefaultBeanIntrospection.setProperty(DefaultBeanIntrospection.java:170)
              at org.apache.camel.reifier.dataformat.DataFormatReifier.setProperty(DataFormatReifier.java:243)
              at org.apache.camel.reifier.dataformat.Base64DataFormatReifier.configureDataFormat(Base64DataFormatReifier.java:41)
              at org.apache.camel.reifier.dataformat.DataFormatReifier.createDataFormat(DataFormatReifier.java:203)
              at org.apache.camel.reifier.dataformat.DataFormatReifier.getDataFormat(DataFormatReifier.java:169)
              at org.apache.camel.reifier.MarshalReifier.createProcessor(MarshalReifier.java:35)
              at org.apache.camel.reifier.ProcessorReifier.makeProcessorImpl(ProcessorReifier.java:571)
              at org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:537)
              at org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:250)
              at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:384)
              at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:108)
              at org.apache.camel.quarkus.core.FastModel.start(FastModel.java:61)
              at org.apache.camel.quarkus.core.BaseModel.startRoute(BaseModel.java:327)
              at org.apache.camel.quarkus.core.BaseModel.startRouteDefinitions(BaseModel.java:320)
              at org.apache.camel.quarkus.core.BaseModel.startRouteDefinitions(BaseModel.java:299)
              at org.apache.camel.quarkus.core.FastCamelContext.startRouteDefinitions(FastCamelContext.java:135)
              at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2597)
              at org.apache.camel.impl.engine.AbstractCamelContext.lambda$doStart$2(AbstractCamelContext.java:2445)
              at org.apache.camel.impl.engine.AbstractCamelContext.doWithDefinedClassLoader(AbstractCamelContext.java:2462)
              at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2443)
              at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
              at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2352)
              at org.apache.camel.quarkus.core.CamelMain.doStart(CamelMain.java:50)
              at org.apache.camel.support.service.ServiceSupport.start(ServiceSupport.java:117)
              at org.apache.camel.quarkus.core.CamelMainRecorder.start(CamelMainRecorder.java:92)
              at io.quarkus.deployment.steps.Main$start38.deploy_0(Main$start38.zig:97)
              at io.quarkus.deployment.steps.Main$start38.deploy(Main$start38.zig:36)
              at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:180)
              at io.quarkus.runtime.Application.start(Application.java:87)
              at io.quarkus.runner.RuntimeRunner.run(RuntimeRunner.java:167)
              at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:249)
              at io.quarkus.test.junit.QuarkusTestExtension.createTestInstance(QuarkusTestExtension.java:394)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstanceFactory(ClassBasedTestDescriptor.java:285)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateTestClass(ClassBasedTestDescriptor.java:275)
              at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:77)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:258)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:252)
              at java.util.Optional.orElseGet(Optional.java:267)
              at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:251)
              at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:29)
              at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:106)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:105)
              at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:69)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:107)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:107)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:75)
              at java.util.ArrayList.forEach(ArrayList.java:1257)
              at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
              at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
              at java.util.ArrayList.forEach(ArrayList.java:1257)
              at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
              at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
              at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
              at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
              at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
              at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
              at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
              at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229)
              at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197)
              at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211)
              at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191)
              at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
              at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:154)
              at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:127)
              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:377)
              at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:138)
              at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:465)
              at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:451)
      

        Attachments

          Activity

            People

            • Assignee:
              gnodet Guillaume Nodet
              Reporter:
              ppalaga Peter Palaga
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: