线程“UI线程”中的异常java.lang.UnsatisfiedLinkError:

时间:2013-12-11 13:34:54

标签: java maven

堆栈跟踪是:

Exception in thread "UI Thread" java.lang.UnsatisfiedLinkError: no swt-win32-3232 in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
        at java.lang.Runtime.loadLibrary0(Runtime.java:845)
        at java.lang.System.loadLibrary(System.java:1084)
        at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
        at org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:18)
        at org.eclipse.swt.widgets.Display.<clinit>(Display.java:125)
        at com.sdm.hw.client.resource.RegistryBase.<init>(RegistryBase.java:16)
        at com.sdm.hw.client.resource.ImageRegistry.<init>(ImageRegistry.java:12)
        at com.sdm.hw.client.resource.StaticImageRegistry.<init>(StaticImageRegistry.java:12)
        at com.sdm.hw.client.resource.ResourceRegistry.getStaticImageRegistry(ResourceRegistry.java:89)
        at com.sdm.hw.client.resource.ResourceRegistry.getImage(ResourceRegistry.java:41)
        at com.sdm.hw.client.resource.ResourceRegistry.getImage(ResourceRegistry.java:33)
        at com.sdm.hw.client.action.HwAction.newImage(HwAction.java:190)
        at com.sdm.hw.client.action.HwAction.setImageName(HwAction.java:152)
        at com.sdm.hw.client.action.HwAction.localizeImages(HwAction.java:144)
        at com.sdm.hw.client.action.HwAction.<init>(HwAction.java:94)
        at com.sdm.hw.client.action.CloseAction.<init>(CloseAction.java:18)
        at com.sdm.hw.client.core.Application.createApplicationLevelActions(Application.java:554)
        at com.sdm.hw.client.core.Application.init(Application.java:146)
        at com.sdm.hw.client.HwMain.main(HwMain.java:81)

pom.xml中的条目是:

<dependency>
            <groupId>com.sdm.hw</groupId>
            <artifactId>SecurityClient</artifactId>
            <version>0.0.1-SNAPSHOT</version>
            <exclusions>
                <exclusion>
                    <artifactId>x86</artifactId>
                    <groupId>org.eclipse.swt.win32.win32</groupId>
                </exclusion>


                <exclusion>
                    <artifactId>commons-codec</artifactId>
                    <groupId>commons-codec</groupId>
                </exclusion>
             </exclusions> 
        </dependency>

2 个答案:

答案 0 :(得分:2)

你的stacktrace说“java.library.path中没有swt-win32-3232”,而你的pom中明确排除了它。也许你应该尝试包括它?!

<强>更新

根据您的评论,尝试:

<dependency>
        <groupId>com.sdm.hw</groupId>
        <artifactId>SecurityClient</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <exclusions>
            <exclusion>
                <artifactId>commons-codec</artifactId>
                <groupId>commons-codec</groupId>
            </exclusion>
         </exclusions> 
    </dependency>

答案 1 :(得分:1)

我尝试了以下内容,现在正在运行:

<dependency>
<groupId>org.eclipse.swt.win32</groupId>
<artifactId>x86</artifactId>
<version>3.5.1</version>
</dependency>