English 中文(简体)
使用 java 网络启动的发射日食应用程序生成 java. lang. Class nonFoundForpression: org. eclipse. swt. SWTError 。
原标题:Launching eclipse application with java web start generates java.lang.ClassNotFoundException: org.eclipse.swt.SWTError

I have an Eclipse application, for which I created the feature for generating the jnlp file. I built the application with maven tycho, for architectures x86 and x86_64.

当我尝试启动 jnlp 应用程序时, 我看到所有的资源都下载了, 但应用程序没有启动 。 如果我尝试在 Broswer 中打开它, 它就会启动 。 我检查了第一个案例的日志, 我得到了以下信息 :

eclipse.buildId=unknown
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -clientno=01 -StartupLogo=false -mode=3 -sessionid=7110AAD90803F34A9B01CD66A676E0ED.ASES01 -ServletDir=/SES/ -Port=8080 -host=172.20.224.138 -auth=tftttttttttt -Lang=de_DE -user=taris -Protocol=http
Command-line arguments:  -clientno=01 -StartupLogo=false -mode=3 -sessionid=7110AAD90803F34A9B01CD66A676E0ED.ASES01 -ServletDir=/SES/ -Port=8080 -host=172.20.224.138 -auth=tftttttttttt -Lang=de_DE -user=taris -Protocol=http

!ENTRY org.eclipse.osgi 4 0 2012-05-28 15:56:46.999
!MESSAGE An error occurred while automatically activating bundle org.eclipse.ui.workbench (20).
!STACK 0
org.osgi.framework.BundleException: The activator org.eclipse.ui.internal.WorkbenchPlugin for bundle org.eclipse.ui.workbench is invalid
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:463)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(Unknown Source)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass
[....]

Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:166)
    ... 78 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 84 more

以下是创造资源的部分:

<plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho-version}</version>
            <configuration>
                <resolver>p2</resolver>
                                    <ignoreTychoRepositories>true</ignoreTychoRepositories>
                <environments>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86</arch>
                    </environment>
                    <environment>
                        <os>win32</os>
                        <ws>win32</ws>
                        <arch>x86_64</arch>
                    </environment>
                </environments>
            </configuration>
        </plugin>

我查过资源在jnlp档案中被引用:

<resources os="Windows" arch="x86">
<jar href="plugins/org.eclipse.swt.win32.win32.x86_3.7.2.v3740f.jar"/>

我还检查了暗藏处 下载了资源

我只是找不到一个不从 Java 网络启动开始的应用程序的理由,

任何帮助都感激不尽!

问题回答

我的应用程序也有同样的错误。 这个项目是用 pominster 建造的, 但对于 x86 和 x86_ 64 也是这样 。

您的应用程序确实从浏览器中启动, 因为这是一个32位应用程序, 并且该应用程序将引用您的 Web start 作为32位应用程序 。

通过 Windows Explorer 启动您的应用程序, 启动一个 64 位应用程序, 遇到麻烦 。

Here is the solution that worked for me:
Edit your jnlp file containing the features:
Modify (the orginal jnlp file, which does not work)

...
</resources>
<resources os="Windows" arch="x86">
    <jar href="plugins/org.eclipse.swt.win32.win32.x86_3.7.0.v3735b.jar"/>
    <jar href="plugins/org.eclipse.core.filesystem.win32.x86_1.1.300.v20110423-0524.jar"/>
    <jar href="plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502.jar"/>
</resources>
<resources os="Windows" arch="x86_64">
    <jar href="plugins/org.eclipse.core.filesystem.win32.x86_64_1.1.300.v20110423-0524.jar"/>
    <jar href="plugins/org.eclipse.swt.win32.win32.x86_64_3.7.0.v3735b.jar"/>
    <jar href="plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502.jar"/>
</resources>

(新的jnlp 文件, 应该有效)

    ...
<resources os="Windows" arch="x86">
    <jar href="plugins/org.eclipse.swt.win32.win32.x86_3.7.0.v3735b.jar"/>
    <jar href="plugins/org.eclipse.core.filesystem.win32.x86_1.1.300.v20110423-0524.jar"/>
    <jar href="plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502.jar"/>
<resources os="Windows">
    <jar href="plugins/org.eclipse.core.filesystem.win32.x86_64_1.1.300.v20110423-0524.jar"/>
    <jar href="plugins/org.eclipse.swt.win32.win32.x86_64_3.7.0.v3735b.jar"/>
    <jar href="plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502.jar"/>
</resources>

换句话说,删除拱门=“x86_64”过滤器。

我想这是五分制发射器的错误 但真正的原因对我来说是个秘密

P.S: Removing the arch-filter only for the org.eclipse.swt.win32.win32.x86_64 bundle works too.
P.P.S: I found a similar question here: http://www.eclipse.org/forums/index.php/t/314656/





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签