Apache Camel 2.15.2 无法创建码头实例 [英] Apache Camel 2.15.2 not able to create jetty instance

查看:24
本文介绍了Apache Camel 2.15.2 无法创建码头实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 2.14 版本的骆驼时,我能够创建码头实例...但是 2.15.2 在 tomcat 加载应用程序时出现以下错误

When I was using 2.14 version of camel, I was able to get jetty instance created... however 2.15.2 is giving below error while tomcat loads the app

org.springframework.beans.factory.BeanCreationException:在 ServletContext 资源 [/WEB-INF/classes/camel-context.xml] 中定义名称为jetty"的 bean 创建时出错:bean 实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [org.apache.camel.component.jetty.JettyHttpComponent]:它是一个抽象类吗?嵌套异常是 java.lang.InstantiationException

这是我的骆驼上下文配置的样子

Here is how my camel context config looks like

bean id="jetty" class="org.apache.camel.component.jetty.JettyHttpComponent"

推荐答案

从 Camel 2.15 开始,Jetty 组件分派了两个组件 camel-jetty8camel-jetty9.camel-jetty,只包含一个不能实例化的抽象类.

Since Camel 2.15, Jetty component has been dispatched in two components camel-jetty8 and camel-jetty9. camel-jetty, only contains an abstract class that you cannot instantiate.

导入camel-jetty8camel-jetty9后,你可以简单地替换你的行:

After importing camel-jetty8 or camel-jetty9, you can simply replace your line:

bean id="jetty" class="org.apache.camel.component.jetty.JettyHttpComponent"

bean id="jetty" class="org.apache.camel.component.jetty8.JettyHttpComponent8"

bean id="jetty" class="org.apache.camel.component.jetty9.JettyHttpComponent9"

这篇关于Apache Camel 2.15.2 无法创建码头实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆