卡拉夫& Pax Web jetty特定的SslConnectionFactory

时间:2014-02-17 13:18:13

标签: jetty apache-karaf pax-web fusefabric

我正在尝试在Karaf内部设置一个特定的码头SSL上下文工厂(事实上,Fabric8(www.fabric8.io))。

我直接在jetty.xml文件中执行此操作: <New id="sslContextFactory" class="fr.maatg.pandora.sl.jetty.GridSslContextFactory"> ... </New>

当我启动容器时,Pax Web会生成异常(完全异常https://gist.github.com/jrevillard/adb8e0bc0b1e9b568a67):

Caused by: java.lang.ClassNotFoundException: fr.maatg.pandora.sl.jetty.GridSslContextFactory not found by org.ops4j.pax.web.pax-web-jetty [100] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955) at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_51] at org.eclipse.jetty.util.Loader.loadClass(Loader.java:100) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.nodeClass(XmlConfiguration.java:366) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:767) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:404) at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:334) at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:281) ... 16 more

有人可以告诉我如何使用我的特定工厂吗?

杰罗姆

1 个答案:

答案 0 :(得分:0)

由于pax-web-jetty包不支持动态导入“第三方”包,因此您需要创建一个包含此类的额外片段包并将其附加到pax-web-jetty包。有关如何将此添加到pax-web-jetty的工作示例,请访问the pax web samples

简而言之,片段包清单需要包含Fragment主机。使用felix-bundle-plugin,它需要看起来像这样:

<Fragment-Host>org.ops4j.pax.web.pax-web-jetty</Fragment-Host>