Apache Camel 2.15.2无法创建jetty实例



当我使用2.14版本的camel时,我能够获得jetty实例创建…然而,2.15.2在tomcat加载应用程序

时给出以下错误

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

这是我的camel上下文配置的样子

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

Camel已经很长时间没有更新他们的Jetty版本了

官方文档camel.apache.org/jetty.html有codehaus.org(一个不再存在的网站!)

camel.apache.org/maven/camel-2.14.0/camel-jetty/apidocs/org/apache/camel/component/jetty/JettyHttpComponent.html上的apidoc引用引用了org.eclipse.jetty.server.nio.SelectChannelConnector,这意味着它们使用的是Jetty 7或Jetty 8。

7号码头和8号码头都已报废。

但并非一切都输了……

从Camel 2.15.0开始支持Jetty 9。

  • 使用新的camel-component- jety9模块支持Jetty 9

建议升级Camel

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

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

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"

最新更新