CQ5 OSGi捆绑包无法启动:-找不到激活器 [英] CQ5 OSGi bundle does not start:- Activator cannot be found

查看:202
本文介绍了CQ5 OSGi捆绑包无法启动:-找不到激活器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Mollom验证码实现(作为组件),为此我需要创建一个OSGI捆绑包.我使用eclipse创建了一个(因为它需要更多的jar才能正确编译).尽管该捆绑包创建时没有任何错误,但是当我将jar上传到OSGi控制台时,它只是无法启动.我打开error.log,发现了这个:-

I am working on a Mollom captcha implementation (as a component), for which I need an OSGI bundle created. I created one using eclipse (because it required a couple of more jars so as to compile correctly). Although the bundle was created without any errors, when I upload the jar onto the OSGi console, it just does not start. I opened up error.log and I find this:-

27.09.2013 12:10:33.264 *INFO* [pool-6-thread-34-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.impl.AgentManagerImpl Processing job for agent publish
27.09.2013 12:10:33.265 *INFO* [pool-6-thread-34-com/day/cq/replication/job/publish(com/day/cq/replication/job/publish)] com.day.cq.replication.Agent.publish Sending POST request to http://localhost:4503/bin/receive?sling:authRequestLogin=1
27.09.2013 12:10:33.346 *INFO* [0:0:0:0:0:0:0:1 [1380264033342] POST /system/console/bundles/322 HTTP/1.1] com.mollom.client BundleEvent STARTING
27.09.2013 12:10:33.346 *INFO* [0:0:0:0:0:0:0:1 [1380264033342] POST /system/console/bundles/322 HTTP/1.1] com.mollom.client BundleEvent STOPPING
27.09.2013 12:10:33.346 *INFO* [0:0:0:0:0:0:0:1 [1380264033342] POST /system/console/bundles/322 HTTP/1.1] com.mollom.client BundleEvent STOPPED
27.09.2013 12:10:33.346 *ERROR* [0:0:0:0:0:0:0:1 [1380264033342] POST /system/console/bundles/322 HTTP/1.1] cqse-httpservice %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Not found: com.mollom.client.Activator) org.osgi.framework.BundleException: Not found: com.mollom.client.Activator

问题是,我的jar 确实包含一个激活程序类(自动生成的类).

The thing is, my jar DOES contain an activator class (the auto-generated one).

这是我的清单文件:-

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Mollom Client
Bundle-SymbolicName: com.mollom.client
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.mollom.client.Activator
Bundle-Vendor: MOLLOM
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.osgi.framework;version="1.3.0"
Export-Package: com.mollom.client,
 com.mollom.client.datastructures,
 com.mollom.client.rest
Bundle-ClassPath: lib/com.sun.jersey.jersey-core-1.4.0.jar,
 lib/jersey-client.jar,
 lib/oauth-client-1.6.jar,
 lib/oauth-signature-1.4.jar,
 src/
Bundle-ActivationPolicy: lazy

我知道,将lib添加到类路径并不是最佳实践,但是我怀疑这些包含的jar都将在我的Mollom Captcha服务之外使用,所以我同意了.

I understand that adding lib to the classpath is not best practise, but I doubt any of these included jars are going to be used beyond my Mollom Captcha service, so I went with it.

我认为我的错误与我设置类路径的方式有关.

I think my error has something to do with the way I'm setting my classpath.

有人能指出我正确的方向吗?

Can anyone point me in the right direction?

推荐答案

这部分看起来很可疑:

Bundle-ClassPath: lib/com.sun.jersey.jersey-core-1.4.0.jar,
 lib/jersey-client.jar,
 lib/oauth-client-1.6.jar,
 lib/oauth-signature-1.4.jar,
 src/

您应将.(点)添加到Bundle-Classpath中,以便可以找到您的激活器(可能位于JAR_ROOT/com/mollom/client/Activator.class下).

You should add . (dot) to the Bundle-Classpath, so your activator (probably placed under JAR_ROOT/com/mollom/client/Activator.class) can be found.

更多一般性提示:为什么不使用 maven-bundle-plugin 准备捆绑包和适当的清单文件? Embed-Dependency选项允许包括所有这些额外的jar.

More general tip: why don't you use maven-bundle-plugin to prepare the bundle and proper manifest file? Embed-Dependency option allows to include all these additional jars.

这篇关于CQ5 OSGi捆绑包无法启动:-找不到激活器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆