我在Eclipse Luna Java EE版本中创建了一个简单的Bundle,并且能够使用Equinox框架在Eclipse中运行该包。
当我将此捆绑包(Export->插件开发 - >可部署的插件和片段)直接导出到Karaf-3.0.3的部署目录中时,捆绑包无法启动并显示karaf日志(注意:Karaf部署到C:\ Karaf303目录)。感谢您的任何见解:
2015-02-16 09:47:26,747 | ERROR | \Karaf303/deploy | fileinstall | 7 - org.apache.felix.fileinstall - 3.4.2 | Failed to install artifact: C:\Karaf303\deploy\plugins
java.net.MalformedURLException: Invalid syntax for instruction [Bundle-SymbolicName=C:\Karaf303\deploy\plugins]. Take a look at http://www.aqute.biz/Code/Bnd.
at org.ops4j.pax.swissbox.bnd.BndUtils.parseInstructions(BndUtils.java:302)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.wrap.internal.Parser.<init>(Parser.java:116)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.wrap.internal.Connection.<init>(Connection.java:67)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.wrap.internal.Activator$1.createConnection(Activator.java:59)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.wrap.internal.Activator$1.createConnection(Activator.java:49)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.ops4j.pax.url.commons.handler.HandlerActivator$Handler.openConnection(HandlerActivator.java:222)[2:org.ops4j.pax.url.wrap:2.3.0]
at org.apache.felix.framework.URLHandlersStreamHandlerProxy.openConnection(URLHandlersStreamHandlerProxy.java:271)[org.apache.felix.framework-4.2.1.jar:]
at java.net.URL.openConnection(URL.java:971)[:1.7.0_51]
at java.net.URL.openStream(URL.java:1037)[:1.7.0_51]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:943)[7:org.apache.felix.fileinstall:3.4.2]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:865)[7:org.apache.felix.fileinstall:3.4.2]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:482)[7:org.apache.felix.fileinstall:3.4.2]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:358)[7:org.apache.felix.fileinstall:3.4.2]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:310)[7:org.apache.felix.fileinstall:3.4.2]
答案 0 :(得分:0)
找出问题所在 - Eclipse正在将jar导出到Karaf的指定部署目录,但是将jar放在deploy下的子目录plugins下。直接在部署下移动JAR使其成功部署。