Page 1 of 1

Hunspell UnsatisfiedLinkError

Posted: Tue Feb 24, 2015 6:20 pm
by Denis
Hi,

we are using Eclipse Oxygen Author in version 15.2.

If I want to use the hunspell spell checker I get the following error:

Code: Select all


6:02:06,374 0 ERROR [ main ] ro.sync.azcheck.ui.spellcontrol.hunspell.d - The hunspell library or dictionary could not be loaded, due to java.lang.UnsatisfiedLinkError: jnidispatch (/com/sun/jna/win32-x86/jnidispatch.dll) not found in resource path
java.lang.UnsatisfiedLinkError: jnidispatch (/com/sun/jna/win32-x86/jnidispatch.dll) not found in resource path
at com.sun.jna.Native.loadNativeLibraryFromJar(Unknown Source)
at com.sun.jna.Native.loadNativeLibrary(Unknown Source)
at com.sun.jna.Native.<clinit>(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.hunspell.c.<init>(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.hunspell.c.e(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.hunspell.d$_c.<init>(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.hunspell.d.eb(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.f.p(Unknown Source)
at ro.sync.azcheck.ui.n.w(Unknown Source)
at ro.sync.azcheck.ui.n.o(Unknown Source)
at ro.sync.azcheck.ui.n.qb(Unknown Source)
at ro.sync.azcheck.ui.n.ib(Unknown Source)
at ro.sync.azcheck.ui.n.m(Unknown Source)
at ro.sync.azcheck.ui.m.<init>(Unknown Source)
at com.oxygenxml.b.b.f.<init>(Unknown Source)
at com.oxygenxml.editor.editors.OxygenBaseEditor.createPartControl(Unknown Source)
at com.oxygenxml.editor.editors.e.e.createPartControl(Unknown Source)
I figured out that the jnidispatch.dll is not in the jna.jar file. I have tried to use another jna.jar, which contains the jnidispatch.dll the error do not occur and I can use the spell checker.

Best regards
Denis

Re: Hunspell UnsatisfiedLinkError

Posted: Tue Feb 24, 2015 7:08 pm
by Denis
Additional information:
I used the jna 3.4.1 from http://www.java2s.com/Code/Jar/j/Downloadjna341jar.htm

Is there another solution to fix the issue?

Re: Hunspell UnsatisfiedLinkError

Posted: Tue Feb 24, 2015 9:08 pm
by adrian
Hi,

We are not aware of such an issue with the Hunspell library in Eclipse.

What version, distribution (Classic, JavaEE, etc) and architecture (32/64) of Eclipse are you using?
Do you have other Eclipse plugins installed that use JNA?

Regards,
Adrian

Re: Hunspell UnsatisfiedLinkError

Posted: Wed Feb 25, 2015 12:06 pm
by Denis
Hi,

version: 3.6
JavaSE
architekture: 32

We do not use JNA in another plugin.
Is there a way to configure the classpath?

Re: Hunspell UnsatisfiedLinkError

Posted: Wed Feb 25, 2015 12:45 pm
by adrian
Hi,

Please look in Eclipse in menu > Help > About Eclipse and tell me the name (first row), version and build id of Eclipse that you are using.

Did you install Oxygen via the Eclipse update site, or did you use the .ZIP distribution?

Check if you have the .dll in question in the correct location from your Eclipse/Oxygen plugin installation:
- if installed from the update site:

Code: Select all

Eclipse\plugins\com.oxygenxml.author_15.2.0.v2014040317\lib\com\sun\jna\win32-x86\jnidispatch.dll
- if dropins/ZIP distribution is used:

Code: Select all

Eclipse\dropins\oxygenxml.author_15.2\plugins\com.oxygenxml.author_15.2.0.v2014040317\lib\com\sun\jna\win32-x86\jnidispatch.dll
Regards,
Adrian

Re: Hunspell UnsatisfiedLinkError

Posted: Wed Feb 25, 2015 3:10 pm
by Denis
Hi,

I have Oxygen added as dependency in a eclipse application.

I am develop on Luna Service Release 1 (4.4.1) Build id: 20140925-1800
a 3.6 eclipse application.
The file is in this location:

Code: Select all

Application\plugins\com.oxygenxml.author_15.2.0.v2014012017\lib\com\sun\jna\win32-x86\jnidispatch.dll
Regards
Denis

Re: Hunspell UnsatisfiedLinkError

Posted: Wed Feb 25, 2015 5:36 pm
by adrian
Hi,

By what means do you pick the dependency for your Eclipse application? Where in your Eclipse project are you configuring this?

I should also point out that v15.2 does not officially support Eclipse 4.4 (Luna), but that's another story.

Regards,
Adrian

Re: Hunspell UnsatisfiedLinkError

Posted: Thu Feb 26, 2015 11:12 am
by Denis
I saw you use the jna version 3.4.0. I have take a look at this jar here. There is the jnidispatch.dll in the jar included.
I assume that you extract the file from the jna.jar and put it into your lib folder.

Now I would to like know:
  • Why you extract these files from the jar?
  • Can I configure the classpath? In the manifest or somewhere else to get the hunspell functionality.
  • Can I include the extracted folders and files back to the jar to get the hunspell functionality?
Best regards,
Denis

Re: Hunspell UnsatisfiedLinkError

Posted: Mon Mar 02, 2015 11:12 am
by Radu
Just to update the post, in Denis' Oxygen plugin in the "Manifest.mf" the Bundle-ClassPath: key was missing a reference to the lib/ folder.

Regards,
Radu