我使用osgi
容器(virgo
)[我不是那么擅长]。添加akka依赖到osgi容器
我添加了一个依赖于我的pom.xml
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-osgi_2.10</artifactId>
<version>2.2-M3</version>
</dependency>
我把akka-osgi_2.10-2.2-M3.jar
我的lib /部署文件夹OSGI
服务器(以myserver/repository/usr
)。
我追加的虚拟演员到我的代码库:
import akka.actor.UntypedActor;
public class ManagerActor extends UntypedActor {
@Override
public void onReceive(Object o) throws Exception {
// ...
}
}
我建立并启动我的应用程序。
而作为结果,我在我的日志中出现以下异常(它抱怨到version="0.0.0"
):
.. failed. org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.
com.mycompnay.mything-security' at version '1.0.1.BUILD-SNAPSHOT': Cannot resolve: com.mycompany.mything-security
Resolver report:
An Import-Package could not be resolved. Resolver error data <Import-Package: akka.actor; version="0.0.0">. Caused by missing constrai
nt in bundle <com.mycompany.mything-security_1.0.1.BUILD-SNAPSHOT>
constraint: <Import-Package: akka.actor; version="0.0.0">
我去我template.mf
文件,它是用来生成最终MANIFEST.MF
文件。指定我使用的AKKA lib版本的范围。放在那里:
Import-Template:
akka.actor.*;version="[2.2.0.M3, 2.3)"
Import-Package:
akka.actor;version="[2.2.0.M3, 2.3)"
然后重建并启动应用程序。
但在控制台它抱怨到阿卡版本(抱怨到现在version="[2.2.0.M3,2.3.0)"
):
An Import-Package could not be resolved. Resolver error data <Import-Package: akka.actor; version="[2.2.0.M3,2.3.0)">. Caused by missi
ng constraint in bundle <com.mycompany.mything-security_1.0.1.BUILD-SNAPSHOT>
constraint: <Import-Package: akka.actor; version="[2.2.0.M3,2.3.0)">
问:怎么了?
我也试图将此行添加:到Import-Bundle
:
Import-Bundle:
...
com.typesafe.akka.osgi;version="[2.2.0.M3, 2.3)"
然后,我有它在日志中(现在抱怨到com.typesafe.akka.osgi版本):
.. failed. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Unable to satisfy dependencies of bundle 'com.mycompany.mything-security
' at version '1.0.1.BUILD-SNAPSHOT': Import-Bundle with symbolic name 'com.typesafe.akka.osgi' in version range '[2.2.0.M3, oo)' could not be
satisfied