0

I want to integrate some existing OSGi bundles and fragments in a servlet and run it on Tomcat 7. Following this tutorial http://www.javaworld.com/javaworld/jw-06-2008/jw-06-osgi3.html I managed to run the bundles on the server. I read, that fragments have no life-cycle, so I assumed, I just have to run the bundle and the fragments are found automatically. Nevertheless, when the bundle is started on the server, it seems as if the OSGi fragments are not found. Calling "ss" on the OSGi console, I can see that my bundle is active. The fragment has the status "INSTALLED".

31  ACTIVE      myBundle
34  INSTALLED   myFragment

Since the integration of the fragment in the bundle worked, when I run it in Eclipse (as OSGi platfrom), I assume, that the Manifest.MF files are correct. Is this assumption correct?

Or is there another point I missed? Do I need to "start" the fragment somehow?

Thanks!

4

1 回答 1

1

我刚刚在这里找到了答案: 如何确保我的 OSGi 片段在主机包之前安装?

引用:“人们在 OSGi 中犯的最常见错误之一是试图在安装后立即启动每个包。你不能这样做,即在你安装了所有你打算运行的包之后,你不应该启动任何包。”

于 2013-06-17T15:15:08.200 回答