You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Federico Mariani (Jira)" <ji...@apache.org> on 2021/12/23 19:56:00 UTC

[jira] [Commented] (CAMEL-17373) camel-fhir unrecognized camel.component.fhir.server-url in 3.15.0-SNAPSHOT

    [ https://issues.apache.org/jira/browse/CAMEL-17373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17464770#comment-17464770 ] 

Federico Mariani commented on CAMEL-17373:
------------------------------------------

Hi, I think component init is not working because endpoint properties are not set on the configuration object, I managed to fix it by overriding {_}protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exceptio{_}, though an afterPropertiesSet protected method would be nice to have to init client, here you can see the changes [https://github.com/apache/camel/compare/main...Croway:CAMEL-17373?expand=1]

In particular I just refactored
{code:java}
if (endpointConfiguration.getClient() == null) {
                if (configuration != null) {
                    endpointConfiguration.setServerUrl(configuration.getServerUrl());
                    endpointConfiguration.setFhirContext(configuration.getFhirContext());
                }

                endpointConfiguration.setClient(createClient(endpointConfiguration));
            }
{code}
from _createEndpoint_ to _"afterPropertiesSet"._
WDYT? am I missing something?

> camel-fhir unrecognized camel.component.fhir.server-url in 3.15.0-SNAPSHOT
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-17373
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17373
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-fhir
>    Affects Versions: 3.15.0
>            Reporter: Zineb Bendhiba
>            Priority: Major
>             Fix For: 3.15.0
>
>
> Hello,
> it seems that latest changes in 3.15.0-SNAPSHOT, are failing tests using the 
> camel.component.fhir.server-url parameter. 
>  
> Also, I can't have a successfull build on my local machine of the components.
> Example of errors:
> {code:java}
> [ERROR] org.apache.camel.component.fhir.FhirExtraParametersIT.testEncodeRequestToXml  Time elapsed: 0.01 s  <<< ERROR!
> org.apache.camel.FailedToCreateRouteException: Failed to create route route55 at: >>> To[fhir://search/searchByUrl?inBody=url] <<< in route: Route(route55)[From[direct://SEARCH_BY_URL] -> [To[fhir://se... because of Failed to resolve endpoint: fhir://search/searchByUrl?inBody=url due to: The FHIR URL must be set!
>         at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:240)
>         at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74)
>         at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:868)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:758)
>         at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2862)
>         at org.apache.camel.support.service.BaseService.init(BaseService.java:83)
>         at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2568)
>         at org.apache.camel.support.service.BaseService.start(BaseService.java:111)
>         at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2587)
>         at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:247)
>         at org.apache.camel.test.junit5.CamelTestSupport.startCamelContext(CamelTestSupport.java:754)
>         at org.apache.camel.test.junit5.CamelTestSupport.doSetUp(CamelTestSupport.java:528)
>         at org.apache.camel.test.junit5.CamelTestSupport.setUp(CamelTestSupport.java:369)
>         at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
>         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
>         at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
>         at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
>         at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
>         at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
>         at org.junit.jupiter.engine.extension.TimeoutExtension.interceptLifecycleMethod(TimeoutExtension.java:126)
>         at org.junit.jupiter.engine.extension.TimeoutExtension.interceptBeforeEachMethod(TimeoutExtension.java:76)
>         at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
>         at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
>         at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
>         at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
>         at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
>         at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
>         at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
>         at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
>         at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeMethodInExtensionContext(ClassBasedTestDescriptor.java:506)
>         at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$synthesizeBeforeEachMethodAdapter$21(ClassBasedTestDescriptor.java:491)
>         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachMethods$3(TestMethodTestDescriptor.java:171)
>         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeMethodsOrCallbacksUntilExceptionOccurs$6(TestMethodTestDescriptor.java:199)
>         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeMethodsOrCallbacksUntilExceptionOccurs(TestMethodTestDescriptor.java:199)
>         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeEachMethods(TestMethodTestDescriptor.java:168)
>         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131)
>         at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
>         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
>         at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
>         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
>         at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
>         at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
>         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
>         at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
>         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
>         at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
>         at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
>         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
>         at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
>         at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
>         at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
>         at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
>         at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
>         at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
>         at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
>         at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
>         at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
>         at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
>         at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
>         at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
>         at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
>         at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
>         at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
>         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)
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: fhir://search/searchByUrl?inBody=url due to: The FHIR URL must be set!
>         at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:969)
>         at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:851)
>         at org.apache.camel.support.CamelContextHelper.resolveEndpoint(CamelContextHelper.java:123)
>         at org.apache.camel.reifier.SendReifier.resolveEndpoint(SendReifier.java:43)
>         at org.apache.camel.reifier.SendReifier.createProcessor(SendReifier.java:36)
>         at org.apache.camel.reifier.ProcessorReifier.makeProcessor(ProcessorReifier.java:838)
>         at org.apache.camel.reifier.ProcessorReifier.addRoutes(ProcessorReifier.java:579)
>         at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:236)
>         ... 85 more
> Caused by: org.apache.camel.RuntimeCamelException: The FHIR URL must be set!
>         at org.apache.camel.component.fhir.internal.FhirHelper.getFhirContext(FhirHelper.java:147)
>         at org.apache.camel.component.fhir.internal.FhirHelper.createClient(FhirHelper.java:50)
>         at org.apache.camel.component.fhir.FhirComponent.createClient(FhirComponent.java:64)
>         at org.apache.camel.component.fhir.FhirComponent.createEndpoint(FhirComponent.java:57)
>         at org.apache.camel.component.fhir.FhirComponent.createEndpoint(FhirComponent.java:29)
>         at org.apache.camel.support.component.AbstractApiComponent.createEndpoint(AbstractApiComponent.java:87)
>         at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171)
>         at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:935)
>         ... 92 more{code}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)