Apache Camel 2.15.2无法创建码头实例 [英] Apache Camel 2.15.2 not able to create jetty instance
问题描述
当我使用2.14版本的骆驼时,我能够创建码头实例...但是,当tomcat加载应用程序时,2.15.2给出了以下错误
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: Error creating bean with name 'jetty' defined in ServletContext resource [/WEB-INF/classes/camel-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.camel.component.jetty.JettyHttpComponent]: Is it an abstract class?; nested exception is java.lang.InstantiationException
这是我的骆驼上下文配置的样子
Here is how my camel context config looks like
bean id="jetty" class="org.apache.camel.component.jetty.JettyHttpComponent"
推荐答案
自骆驼2.15开始,Jetty组件已分派到两个组件camel-jetty8
和camel-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-jetty8
或camel-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屋!