大同网络上Knopflerfish在Android [英] Pax Web on Knopflerfish on Android
问题描述
我正打算启动的OSGi
在Android上的Web服务,其中我将能够在Android浏览器上运行的Java服务器页面(JSP)和Java Servlets。
我最初的步骤是在Android上安装 Knopflerfish
。我按照从knopflerfish本教程: http://www.knopflerfish.org /releases/5.0.0/docs/android_dalvik_tutorial.html
Knopflerfish做的很好,我已经看到了本地主机:8080对Android手机的浏览器
我的第二个步骤是在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(安装和放大器;启动)
块引用>的
大同网站
包已成功安装。问题
的
大同网站
捆绑无法启动。这让我在控制台上此错误消息,当我尝试启动
HTTP-根IMP
这是一个Knopflerfish包。[标准错误] ## DEBUG:错误 - FrameworkErrorEvent包#20
[标准错误] ## DEBUG:错误 - FrameworkErrorEvent抛出:
无法启动包:HTTP-根IMPL(#20)(由于:org.osgi.framework.BundleException:捆绑#20,无法解决:缺少包(S)或不能解决所有的人:
org.osgi.service.http;版本= [1.1.0,2.0.0) - 无法解析捆绑出口 - org.osgi.service.http;版本1.2.0 =捆绑[ID = 16,创= 0] 。
javax.servlet.http包,版本= [2.5.0,3.0.0) - 无法解析捆绑出口 - javax.servlet.http包,版本2.5.0 =捆绑[ID = 16,创= 0。
的javax.servlet;版本= [2.5.0,3.0.0) - 无法解析捆绑出口 - 的javax.servlet;版本2.5.0 =捆绑[ID = 16,创= 0])。
org.osgi.framework.BundleException:捆绑#20,无法解决:缺少包(S)或不能解决所有的人:
org.osgi.service.http;版本= [1.1.0,2.0.0) - 无法解析捆绑出口 - org.osgi.service.http;版本1.2.0 =捆绑[ID = 16,创= 0] 。
javax.servlet.http包,版本= [2.5.0,3.0.0) - 无法解析捆绑出口 - javax.servlet.http包,版本2.5.0 =捆绑[ID = 16,创= 0。
的javax.servlet;版本= [2.5.0,3.0.0) - 无法解析捆绑出口 - 的javax.servlet;版本2.5.0 =捆绑[ID = 16,创= 0。
在org.knopflerfish.framework.BundleImpl.getUpdatedState(BundleImpl.java:1259)
在org.knopflerfish.framework.BundleImpl.finalizeActivation(BundleImpl.java:312)
在org.knopflerfish.framework.PermissionOps.callFinalizeActivation(PermissionOps.java:265)
在org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:295)
在org.knopflerfish.bundle.frameworkcommands.FrameworkCommandGroup.cmdStart(FrameworkCommandGroup.java:1634)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:511)
在org.knopflerfish.service.console.CommandGroupAdapter.execute(CommandGroupAdapter.java:256)
在org.knopflerfish.bundle.console.Command $ 2.run(Command.java:239)
在java.security.AccessController.doPrivileged(AccessController.java:45)
在org.knopflerfish.bundle.console.Command.run(Command.java:226)
在java.lang.Thread.run(Thread.java:856)另外一个是,当我将从
从Knopflerfish大同网站
教程开始包。在这里,我试图启动PAX-Web的码头束-1.0.2.jar(OPS4J大同网站 - 码头捆绑)
:[标准错误] ## DEBUG:错误 - FrameworkErrorEvent捆#16
[标准错误] ## DEBUG:错误 - FrameworkErrorEvent抛出:
无法启动包:OPS4J大同网站 - 码头捆绑(#16)(由于:org.osgi.framework.BundleException:捆绑#16,无法解决:缺少包(S)或不能解决所有的人:
javax.security.sasl中 - 没有找到供应商。
javax.management.remote中 - 没有找到供应商。
javax.management.modelmbean中 - 没有找到供应商。
javax.management - 没有找到供应商)。
org.osgi.framework.BundleException:捆绑#16,无法解决:缺少包(S)或不能解决所有的人:
javax.security.sasl中 - 没有找到供应商。
javax.management.remote中 - 没有找到供应商。
javax.management.modelmbean中 - 没有找到供应商。
javax.management - 没有找到供应商。
在org.knopflerfish.framework.BundleImpl.getUpdatedState(BundleImpl.java:1259)
在org.knopflerfish.framework.BundleImpl.finalizeActivation(BundleImpl.java:312)
在org.knopflerfish.framework.PermissionOps.callFinalizeActivation(PermissionOps.java:265)
在org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:295)
在org.knopflerfish.bundle.frameworkcommands.FrameworkCommandGroup.cmdStart(FrameworkCommandGroup.java:1634)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:511)
在org.knopflerfish.service.console.CommandGroupAdapter.execute(CommandGroupAdapter.java:256)
在org.knopflerfish.bundle.console.Command $ 2.run(Command.java:239)
在java.security.AccessController.doPrivileged(AccessController.java:45)
在org.knopflerfish.bundle.console.Command.run(Command.java:226)
在java.lang.Thread.run(Thread.java:856)最后,当我尝试运行
PAX-Web的扩展,战争0.8.0.jar(OPS4J大同网站 - 扩展 - 战争)
此错误信息也将出现:[标准错误] ## DEBUG:错误 - FrameworkErrorEvent包#17
[标准错误] ## DEBUG:错误 - FrameworkErrorEvent抛出:
无法启动包:OPS4J大同网站 - 扩展 - WAR(#17)(由于:org.osgi.framework.BundleException:捆绑#17,无法解决:缺少包(S)或不能解决所有的人:
org.osgi.service.http;版本= [1.0.0,2.0.0) - 无法解析捆绑出口 - org.osgi.service.http;版本1.2.0 =捆绑[ID = 16,创= 0] 。
javax.servlet.http包,版本2.1.0 = - 无法解析捆绑出口 - javax.servlet.http包,版本2.5.0 =捆绑[ID = 16,创= 0。
的javax.servlet;版本2.1.0 = - 无法解析捆绑出口 - 的javax.servlet;版本2.5.0 =捆绑[ID = 16,创= 0])。
org.osgi.framework.BundleException:捆绑#17,无法解决:缺少包(S)或不能解决所有的人:
org.osgi.service.http;版本= [1.0.0,2.0.0) - 无法解析捆绑出口 - org.osgi.service.http;版本1.2.0 =捆绑[ID = 16,创= 0] 。
javax.servlet.http包,版本2.1.0 = - 无法解析捆绑出口 - javax.servlet.http包,版本2.5.0 =捆绑[ID = 16,创= 0。
的javax.servlet;版本2.1.0 = - 无法解析捆绑出口 - 的javax.servlet;版本2.5.0 =捆绑[ID = 16,创= 0。
在org.knopflerfish.framework.BundleImpl.getUpdatedState(BundleImpl.java:1259)
在org.knopflerfish.framework.BundleImpl.finalizeActivation(BundleImpl.java:312)
在org.knopflerfish.framework.PermissionOps.callFinalizeActivation(PermissionOps.java:265)
在org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:295)
在org.knopflerfish.bundle.frameworkcommands.FrameworkCommandGroup.cmdStart(FrameworkCommandGroup.java:1634)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:511)
在org.knopflerfish.service.console.CommandGroupAdapter.execute(CommandGroupAdapter.java:256)
在org.knopflerfish.bundle.console.Command $ 2.run(Command.java:239)
在java.security.AccessController.doPrivileged(AccessController.java:45)
在org.knopflerfish.bundle.console.Command.run(Command.java:226)
在java.lang.Thread.run(Thread.java:856)我也试图启动
PAX-Web的JSP-1.0.2.jar(OPS4J大同网站 - 支持JSP)
已显示此错误消息:[标准错误] ## DEBUG:错误 - FrameworkErrorEvent包#15
[标准错误] ## DEBUG:错误 - FrameworkErrorEvent抛出:
无法启动包:OPS4J大同网站 - 支持JSP(#15)(由于:org.osgi.framework.BundleException:捆绑#15,无法解决:缺少包(S)或不能解决所有的人:
javax.tools - 没有找到供应商。
javax.servlet.resources;版本= [2.3.0,3.0.0) - 无法解析捆绑出口 - javax.servlet.resources;版本2.5.0 =捆绑[ID = 16,创= 0。
javax.servlet.http包,版本= [2.3.0,3.0.0) - 无法解析捆绑出口 - javax.servlet.http包,版本2.5.0 =捆绑[ID = 16,创= 0。
的javax.servlet;版本= [2.3.0,3.0.0) - 无法解析捆绑出口 - 的javax.servlet;版本2.5.0 =捆绑[ID = 16,创= 0。
javax.lang.model.util中 - 没有找到供应商。
javax.lang.model.type中 - 没有找到供应商。
javax.lang.model.element中 - 没有找到供应商。
javax.lang.model - 没有找到供应商。
javax.annotation.processing中 - 没有找到供应商)。
org.osgi.framework.BundleException:捆绑#15,无法解决:缺少包(S)或不能解决所有的人:
javax.tools - 没有找到供应商。
javax.servlet.resources;版本= [2.3.0,3.0.0) - 无法解析捆绑出口 - javax.servlet.resources;版本2.5.0 =捆绑[ID = 16,创= 0。
javax.servlet.http包,版本= [2.3.0,3.0.0) - 无法解析捆绑出口 - javax.servlet.http包,版本2.5.0 =捆绑[ID = 16,创= 0。
的javax.servlet;版本= [2.3.0,3.0.0) - 无法解析捆绑出口 - 的javax.servlet;版本2.5.0 =捆绑[ID = 16,创= 0。
javax.lang.model.util中 - 没有找到供应商。
javax.lang.model.type中 - 没有找到供应商。
javax.lang.model.element中 - 没有找到供应商。
javax.lang.model - 没有找到供应商。
javax.annotation.processing中 - 没有找到供应商。
在org.knopflerfish.framework.BundleImpl.getUpdatedState(BundleImpl.java:1259)
在org.knopflerfish.framework.BundleImpl.finalizeActivation(BundleImpl.java:312)
在org.knopflerfish.framework.PermissionOps.callFinalizeActivation(PermissionOps.java:265)
在org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:295)
在org.knopflerfish.bundle.frameworkcommands.FrameworkCommandGroup.cmdStart(FrameworkCommandGroup.java:1634)
在java.lang.reflect.Method.invokeNative(本机方法)
在java.lang.reflect.Method.invoke(Method.java:511)
在org.knopflerfish.service.console.CommandGroupAdapter.execute(CommandGroupAdapter.java:256)
在org.knopflerfish.bundle.console.Command $ 2.run(Command.java:239)
在java.security.AccessController.doPrivileged(AccessController.java:45)
在org.knopflerfish.bundle.console.Command.run(Command.java:226)
在java.lang.Thread.run(Thread.java:856)这是我从这些错误信息的理解,束在寻找这些软件包。有没有什么办法可以解决这个并能够成功运行Android上的Java Web应用程序与OSGi框架?
org.osgi.service.http;版本= [1.1.0,2.0.0) - 无法解析捆绑出口 - org.osgi.service.http;版本= 1.2 0.0捆绑[ID = 16,创= 0。
javax.servlet.http包,版本= [2.5.0,3.0.0) - 无法解析捆绑出口 - javax.servlet.http包,版本2.5.0 =捆绑[ID = 16,创= 0。
的javax.servlet;版本= [2.5.0,3.0.0) - 无法解析捆绑出口 - 的javax.servlet;版本2.5.0 =捆绑[ID = 16,创= 0。javax.security.sasl中 - 没有找到供应商。
javax.management.remote中 - 没有找到供应商。
javax.management.modelmbean中 - 没有找到供应商。
javax.management - 没有找到供应商。
解决方案所有我强烈建议使用同一版本PAX-网络的所有包,第二次你错过了一个servlet API捆绑包的第一位。此外,它看起来像你也不翼而飞其他几个大同的Web束。你最有可能需要以下软件包:
- PAX-Web的API
- PAX-Web的码头束
- PAX-Web的JSP
- PAX-网络运行
- PAX-Web的SPI
如果你想使用的战争,你需要在
- PAX-Web的扩展战
- PAX-URL战
- 和一对夫妇更多...
大同的Web的最新版本是3.0.2,所以你应该根据你想要做什么护理选择。你可能会发现,检查大同的Web(取决于你要使用的版本)的ITests上需要哪些包的灵感。
我建议先从一组最小。这样,您就开始与HTTP服务第一,它增强你的需求。看看在 PAX-Web项目在Github上,尤其是在样品和itests模块的更多细节。
I'm planning to start
OSGi
on Android with Web Services, wherein I will be able to run Java Server Pages (jsp) and Java Servlets on Android Browser.My initial step was installing
Knopflerfish
on Android. I have followed this tutorial from knopflerfish: http://www.knopflerfish.org/releases/5.0.0/docs/android_dalvik_tutorial.htmlKnopflerfish did well, I have seen the localhost:8080 on the Android phone's browser.
My second step was to install
Pax Web
on Knopflerfish that was also installed on Android. I have also followed their tutorial from here: http://www.knopflerfish.org/kf_pax_web_tutorial.htmlThe tutorial said that:
Uninstall the KF HTTP bundles
The first step is to stop the HTTP root bundle and uninstall the JSDK and HTTP-server bundles as PaxWeb will take over this function. Normally you will most likely also want to uninstall the HTTP-root-bundle, but for this tutorial we will leave it installed. Make sure to do a refresh packages before going to the next step.
Then:
Install PaxWeb
The second step is install and start the following bundles from PaxWeb.
- pax-web-jsp-1.0.2.jar (install)
- pax-web-jetty-bundle-1.0.2.jar (install & start)
- pax-web-extender-war-0.8.0.jar(install & start)
The
Pax Web
bundles were successfully installed.
Problem
The
Pax Web
bundles cannot be started.It gives me this error messages on the console when I try to start
HTTP-root-IMP
which is a Knopflerfish bundle.[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)
Another is when I will start the bundles from the
Pax Web
tutorial from Knopflerfish. Here I tried to startpax-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)
Lastly, when I try to run
pax-web-extender-war-0.8.0.jar (OPS4J Pax Web - Extender - War)
this error messages will also appear:[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)
I also tried to start
pax-web-jsp-1.0.2.jar (OPS4J Pax Web - Jsp Support)
this error message was displayed:[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)
From what I have understood from the error messages, the bundles were looking for these packages. Is there any way I can resolve this and be able to successfully run a Java Web Application on Android with OSGi framework?
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.
解决方案First of all I strongly suggest to use the same version for all bundles of Pax-Web, second you're missing a servlet API bundle. Also it looks like you're also missing a couple of other Pax-Web bundles. You'll most likely need the following bundles:
- pax-web-api
- pax-web-jetty-bundle
- pax-web-jsp
- pax-web-runtime
- pax-web-spi
and if you want to use wars you'll need the
- pax-web-extender-war
- pax-url-war
- and a couple more ...
Latest version of Pax-Web is 3.0.2 so you should choose with care depending on what you're trying to do. You might find it helpful to check the ITests of Pax-Web (depending on the version you're going to use) for inspiration on which bundles are needed. I'd suggest to start with a minimum set. This way you start with the http-service first and enhance it to the needs you have.
Take a look at the Pax-Web project at Github and especially at the samples and itests modules for more details.
这篇关于大同网络上Knopflerfish在Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!