You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/02/21 09:10:00 UTC
[jira] [Resolved] (CAMEL-16243) camel-restlet : Compatibility issue
of camel-restlet with camel-api library resulting in e
"NoSuchMethodError:org.apache.camel.CamelContext.getRestConfiguration(Ljava/lang/String;Z)Lorg/apache/camel/spi/RestConfiguration"
in RestletComponent class
[ https://issues.apache.org/jira/browse/CAMEL-16243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-16243.
---------------------------------
Resolution: Invalid
camel-restlet is removed, as documented in the migration guide. And its deprecated in 2.x.
> camel-restlet : Compatibility issue of camel-restlet with camel-api library resulting in e "NoSuchMethodError:org.apache.camel.CamelContext.getRestConfiguration(Ljava/lang/String;Z)Lorg/apache/camel/spi/RestConfiguration" in RestletComponent class
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-16243
> URL: https://issues.apache.org/jira/browse/CAMEL-16243
> Project: Camel
> Issue Type: Bug
> Components: camel-restlet
> Environment: Open JDK 11.0.2
> Reporter: Pawan Mundhra
> Priority: Major
> Fix For: 3.x
>
>
>
> Recently we upgraded our Application's overall camel version from 2.16.0 to 3.4.4
> One of the component we used in our Application was camel-restlet component (version 2.16.0).
> Issue #1 : It seems camel removed the restlet component after 3.x. Could not find much documentation which would let us know how to migrate the existing camel-restlet component
> Issue #2 : We gave a try to upgrade the camel-restlet component to 3.0.0-RC2. But during start-up of our service, we faced an error as mentioned in the below stack trace.
> {code:java}
> Exception in thread "main" java.lang.NoSuchMethodError: org.apache.camel.CamelContext.getRestConfiguration(Ljava/lang/String;Z)Lorg/apache/camel/spi/RestConfiguration;
> at org.apache.camel.component.restlet.RestletComponent.doStart(RestletComponent.java:215)
> at org.apache.camel.support.service.BaseService.start(BaseService.java:115)
> at org.apache.camel.impl.engine.AbstractCamelContext.startService(AbstractCamelContext.java:3026)
> at org.apache.camel.impl.engine.AbstractCamelContext.startServices(AbstractCamelContext.java:3032)
> at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2759)
> at org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2658)
> at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2621)
> at org.apache.camel.support.service.BaseService.start(BaseService.java:115)
> at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2453)
> at com.nri.csd.inf.console.service.GatewayService.startCamelContextIfNotStarted(GatewayService.java:201)
> at com.nri.csd.inf.console.service.GatewayService.postStart(GatewayService.java:100)
> at com.nri.csd.inf.console.service.AbstractLaunchableService.start(AbstractLaunchableService.java:216)
> at com.nri.csd.inf.console.ConsoleLauncher.main(ConsoleLauncher.java:96)
> {code}
> Found in the code that RestletComponent java class in camel-restlet-3.0.0-RC2 version has an API doStart() in which at line 215, there is a call to CamelContext class's method getRestConfiguration("restlet", true) (class in camel-api jar).
>
> {code:java}
> 210 @Override
> 211 protected void doStart() throws Exception {
> 212 super.doStart();
> 213
> 214 // configure component options
> 215 RestConfiguration config = getCamelContext().getRestConfiguration("restlet", true);
> 216 // configure additional options on spark configuration
> 217 if (config.getComponentProperties() != null && !config.getComponentProperties().isEmpty()) {
> 218 setProperties(this, config.getComponentProperties());
> 219 }
> 220
> 221 cleanupConverters(enabledConverters);
> 222
> 223 component.start();
> 2234 }
> {code}
> The API called at line 215 above (i.e. getRestConfiguration) seems to be removed from the class org.apache.camel.CamelContext in library camel-api during upgradation to 3.2 from 3.1.
> Refer this [https://camel.apache.org/manual/latest/camel-3x-upgrade-guide-3_2.html]
> It seems that there is incompatibility with camel-restlet 3.0.0-RC2 along with Camel 3.2 and above.
>
> However the above API in org.apache.camel.CamelContext in camel-api-3.0.0-RC2 is modified but I am having a transitive dependency upon camel-api-3.4 library and it seems that both camel-api-3.4 and camel-api-3.0.0-RC2 cannot be kept together.
>
> One solution I can think of is revert the downgrade the Camel version to 3.1 instead of 3.4 which we would like to avoid.
> Please suggest what course of action can be taken for this issue with minimum impact or what is the compatibility of camel-restlet component and camel-api, camel-support libraries. We want all to be compatible with camel 3.4.0 version.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)