Command line 使用命令行工具将OSGi项目部署为Webstart

Command line 使用命令行工具将OSGi项目部署为Webstart,command-line,ant,build-automation,osgi,java-web-start,Command Line,Ant,Build Automation,Osgi,Java Web Start,如何使用命令行工具创建一个模块化的OSGi项目,该项目可以与JavaWebStart一起分发 我找到了。但是在没有eclipse帮助的情况下,很难找到这样做的说明。我想使用ant构建脚本和/或其他命令行工具来实现这一点 这是我到目前为止得到的。使用ant,所有插件包都被复制到一个目录并签名。之后,我创建了一个名为wrapper.jnlp的jnlp文件 <?xml version="1.0" encoding="UTF-8"?> <jnlp codebase="http://lo

如何使用命令行工具创建一个模块化的OSGi项目,该项目可以与JavaWebStart一起分发

我找到了。但是在没有eclipse帮助的情况下,很难找到这样做的说明。我想使用ant构建脚本和/或其他命令行工具来实现这一点

这是我到目前为止得到的。使用ant,所有插件包都被复制到一个目录并签名。之后,我创建了一个名为wrapper.jnlp的jnlp文件

<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="http://localhost/webstart" href="wrapper.jnlp">
    <information>
        <title>My app</title>
        <vendor>Me</vendor>
        <offline-allowed/>
    </information>
    <resources>
        <j2se version="1.5+" java-vm-args="-Xmx512M"/>
        <jar href="org.eclipse.equinox.launcher.jar"/>
        <extension name="Wrapper feature" href="myprogram.jnlp"/>
    </resources>
    <application-desc main-class="org.eclipse.equinox.launcher.WebStartMain"/>
    <security>
         <all-permissions/>
    </security>
</jnlp>

知道我做错了什么吗?下一步我应该看哪里?

我相信你可能想切换设备,用你的代码和所有依赖项创建一个P2存储库,然后让一个简单的P2安装程序从那里提取依赖项(绕过WebStart)并启动你的应用程序。

看看这个“使用这个servlet将你的OSGi应用程序部署到web客户端”


尽管从文档中可以看出它是一个maven插件,但看起来您可以在没有maven项目的情况下运行它。

根据来源,您的问题是由于未能在类路径上找到
org.eclipse.osgi
包。确保捆绑包被正确引用,并且它有正确的清单。

我也有同样的问题。我通过在包装器jnlp中指定以下内容解决了此问题:

    <resources>
        <!-- Reference to the launcher jar. The version segment must be updated to the version being used-->
        <jar href="plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar" />
        <!-- Reference to the osgi jar. The version segment must be updated to the version being used-->
        <jar href="plugins/org.eclipse.osgi_3.7.0.v20110613.jar" />

        ...

    </resources>

...

或在ant构建上扩展,将Ivy与存储库一起用作OBR(例如OSGi捆绑存储库)。假设你已经看到过像earcam这样的帖子,你链接的博客与我的第一个链接内容相同。你好,amarillion,看起来你的问题可能已经在felix邮件列表上Richard S.Hall的帮助下得到了解决。希望现在/很快都能正常工作。我正在尝试jbundle,但在那里我遇到了完全不同的问题。由于某些原因,它无法解决在eclipse环境中正常工作的某些依赖项。例如,如果我从felix shell执行此操作:
repos addhttp://www.bigcat.unimaas.nl/~martina/repository/repository.xml部署“org.pathvisio.desktop”
,我得到了一长串依赖性问题。
!SESSION Wed Jun 29 13:43:52 CEST 2011 -----------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2011-06-29 13:43:52.448
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:411)
    at org.eclipse.equinox.launcher.WebStartMain.basicRun(WebStartMain.java:78)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
    at org.eclipse.equinox.launcher.WebStartMain.main(WebStartMain.java:57)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:590)
    at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:887)
    <resources>
        <!-- Reference to the launcher jar. The version segment must be updated to the version being used-->
        <jar href="plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar" />
        <!-- Reference to the osgi jar. The version segment must be updated to the version being used-->
        <jar href="plugins/org.eclipse.osgi_3.7.0.v20110613.jar" />

        ...

    </resources>