我使用Scala在Camel和Karaf中创建了一个非常基本的捆绑包。当我在Apache ServiceMix 7.0.0 / Karaf中安装我的软件包时,软件包将解析但无法启动。当我检查日志时,我收到消息:没有找到scheme:jetty
的组件彻底搜索此问题只会产生答案,指的是确保camel-jetty包含在pom.xml中。
我已经这样做了,但不幸的是它仍然没有工作..
我的Pom依赖项(以及其他):
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty-common</artifactId>
<version>2.16.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty9</artifactId>
<version>2.16.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jetty</artifactId>
<version>2.16.3</version>
</dependency>
Scala中的代码非常基础:
val netStart = "jetty:http://localhost:8882/userdata"
val netEnd = "file:scala/netoutput"
netStart ==> {
as (classOf[Person])
to (netEnd)
}
最后,Karaf Web控制台中显示的引用组件列表是
Imported Packages com.fasterxml.jackson.databind,version=2.8.2 from com.fasterxml.jackson.core.jackson-databind (268)
com.fasterxml.jackson.module.scala,version=2.8.2 from com.fasterxml.jackson.module.jackson.module.scala (246)
org.apache.camel,version=2.16.3 from org.apache.camel.camel-core (43)
org.apache.camel.builder,version=2.16.3 from org.apache.camel.camel-core (43)
org.apache.camel.component.jetty,version=2.16.3 from org.apache.camel.camel-jetty-common (270)
org.apache.camel.component.jetty9,version=2.16.3 from org.apache.camel.camel-jetty9 (271)
org.apache.camel.main,version=2.16.3 from org.apache.camel.camel-core (43)
org.apache.camel.scala.dsl,version=2.16.3 from org.apache.camel.camel-scala (220)
org.apache.camel.scala.dsl.builder,version=2.16.3 from org.apache.camel.camel-scala (220)
org.apache.camel.spi,version=2.16.3 from org.apache.camel.camel-core (43)
org.apache.camel.support,version=2.16.3 from org.apache.camel.camel-core (43)
org.osgi.framework,version=1.8.0 from org.apache.felix.framework (0)
scala,version=2.11.7.v20150622-112736-1fbce4612c from org.scala-lang.scala-library (213)
scala.collection,version=2.11.7.v20150622-112736-1fbce4612c from org.scala-lang.scala-library (213)
scala.collection.mutable,version=2.11.7.v20150622-112736-1fbce4612c from org.scala-lang.scala-library (213)
scala.reflect,version=2.11.7.v20150622-112736-1fbce4612c from org.scala-lang.scala-library (213)
scala.runtime,version=2.11.7.v20150622-112736-1fbce4612c from org.scala-lang.scala-library (213)
Manifest Headers Bnd-LastModified: 1474031034895
Build-Jdk: 1.8.0_91
Built-By: sander
Bundle-Activator: com.focuscura.servicemix.spielerei.MyRouteMain
Bundle-ManifestVersion: 2
Bundle-Name: MyFirstDSL
Bundle-SymbolicName: com.focuscura.servicemix.spielerei.my-first-dsl
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Export-Package: com.focuscura.servicemix.spielerei; uses:="com.fasterxml.jackson.databind, org.apache.camel, org.apache.camel.builder, org.apache.camel.component.jetty, org.apache.camel.component.jetty9, org.apache.camel.scala.dsl.builder, org.apache.camel.support, org.osgi.framework, scala, scala.collection, scala.reflect, scala.runtime"; version="1.0.0"
Import-Package: com.fasterxml.jackson.databind; version="[2.8, 3)", com.fasterxml.jackson.module.scala; version="[2.8, 3)", org.apache.camel; version="[2.16, 3)", org.apache.camel.builder; version="[2.16, 3)", org.apache.camel.component.jetty; version="[2.16, 3)", org.apache.camel.component.jetty9; version="[2.16, 3)", org.apache.camel.main; version="[2.16, 3)", org.apache.camel.scala.dsl; version="[2.16, 3)", org.apache.camel.scala.dsl.builder; version="[2.16, 3)", org.apache.camel.spi; version="[2.16, 3)", org.apache.camel.support; version="[2.16, 3)", org.osgi.framework; version="[1.8, 2)", scala; version="[2.11, 3)", scala.collection; version="[2.11, 3)", scala.collection.mutable; version="[2.11, 3)", scala.reflect; version="[2.11, 3)", scala.runtime; version="[2.11, 3)"
Manifest-Version: 1.0
Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=1.6))"
Tool: Bnd-3.0.0.201509101326
我已经安装了camel-jetty9功能,作为测试,我在xml中创建了一个蓝图路线,该路线也使用了码头路线,并且工作正常。
为什么ServiceMix / Karaf / Camel坚持要求它找不到码头的任何帮助:html:?
非常感谢!
答案 0 :(得分:1)
我们遇到了与此类似的问题,这是由Camel版本和Jetty版本无法协同工作引起的。 Camel尚未更新与Jetty 9一起使用,仅适用于Jetty 8。
如果您回滚到Service Mix 6.1.x,那么您可能会发现问题自行解决,就像在我们的情况下一样。
有关版本控制的详细信息,请参阅http://servicemix.apache.org/community/releases-schedule.html
编辑:Camel 2.18将解决这些问题,但Service Mix 7仅使用2.16