我打算开始OSGi
在Android上的Web服务,其中我将能够在Android浏览器上运行的Java服务器页面(JSP)和Java Servlets。
我最初的步骤安装Knopflerfish
在Android上。 我按照从knopflerfish本教程: http://www.knopflerfish.org/releases/5.0.0/docs/android_dalvik_tutorial.html
在Android手机的浏览器8080:Knopflerfish做的很好,我已经看到了本地主机。
我的第二个步骤是安装Pax Web
上Knopflerfish这也安装在Android上。 我也跟着他们的教程从这里开始: http://www.knopflerfish.org/kf_pax_web_tutorial.html
本教程说:
卸载KF HTTP束
第一步是停止HTTP根束和卸载JSDK和HTTP服务器束作为PaxWeb将接管该功能。 通常情况下,你将最有可能也是要卸载的HTTP根束,但在本教程中,我们会离开它安装。 之前,请务必准备下一步执行刷新包。
然后:
安装PaxWeb
第二步是安装并从PaxWeb启动以下束。
- PAX-Web的JSP-1.0.2.jar(安装)
- PAX-Web的码头束-1.0.2.jar(安装和启动)
- PAX-Web的扩展,战争0.8.0.jar(安装和启动)
在Pax Web
包已成功安装。
问题
在Pax Web
包无法启动。
它给我的控制台上的错误信息,当我尝试启动HTTP-root-IMP
这是一个Knopflerfish包。
[stderr] ## DEBUG: errors - FrameworkErrorEvent bundle #20
[stderr] ## DEBUG: errors - FrameworkErrorEvent throwable:
Couldn't start bundle: HTTP-root-IMPL (#20) (due to: org.osgi.framework.BundleException: Bundle#20, unable to resolve: Missing package(s) or can not resolve all of the them:
org.osgi.service.http;version=[1.1.0,2.0.0) -- Could not resolve exporting bundle - org.osgi.service.http;version=1.2.0 Bundle[id=16,gen=0].
javax.servlet.http;version=[2.5.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet.http;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet;version=[2.5.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet;version=2.5.0 Bundle[id=16,gen=0].)
org.osgi.framework.BundleException: Bundle#20, unable to resolve: Missing package(s) or can not resolve all of the them:
org.osgi.service.http;version=[1.1.0,2.0.0) -- Could not resolve exporting bundle - org.osgi.service.http;version=1.2.0 Bundle[id=16,gen=0].
javax.servlet.http;version=[2.5.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet.http;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet;version=[2.5.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet;version=2.5.0 Bundle[id=16,gen=0].
at org.knopflerfish.framework.BundleImpl.getUpdatedState(BundleImpl.java:1259)
at org.knopflerfish.framework.BundleImpl.finalizeActivation(BundleImpl.java:312)
at org.knopflerfish.framework.PermissionOps.callFinalizeActivation(PermissionOps.java:265)
at org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:295)
at org.knopflerfish.bundle.frameworkcommands.FrameworkCommandGroup.cmdStart(FrameworkCommandGroup.java:1634)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at org.knopflerfish.service.console.CommandGroupAdapter.execute(CommandGroupAdapter.java:256)
at org.knopflerfish.bundle.console.Command$2.run(Command.java:239)
at java.security.AccessController.doPrivileged(AccessController.java:45)
at org.knopflerfish.bundle.console.Command.run(Command.java:226)
at java.lang.Thread.run(Thread.java:856)
另一种是当我将开始从束Pax Web
从Knopflerfish教程。 在这里,我试图启动pax-web-jetty-bundle-1.0.2.jar (OPS4J Pax Web - Jetty Bundle)
:
[stderr] ## DEBUG: errors - FrameworkErrorEvent bundle #16
[stderr] ## DEBUG: errors - FrameworkErrorEvent throwable:
Couldn't start bundle: OPS4J Pax Web - Jetty Bundle (#16) (due to: org.osgi.framework.BundleException: Bundle#16, unable to resolve: Missing package(s) or can not resolve all of the them:
javax.security.sasl -- No providers found.
javax.management.remote -- No providers found.
javax.management.modelmbean -- No providers found.
javax.management -- No providers found.)
org.osgi.framework.BundleException: Bundle#16, unable to resolve: Missing package(s) or can not resolve all of the them:
javax.security.sasl -- No providers found.
javax.management.remote -- No providers found.
javax.management.modelmbean -- No providers found.
javax.management -- No providers found.
at org.knopflerfish.framework.BundleImpl.getUpdatedState(BundleImpl.java:1259)
at org.knopflerfish.framework.BundleImpl.finalizeActivation(BundleImpl.java:312)
at org.knopflerfish.framework.PermissionOps.callFinalizeActivation(PermissionOps.java:265)
at org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:295)
at org.knopflerfish.bundle.frameworkcommands.FrameworkCommandGroup.cmdStart(FrameworkCommandGroup.java:1634)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at org.knopflerfish.service.console.CommandGroupAdapter.execute(CommandGroupAdapter.java:256)
at org.knopflerfish.bundle.console.Command$2.run(Command.java:239)
at java.security.AccessController.doPrivileged(AccessController.java:45)
at org.knopflerfish.bundle.console.Command.run(Command.java:226)
at java.lang.Thread.run(Thread.java:856)
最后,当我尝试运行pax-web-extender-war-0.8.0.jar (OPS4J Pax Web - Extender - War)
这个错误信息也将出现:
[stderr] ## DEBUG: errors - FrameworkErrorEvent bundle #17
[stderr] ## DEBUG: errors - FrameworkErrorEvent throwable:
Couldn't start bundle: OPS4J Pax Web - Extender - WAR (#17) (due to: org.osgi.framework.BundleException: Bundle#17, unable to resolve: Missing package(s) or can not resolve all of the them:
org.osgi.service.http;version=[1.0.0,2.0.0) -- Could not resolve exporting bundle - org.osgi.service.http;version=1.2.0 Bundle[id=16,gen=0].
javax.servlet.http;version=2.1.0 -- Could not resolve exporting bundle - javax.servlet.http;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet;version=2.1.0 -- Could not resolve exporting bundle - javax.servlet;version=2.5.0 Bundle[id=16,gen=0].)
org.osgi.framework.BundleException: Bundle#17, unable to resolve: Missing package(s) or can not resolve all of the them:
org.osgi.service.http;version=[1.0.0,2.0.0) -- Could not resolve exporting bundle - org.osgi.service.http;version=1.2.0 Bundle[id=16,gen=0].
javax.servlet.http;version=2.1.0 -- Could not resolve exporting bundle - javax.servlet.http;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet;version=2.1.0 -- Could not resolve exporting bundle - javax.servlet;version=2.5.0 Bundle[id=16,gen=0].
at org.knopflerfish.framework.BundleImpl.getUpdatedState(BundleImpl.java:1259)
at org.knopflerfish.framework.BundleImpl.finalizeActivation(BundleImpl.java:312)
at org.knopflerfish.framework.PermissionOps.callFinalizeActivation(PermissionOps.java:265)
at org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:295)
at org.knopflerfish.bundle.frameworkcommands.FrameworkCommandGroup.cmdStart(FrameworkCommandGroup.java:1634)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at org.knopflerfish.service.console.CommandGroupAdapter.execute(CommandGroupAdapter.java:256)
at org.knopflerfish.bundle.console.Command$2.run(Command.java:239)
at java.security.AccessController.doPrivileged(AccessController.java:45)
at org.knopflerfish.bundle.console.Command.run(Command.java:226)
at java.lang.Thread.run(Thread.java:856)
我也试着开始pax-web-jsp-1.0.2.jar (OPS4J Pax Web - Jsp Support)
中显示此错误消息:
[stderr] ## DEBUG: errors - FrameworkErrorEvent bundle #15
[stderr] ## DEBUG: errors - FrameworkErrorEvent throwable:
Couldn't start bundle: OPS4J Pax Web - Jsp Support (#15) (due to: org.osgi.framework.BundleException: Bundle#15, unable to resolve: Missing package(s) or can not resolve all of the them:
javax.tools -- No providers found.
javax.servlet.resources;version=[2.3.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet.resources;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet.http;version=[2.3.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet.http;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet;version=[2.3.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet;version=2.5.0 Bundle[id=16,gen=0].
javax.lang.model.util -- No providers found.
javax.lang.model.type -- No providers found.
javax.lang.model.element -- No providers found.
javax.lang.model -- No providers found.
javax.annotation.processing -- No providers found.)
org.osgi.framework.BundleException: Bundle#15, unable to resolve: Missing package(s) or can not resolve all of the them:
javax.tools -- No providers found.
javax.servlet.resources;version=[2.3.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet.resources;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet.http;version=[2.3.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet.http;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet;version=[2.3.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet;version=2.5.0 Bundle[id=16,gen=0].
javax.lang.model.util -- No providers found.
javax.lang.model.type -- No providers found.
javax.lang.model.element -- No providers found.
javax.lang.model -- No providers found.
javax.annotation.processing -- No providers found.
at org.knopflerfish.framework.BundleImpl.getUpdatedState(BundleImpl.java:1259)
at org.knopflerfish.framework.BundleImpl.finalizeActivation(BundleImpl.java:312)
at org.knopflerfish.framework.PermissionOps.callFinalizeActivation(PermissionOps.java:265)
at org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:295)
at org.knopflerfish.bundle.frameworkcommands.FrameworkCommandGroup.cmdStart(FrameworkCommandGroup.java:1634)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at org.knopflerfish.service.console.CommandGroupAdapter.execute(CommandGroupAdapter.java:256)
at org.knopflerfish.bundle.console.Command$2.run(Command.java:239)
at java.security.AccessController.doPrivileged(AccessController.java:45)
at org.knopflerfish.bundle.console.Command.run(Command.java:226)
at java.lang.Thread.run(Thread.java:856)
从我已经从错误消息了解,束在寻找这些软件包。 有没有什么办法可以解决这一点,并能够成功地运行与OSGi框架Android上的Java Web应用程序?
org.osgi.service.http;version=[1.1.0,2.0.0) -- Could not resolve exporting bundle - org.osgi.service.http;version=1.2.0 Bundle[id=16,gen=0].
javax.servlet.http;version=[2.5.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet.http;version=2.5.0 Bundle[id=16,gen=0].
javax.servlet;version=[2.5.0,3.0.0) -- Could not resolve exporting bundle - javax.servlet;version=2.5.0 Bundle[id=16,gen=0].
javax.security.sasl -- No providers found.
javax.management.remote -- No providers found.
javax.management.modelmbean -- No providers found.
javax.management -- No providers found.