在OSGi中创建Akka项目

时间:2012-07-23 08:22:31

标签: scala osgi akka

我希望在OSGi容器(apache-servicemix-4.4.1-fuse-06-03)中运行一个Akka项目,但在安装依赖库时遇到一些麻烦。我已按以下方式安装了akka-actorconfig

  • osgi:install -s mvn:com.typesafe.akka/akka-actor/2.1-SNAPSHOT
  • osgi:install -s mvn:com.typesafe/config/0.4.1

但无法安装scala-library(需要v2.9.2)。我已尝试使用maven-bundle-plugin创建自己的捆绑包但无效,并且已经使用Google搜索了很长时间。

非常感谢任何帮助。

3 个答案:

答案 0 :(得分:4)

如果您正在寻找快速解决方法,请使用Scala IDE / Eclipse for Scala 2.9.2中的捆绑包。我为我的Akka 2.1 / Karaf POC做了这个,它工作得很好。如果您没有,请从my lib folder here下载。

答案 1 :(得分:1)

这是在scala-users群组上发帖后上传的:

https://github.com/guofengzh/scala-lang-osgi

答案 2 :(得分:0)

@ ben1729引用的scala-lang-osgi的内置二进制文件现已在我们的Bippo / Soluvas Nexus存储库公共存储库中提供:http://nexus.bippo.co.id/nexus/content/groups/public/

欢迎在http://nexus.bippo.co.id/nexus/

浏览我们的存储库

用法:

<repository>
    <id>bippo-nexus-public</id>
    <url>http://nexus.bippo.co.id/nexus/content/groups/public/</url>
</repository>

然后将其中一个或全部添加到Maven POM文件中:

<dependency>
  <groupId>org.scala-lang-osgi</groupId>
  <artifactId>scala-library</artifactId>
  <version>2.9.2</version>
</dependency>
<dependency>
  <groupId>org.scala-lang-osgi</groupId>
  <artifactId>scala-compiler</artifactId>
  <version>2.9.2</version>
</dependency>
<dependency>
  <groupId>org.scala-lang-osgi</groupId>
  <artifactId>scala-dbc</artifactId>
  <version>2.9.2</version>
</dependency>
<dependency>
  <groupId>org.scala-lang-osgi</groupId>
  <artifactId>scala-swing</artifactId>
  <version>2.9.2</version>
</dependency>

请在新版本发布时通知我,以便我可以将新工件重新部署到我们的仓库。

更新: Scala OSGi 2.10-M6现已在我们的存储库中提供:

<dependency>
  <groupId>org.scala-lang-osgi</groupId>
  <artifactId>scala-library</artifactId>
  <version>2.10.0-M6</version>
</dependency>
<dependency>
  <groupId>org.scala-lang-osgi</groupId>
  <artifactId>scala-compiler</artifactId>
  <version>2.10.0-M6</version>
</dependency>
<dependency>
  <groupId>org.scala-lang-osgi</groupId>
  <artifactId>scala-dbc</artifactId>
  <version>2.10.0-M2</version>
</dependency>
<dependency>
  <groupId>org.scala-lang-osgi</groupId>
  <artifactId>scala-swing</artifactId>
  <version>2.10.0-M6</version>
</dependency>

它可以与Akka合作,但使用打补丁 Akka 2.1-M1(参见http://www.assembla.com/spaces/akka/tickets/2367-osgi-manifest-references-2-9-2)。

补丁的Akka在我们的存储库中可用:(在Karaf URL中)

mvn:com.typesafe.akka/akka-actor/2.1-M1/jar/patch2

关于Akka bug的摘要:Akka 2.1-M1需要2.10-M6,它不适用于2.9.2:

Error executing command: Error starting bundles:
nable to resolve 160.0: missing requirement [160.0] osgi.wiring.package; (&(osgi.wiring.package=scala.collection.convert)(version>=2.9.2)(!(version>=2.10.0)))      

但它目前导入了错误的软件包版本:

    scala.collection.convert;version="[2.9.2,2.10)",
    scala.concurrent.util;version="[2.9.2,2.10)",
    scala.concurrent.util.duration;version="[2.9.2,2.10)",