Error loading hunspell library on windows

Post here questions and problems related to oXygen frameworks/document types.
sderrick
Posts: 217

Error loading hunspell library on windows

Sat Apr 09, 2016 12:44 am

I get this error when the sdk editor loads n Windows 10 & 7, linux is fine, haven't tried mac.

Code: Select all

JNLPClassLoader: Finding library C:\Users\Scott\Desktop\lib\hunspell\hunspell-win-x86-32.dll.dll
0 ERROR [ AWT-EventQueue-2 ] ro.sync.azcheck.ui.spellcontrol.hunspell.e - The hunspell library or dictionary could not be loaded, due to java.lang.Error: The system cannot find the path specified.

java.lang.Error: The system cannot find the path specified.

   at com.sun.jna.Native.open(Native Method)
   at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:171)
   at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
   at com.sun.jna.Library$Handler.<init>(Library.java:147)
   at com.sun.jna.Native.loadLibrary(Native.java:412)
   at com.sun.jna.Native.loadLibrary(Native.java:391)
   at ro.sync.azcheck.ui.spellcontrol.hunspell.d.<init>(Unknown Source)
   at ro.sync.azcheck.ui.spellcontrol.hunspell.d.e(Unknown Source)
   at ro.sync.azcheck.ui.spellcontrol.hunspell.e$_b.<init>(Unknown Source)
   at ro.sync.azcheck.ui.spellcontrol.hunspell.e.fb(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 ro.sync.azcheck.ui.h.<init>(Unknown Source)
   at ro.sync.contentcompletion.d.u.nrg(Unknown Source)
   at ro.sync.contentcompletion.d.u.zog(Unknown Source)
   at ro.sync.exml.editor.b.d.pgf(Unknown Source)
   at ro.sync.exml.editor.b.d.bid(Unknown Source)
   at ro.sync.exml.editor.xmleditor.e.f.bid(Unknown Source)
   at ro.sync.exml.editor.xmleditor.e.d.bid(Unknown Source)
   at ro.sync.exml.editor.hc.mcd(Unknown Source)
   at ro.sync.exml.editor.xmleditor.e.f.mcd(Unknown Source)
   at ro.sync.exml.editor.me.changePage(Unknown Source)
   at ro.sync.exml.editor.me.changePage(Unknown Source)
   at ro.sync.exml.editor.validate.p.changePage(Unknown Source)
   at ro.sync.exml.editor.me.initFrame(Unknown Source)
   at ro.sync.exml.editor.validate.p.initFrame(Unknown Source)
   at ro.sync.exml.editor.xmleditor.ob.initFrame(Unknown Source)
   at ro.sync.ecss.extensions.api.component.AuthorComponentProvider.<init>(Unknown Source)
   at ro.sync.ecss.extensions.api.component.AuthorComponentFactory.createEditorComponentProvider(Unknown Source)
   at myGroup.mbepEditor.<init>(mbepEditor.java:232)
   at myGroup.mbepTabbedView$2$1.run(mbepTabbedView.java:231)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$500(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
0 WARN [ AWT-EventQueue-2 ] ro.sync.azcheck.ui.n - ro.sync.azcheck.ui.spellcontrol.h: Could not load Hunspell.
Please change the in the options to use the Java Spell Checker instead.
The error message was: The system cannot find the path specified.

ro.sync.azcheck.ui.spellcontrol.h: Could not load Hunspell.
Please change the in the options to use the Java Spell Checker instead.
The error message was: The system cannot find the path specified.

Spell checking doesn't work ....
Radu
Posts: 5582

Re: Error loading hunspell library on windows

Mon Apr 11, 2016 1:28 pm

Hi,

Is this for a Java applet or for a standalone product built using the SDK?
What version of the SDK are you using? After building the SDK you should have a JAR library called something like native-hunspell*.jar or hunspell-win-*.jar which should be included in the application classpath.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Mon Apr 11, 2016 4:03 pm

This is a standalone application built form the SDK to be run via webstart.

There is a jar /jnlp/lib/native-hunspell-17.0.0.jar in the lib folder

Its version 17

Scott
Radu
Posts: 5582

Re: Error loading hunspell library on windows

Mon Apr 11, 2016 4:10 pm

Hi Scott,

And the JNLP has some references to the native JARs, something like:

Code: Select all

<nativelib href="lib/native-hunspell...jar"/>
<nativelib href="lib/native-jna...jar"/>


right?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Mon Apr 11, 2016 5:06 pm

Radu,

here is my jnlp for testing

Code: Select all

<?xml version="1.0" encoding="UTF-8"?><jnlp spec="1.0+" codebase="http://192.168.0.4/editor1/">
  <!-- The tokens marked with @@ and the DEPENDENCIES element are replaced by Ant/Maven with the correct values-->
  <information>
        <title>MBEP Editor Application</title>
        <vendor>Mary Baker Eddy Library</vendor>
        <homepage href="https://www.mbepapers.org/"/>
        <description>MBEP Editor Application</description>
        <description kind="short">Editor</description>
    </information>
    <security>
     <all-permissions/>
    </security>
    <update check="timeout" policy="always"/>
    <resources>
        <!-- Application Resources -->
        <j2se javaws-vm-args="-Xmx256m -XX:MaxPermSize=80m" version="1.6+"/>
       <jar href="lib/mbep-editor-1.0-SNAPSHOT.jar" main="true"/>
<jar href="lib/oxygen-saxon9he-17.0.0.jar"/>
<jar href="lib/icu4j-53.1.jar"/>
<nativelib href="lib/native-windows-helper-17.0.0.jar"/>
<jar href="lib/oxygen-17.0.0.jar"/>
<jar href="lib/jna-platform-4.1.0.jar"/>
<jar href="lib/commons-logging-1.0.4.jar"/>
<jar href="lib/java-cup-10k.jar"/>
<jar href="lib/log4j-1.2.14.jar"/>
<jar href="lib/xml-apis-1.4.01.jar"/>
<jar href="lib/jide-oss-3.6.2.jar"/>
<jar href="lib/fop-0.94.jar"/>
<jar href="lib/jnlp2-2.0.jar"/>
<jar href="lib/oxygen-saxon-17.0.0.jar"/>
<jar href="lib/batik-codec-1.7.jar"/>
<jar href="lib/bundle-frameworks-1.0-SNAPSHOT.jar"/>
<jar href="lib/oxygen-token-markers-obf-17.0.0.jar"/>
<jar href="lib/jna-4.1.0.jar"/>
<jar href="lib/rhino-1.7R5.jar"/>
<jar href="lib/bundle-options-1.0-SNAPSHOT.jar"/>
<nativelib href="lib/native-jna-17.0.0.jar"/>
<jar href="lib/batik-transcoder-1.7.jar"/>
<jar href="lib/xml-apis-ext-1.3.04.jar"/>
<nativelib href="lib/native-hunspell-17.0.0.jar"/>
<jar href="lib/dicts-hunspell-17.0.0.jar"/>
<jar href="lib/mbep-editor-1.0-SNAPSHOT.jar"/>
<jar href="lib/oxygen-psychopath-17.0.0.jar"/>
<jar href="lib/commons-io-1.1.jar"/>
<jar href="lib/oxygen-jing-17.0.0.jar"/>
<jar href="lib/oxygen-resolver-17.0.0.jar"/>
<jar href="lib/AbsoluteLayout-SNAPSHOT.jar"/>
<jar href="lib/oxygen-sdk-17.0.0.jar"/>
<jar href="lib/oxygen-xercesImpl-17.0.0.jar"/>
    </resources>   
    <application-desc name="MBEP Editor Application" main-class="myGroup.EditorFrame">
        <argument>userName</argument>
        <argument>license</argument>
        <argument>accession</argument>
     </application-desc>
     <update check="background"/>
</jnlp>

it is listed...
Radu
Posts: 5582

Re: Error loading hunspell library on windows

Tue Apr 12, 2016 3:49 pm

Hi Scott,

We tested creating a small JavaWebstart JNLP-based application from the Oxygen SDK.
It worked in our case, the hunspell spell checker native library was loaded and it was used to spell check.
We used the Maven-based SDK so the steps we took were something like:

1. Open the file src/main/jnlp/jnlpTemplate.xml
2. Remove the 'applet-desc' element.
3. Add

Code: Select all

  <application-desc
        name="Dynamic Tree Demo Application"
        main-class="com.oxygenxml.sdksamples.reviewer.Reviewer"
        width="900"
        height="700">
    </application-desc>
 

4. Run a 'maven deploy', to publish the application onto your web server.
5. Access directly the JNLP file from the browser. Before that make sure you activate the Java console.
6. Press the key '5' to activate logging. Look for "Looking up native library in:".

In the case of what we tested, at some point the Java console outputs a line like:

Code: Select all

cache: Looking up native library in: C:\Users\user_name\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\51\265c8833-1742781e-n\hunspell-win-x86-64.dll


so it manages to find the DLL in the Java Webstart cache folder.
If this still does not work for you, please try the following:

1) Remove the Java JavaWebstart deployment cache, meaning that you can manually delete:

C:\Users\user_name\AppData\LocalLow\Sun\Java\Deployment\cache

and then try to start the application again.

2) Run the Javawebstart application from a web server (HTML file which has link to the JNLP). Are you testing it now by running it locally?

3) Enable the Java console to full debug in the Java Control panel and possibly paste all that logging information in a reply on this thread (in a codeblock).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Thu Apr 21, 2016 8:06 pm

I looked in the cache and the hunspell dll is there.

I think the loader is trying to load the incorrect file. Here is a snippet from the console.

Code: Select all

JNLPClassLoader: Finding library C:\Users\Scott\AppData\Local\Temp\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-windows-helper-17.0.0.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\36\6c4654a4-348478bd.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@9fd807b5: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\36\6c4654a4-348478bd-n\C:\Users\Scott\AppData\Local\Temp\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-jna-17.0.0.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\61\57653a3d-10479755.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@c79d777e: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\61\57653a3d-10479755-n\C:\Users\Scott\AppData\Local\Temp\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-hunspell-17.0.0.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\28\f05959c-29244bd0.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@d540c486: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\28\f05959c-29244bd0-n\C:\Users\Scott\AppData\Local\Temp\lib\hunspell\hunspell-win-x86-32.dll.dll
network: JNLPClassLoader: Native library C:\Users\Scott\AppData\Local\Temp\lib\hunspell\hunspell-win-x86-32.dll not found
0 ERROR [ AWT-EventQueue-2 ] ro.sync.azcheck.ui.spellcontrol.hunspell.e - The hunspell library or dictionary could not be loaded, due to java.lang.Error: The system cannot find the path specified.


notice its trying to find hunspell-win-x86-32.dll.dll

that file does not exist, it should be trying to find hunspell-win-x86-32.dll

The manifest in the hunspell jar file lists the correct name. Why is the jnlp loader adding an extra .dll to the end of the file?

Scott
Radu
Posts: 5582

Re: Error loading hunspell library on windows

Fri Apr 22, 2016 11:06 am

Hi Scott,

The native library loader tries to load it from various locations, including that silly location with the ".dll" appended to the library name. But it should find it in one of those locations, as I said we tested this on our side and it worked.
Could you try to test with about the same steps that we had? Create a new maven-based project based on our SDK and modify the original JNLP the way I outlined...

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Wed Apr 27, 2016 7:38 pm

I built a new editor fom the latest version as you specified and it does find hunspell!

I'm using the 17.0 version of the SDK in my current build and would like to build with 17.1.04. I changed the <oxygen.sdk.version> in my pom but when I build it doesn't pull in the latest dependencies? Is there something else I have to do?

thanks,

Scott
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Wed Apr 27, 2016 8:09 pm

My bad had a typo in the pom, switched to latest version for dependencies.

Still doesn't find hunspell though. the file is there in both cases. but the lookup path is very strange in my app.

here is the sample app that finds it.

Code: Select all

JNLPClassLoader: Finding library hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@5641c7d6: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\53\7df91375-2369bb55-n\hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@7819dceb: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\41\a5012a9-7f0c7618-n\hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@ba1c5fe7: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\35\17620c23-6e3dcc00-n\hunspell-win-x86-32.dll


here is my app that doesnt

Code: Select all

cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\36\6c4654a4-5c392278-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@c79d777e: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\61\57653a3d-10b43319-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@d540c486: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\28\f05959c-2c57bca2-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll


see how the lookup that fails has two paths concatenated? One starting with C:/users... and one starting with C:/Program... The file is in C:/users..

Do you have any idea why the sample app doesn't have that path problem and why mine would?

thanks,

Scott
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Wed Apr 27, 2016 9:04 pm

A bit more info.

When the sample app loads up it also fails to find hunspell looking for C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
but then it trys to find hunspell-win-x86-32.dll and finds it

Code: Select all

JNLPClassLoader: Finding library C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@5641c7d6: 4
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\53\7df91375-40c623e1-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@7819dceb: 4
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\41\a5012a9-33685e30-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@ba1c5fe7: 4
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\35\17620c23-24d94474-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
network: JNLPClassLoader: Native library C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll not found
JNLPClassLoader: Finding library hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@5641c7d6: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\53\7df91375-40c623e1-n\hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@7819dceb: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\41\a5012a9-33685e30-n\hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@ba1c5fe7: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\35\17620c23-24d94474-n\hunspell-win-x86-32.dll


My app trys and fails to find C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll as the sample app does but instead of then trying to find hunspell-win-x86-32.dll, it displays an error and never trys to find hunspell-win-x86-32.dll???

Code: Select all

JNLPClassLoader: Finding library C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-windows-helper-17.1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\56be6fb0-62f87ecd.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@9b29277c: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\56be6fb0-62f87ecd-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-jna-17.1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-54ddaa9c.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@e751c905: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-54ddaa9c-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-hunspell-17.1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\49\442267b1-384bdd06.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@1955f40d: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\49\442267b1-384bdd06-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
network: JNLPClassLoader: Native library C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll not found
1 ERROR [ AWT-EventQueue-2 ] ro.sync.azcheck.ui.spellcontrol.hunspell.e - The hunspell library or dictionary could not be loaded, due to java.lang.Error: The system cannot find the path specified.

java.lang.Error: The system cannot find the path specified.

   at com.sun.jna.Native.open(Native Method)
   at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:171)
   at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
   at com.sun.jna.Library$Handler.<init>(Library.java:147)
   at com.sun.jna.Native.loadLibrary(Native.java:412)
   at com.sun.jna.Native.loadLibrary(Native.java:391)
   at ro.sync.azcheck.ui.spellcontrol.hunspell.d.<init>(Unknown Source)
   at ro.sync.azcheck.ui.spellcontrol.hunspell.d.e(Unknown Source)
   at ro.sync.azcheck.ui.spellcontrol.hunspell.e$_b.<init>(Unknown Source)
   at ro.sync.azcheck.ui.spellcontrol.hunspell.e.fb(Unknown Source)
   at ro.sync.azcheck.ui.spellcontrol.f.p(Unknown Source)
   at ro.sync.azcheck.ui.o.x(Unknown Source)
   at ro.sync.azcheck.ui.o.p(Unknown Source)
   at ro.sync.azcheck.ui.o.sb(Unknown Source)
   at ro.sync.azcheck.ui.o.kb(Unknown Source)
   at ro.sync.azcheck.ui.o.n(Unknown Source)
   at ro.sync.azcheck.ui.n.<init>(Unknown Source)
   at ro.sync.azcheck.ui.i.<init>(Unknown Source)
   at ro.sync.contentcompletion.d.u.uyg(Unknown Source)
   at ro.sync.contentcompletion.d.u.gwg(Unknown Source)
   at ro.sync.exml.editor.b.d.dnf(Unknown Source)
   at ro.sync.exml.editor.b.d.rnd(Unknown Source)
   at ro.sync.exml.editor.xmleditor.e.h.rnd(Unknown Source)
   at ro.sync.exml.editor.xmleditor.e.k.rnd(Unknown Source)
   at ro.sync.exml.editor.gc.eid(Unknown Source)
   at ro.sync.exml.editor.xmleditor.e.h.eid(Unknown Source)
   at ro.sync.exml.editor.le.changePage(Unknown Source)
   at ro.sync.exml.editor.le.changePage(Unknown Source)
   at ro.sync.exml.editor.validate.p.changePage(Unknown Source)
   at ro.sync.exml.editor.le.initFrame(Unknown Source)
   at ro.sync.exml.editor.validate.p.initFrame(Unknown Source)
   at ro.sync.exml.editor.xmleditor.pb.initFrame(Unknown Source)
   at ro.sync.ecss.extensions.api.component.AuthorComponentProvider.<init>(Unknown Source)
   at ro.sync.ecss.extensions.api.component.AuthorComponentFactory.createEditorComponentProvider(Unknown Source)
   at myGroup.mbepEditor.<init>(mbepEditor.java:232)
   at myGroup.mbepTabbedView$2$1.run(mbepTabbedView.java:234)
   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$500(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.awt.EventQueue$3.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.run(Unknown Source)
4 WARN [ AWT-EventQueue-2 ] ro.sync.azcheck.ui.o - ro.sync.azcheck.ui.spellcontrol.h: Could not load Hunspell.
Please change the in the options to use the Java Spell Checker instead.
The error message was: The system cannot find the path specified.


Is there an exception I need to catch??
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Wed Apr 27, 2016 9:14 pm

The error on my app is generated when I create the editor component. Since we don't use the author mode I changed it from this

Code: Select all

editorComponent = factory.createEditorComponentProvider(
         new String[]{EditorPageConstants.PAGE_AUTHOR, EditorPageConstants.PAGE_TEXT},
         // The initial page
         EditorPageConstants.PAGE_TEXT);

         if (EditorPageConstants.PAGE_AUTHOR.equals(editorComponent
         .getWSEditorAccess().getCurrentPageID())) {
         // Show/Hide Bread Crumb
         ((WSAuthorComponentEditorPage) editorComponent.getWSEditorAccess()
         .getCurrentPage()).showBreadCrumb(showBreadCrumb);
         }


to this

Code: Select all

editorComponent = factory.createEditorComponentProvider(
                new String[]{EditorPageConstants.PAGE_TEXT},
                // The initial page
                EditorPageConstants.PAGE_TEXT);


Could this be the cause of hunspell not loading on windoze, though it loads fine on linux and Mac?

Scott
Dan
Posts: 273

Re: Error loading hunspell library on windows

Thu Apr 28, 2016 2:14 pm

In a previous message you said that our sample reviewer worked for you when using the SDK version 17.1. Just changing the version in the POM file to 17.0 makes Hunspell fail for that specific sample?

By the way, I tested with a sample containing just the Text page, and it works ok.
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Thu Apr 28, 2016 4:21 pm

your feedback is appreciated but not very helpful.

I'm certain hunspell is not loading under windoze,though it loads fine under linux and osx, because of something I've done. My goal is to find out what that is.

What I know.
1.) In my app hunspell fails to load under windoze, it fails on the first try and does not attempt a second.
2.) The sample app,also fails on the first try, but then retrys with a different file name and succeeds.
3.) hunspell loads fine under linux and OSX
4.) I have verified the library is installed on windows with both my app and the sample app.

So the question is, why does the sample app try to load the hunspell library twice and my app does not. The library is loaded in your code not mine.

thanks, Scott
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Fri Apr 29, 2016 8:07 pm

I decided to see if the sample app would fail to load hunspell if I removed authormode so I changed in AuthorComponentSample.java the constructor from

this

Code: Select all

editorComponent = factory.createEditorComponentProvider(
                new String[]{
                    // Comment this if you do not want a text page in the
                    // component.
                    EditorPageConstants.PAGE_TEXT,
                    EditorPageConstants.PAGE_AUTHOR},
                // The initial page
                EditorPageConstants.PAGE_AUTHOR);

        if (EditorPageConstants.PAGE_AUTHOR.equals(editorComponent
                .getWSEditorAccess().getCurrentPageID())) {
            // Show/Hide Bread Crumb
            ((WSAuthorComponentEditorPage) editorComponent.getWSEditorAccess()
                    .getCurrentPage()).showBreadCrumb(showBreadCrumb);
        }

to this

Code: Select all

editorComponent = factory.createEditorComponentProvider(
                new String[]{
                    // Comment this if you do not want a text page in the
                    // component.
                    EditorPageConstants.PAGE_TEXT},
                // The initial page
                EditorPageConstants.PAGE_TEXT);


But when I run the app is still shows the author mode in the editor, not the text mode??

Image

instead of this(my app with only text mode)
Image

It seems that the author mode is still loading up? Is this another bug or has the code changed that controls which editor modes are selected?

I want to test apples to apples to find out why hunspell is not loading in a customized SDK, and it doesn't look like I can?

Scott
Dan
Posts: 273

Re: Error loading hunspell library on windows

Tue May 03, 2016 10:11 am

Hello Scott,

It works fine for us to switch to the text page. This is how it looks:

Image

Try this: create a "main" method in the class that is refered by the JNLP and run it directly, from your IDE. If it gives a different result, then your JNLP application loads the wrong set of resources.
In this case:
1. Check the JNLP file. It might have a different codebase than the one you would expect, and the jar files are getting loaded from other location.
2. Make sure you purge the Java cache, and the browser cache.
3. If you are using a proxy, try using a direct connection to your server.

In any case, make sure you are using the latest oXygen SDK: http://oxygenxml.com/oxygen_sdk_maven.html
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Tue May 03, 2016 5:27 pm

My bad on the previous post about the text mode not showing up. I was editing AuthorComponentSample.java but the samples jnlp loads reviewer/AuthorComponentReviewerSample I changed it to AuthtorComponentSample and now the sample editor loads up in text mode.

1. Check the JNLP file. It might have a different codebase than the one you would expect, and the jar files are getting loaded from other location.

Yes it is using the correct codebase

2. Make sure you purge the Java cache, and the browser cache.


did that more than once

3. If you are using a proxy, try using a direct connection to your server.


no proxy.

The issue is the sample app trys to load Hunspell twice. First with a bogus path and extension and fails because its not there, it then trys again with out any path or bogus extension and succeeds. Here is the output

JNLPClassLoader: Finding library C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@5641c7d6: 4
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\53\7df91375-22686394-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@7819dceb: 4
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\41\a5012a9-301ec661-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@ba1c5fe7: 4
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\35\17620c23-39f6048c-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
network: JNLPClassLoader: Native library C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll not found
JNLPClassLoader: Finding library hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@5641c7d6: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\53\7df91375-22686394-n\hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@7819dceb: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\41\a5012a9-301ec661-n\hunspell-win-x86-32.dll
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@ba1c5fe7: 5
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\35\17620c23-39f6048c-n\hunspell-win-x86-32.dll


My custom app, trys to load Hunspell with the same bogus path and extension and fails, but instead of trying to load it again it throws an exception and never trys again like the sample app.

here is the output.
JNLPClassLoader: Finding library C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-w ... .1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\56be6fb0-64c8976e.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@9b29277c: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\56be6fb0-64c8976e-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-jna-17.1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-397a8dc0.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@e751c905: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-397a8dc0-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-h ... .1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\49\442267b1-7f4c273d.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@1955f40d: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\49\442267b1-7f4c273d-n\C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll.dll
network: JNLPClassLoader: Native library C:\Program Files (x86)\Java\jre1.8.0_91\lib\hunspell\hunspell-win-x86-32.dll not found
1 ERROR [ AWT-EventQueue-2 ] ro.sync.azcheck.ui.spellcontrol.hunspell.e - The hunspell library or dictionary could not be loaded, due to java.lang.Error: The system cannot find the path specified.



at com.sun.jna.Native.open(Native Method)
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:171)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
at com.sun.jna.Library$Handler.<init>(Library.java:147)
at com.sun.jna.Native.loadLibrary(Native.java:412)
at com.sun.jna.Native.loadLibrary(Native.java:391)
at ro.sync.azcheck.ui.spellcontrol.hunspell.d.<init>(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.hunspell.d.e(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.hunspell.e$_b.<init>(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.hunspell.e.fb(Unknown Source)
at ro.sync.azcheck.ui.spellcontrol.f.p(Unknown Source)
at ro.sync.azcheck.ui.o.x(Unknown Source)
at ro.sync.azcheck.ui.o.p(Unknown Source)
at ro.sync.azcheck.ui.o.sb(Unknown Source)
at ro.sync.azcheck.ui.o.kb(Unknown Source)
at ro.sync.azcheck.ui.o.n(Unknown Source)
at ro.sync.azcheck.ui.n.<init>(Unknown Source)
at ro.sync.azcheck.ui.i.<init>(Unknown Source)
at ro.sync.contentcompletion.d.u.uyg(Unknown Source)
at ro.sync.contentcompletion.d.u.gwg(Unknown Source)
at ro.sync.exml.editor.b.d.dnf(Unknown Source)
at ro.sync.exml.editor.b.d.rnd(Unknown Source)
at ro.sync.exml.editor.xmleditor.e.h.rnd(Unknown Source)
at ro.sync.exml.editor.xmleditor.e.k.rnd(Unknown Source)
at ro.sync.exml.editor.gc.eid(Unknown Source)
at ro.sync.exml.editor.xmleditor.e.h.eid(Unknown Source)
at ro.sync.exml.editor.le.changePage(Unknown Source)
at ro.sync.exml.editor.le.changePage(Unknown Source)
at ro.sync.exml.editor.validate.p.changePage(Unknown Source)
at ro.sync.exml.editor.le.initFrame(Unknown Source)
at ro.sync.exml.editor.validate.p.initFrame(Unknown Source)
at ro.sync.exml.editor.xmleditor.pb.initFrame(Unknown Source)
at ro.sync.ecss.extensions.api.component.AuthorComponentProvider.<init>(Unknown Source)
at ro.sync.ecss.extensions.api.component.AuthorComponentFactory.createEditorComponentProvider(Unknown Source)
at myGroup.mbepEditor.<init>(mbepEditor.java:233)
at myGroup.mbepTabbedView$2$1.run(mbepTabbedView.java:234)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
4 WARN [ AWT-EventQueue-2 ] ro.sync.azcheck.ui.o - ro.sync.azcheck.ui.spellcontrol.h: Could not load Hunspell.
Please change the in the options to use the Java Spell Checker instead.
The error message was: The system cannot find the path specified.


It starts to do the same thing as the sample app but throws and exception instead of trying to load it again with the correct file name. Do you get that? Do you understand? It seems like you don't get that?

The library(dll) is installed, I've verified that. its installed at C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-397a8dc0-n\ which is where its looking with the bogus path and extension.

It finds it fine on linux, it finds it fine on OSX, just running windoze is there a problem. Same application in all cases. Same jnlp file. Same librarys.

The failure happens when I create an editor component with the factory

Code: Select all

        editorComponent = factory.createEditorComponentProvider(
                new String[]{EditorPageConstants.PAGE_TEXT},
                // The initial page
                EditorPageConstants.PAGE_TEXT);


It is deep inside this function which I can't step into to see why it is failing?
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Tue May 03, 2016 9:56 pm

I decided to load Hunspell myself and see if I could figure out why it was failing.

So I added the following code to just before the call to create an editor, which was where the load was failing in your code.

Code: Select all

   String os = System.getProperty("os.name");
        String arch = System.getProperty("os.arch");
        System.out.println("Loading Hunspell for OS:" + os + " on arch:" + arch);
        String libName = "";
        if (os.contains("win") || os.contains("Win")) {
            if("amd64".equals(arch))
                libName = "hunspell-win-x86-64";
            else
                libName = "hunspell-win-x86-32";
        }
        if (os.contains("mac")) {
            if("amd64".equals(arch))
                libName = "hunspell-darwin-x86-64";
            else
                libName = "hunspell-darwin-x86-32";
        }
        if (os.contains("nix") || os.contains("nux") || os.contains("aix")) {
            if("amd64".equals(arch))
                libName = "hunspell-linux-x86-64";
            else
                libName = "hunspell-linux-x86-32";
        }
        String sysLibName = System.mapLibraryName(libName);
        System.loadLibrary(libName);
        System.out.println("Done loading Loading Hunspell basename:" + libName + " system name:"+sysLibName);


The surprise was not only did my call to System.loadLibrary() succeed, but now the call in your code succeeded.

here is the output on linx

Loading Hunspell for OS:Linux on arch:amd64
JNLPClassLoader: Finding library libhunspell-linux-x86-64.so
Done loading Loading Hunspell basename:hunspell-linux-x86-64 system name:libhunspell-linux-x86-64.so


here on Windows 7


Loading Hunspell for OS:Windows 7 on arch:x86
JNLPClassLoader: Finding library hunspell-win-x86-32.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-w ... .1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\56be6fb0-6460003d.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@9b29277c: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\56be6fb0-6460003d-n\hunspell-win-x86-32.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-jna-17.1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-42c6dfc4.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@e751c905: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-42c6dfc4-n\hunspell-win-x86-32.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-h ... .1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\49\442267b1-72244a74.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@1955f40d: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\49\442267b1-72244a74-n\hunspell-win-x86-32.dll
Done loading Loading Hunspell basename:hunspell-win-x86-32 system name:hunspell-win-x86-32.dll



here on windows 10

Loading Hunspell for OS:Windows 10 on arch:x86
JNLPClassLoader: Finding library hunspell-win-x86-32.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-w ... .1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\56be6fb0-5b53ec33.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@9b29277c: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\48\56be6fb0-5b53ec33-n\hunspell-win-x86-32.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-jna-17.1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-49f96cbd.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@e751c905: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\46\7fb63bee-49f96cbd-n\hunspell-win-x86-32.dll
cache: Cancel delay cleanup: URL: http://192.168.0.4/editor1/lib/native-h ... .1.0.4.jar | C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\49\442267b1-5a804874.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@1955f40d: 2
cache: Looking up native library in: C:\Users\Scott\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\49\442267b1-5a804874-n\hunspell-win-x86-32.dll
Done loading Loading Hunspell basename:hunspell-win-x86-32 system name:hunspell-win-x86-32.dll


I am waiting for conformation on OSx.

Its a hack for sure and indicates you have a problem in your code loading the library, but if I can hack around your problem, and there are no issues on OSx I'm good to go.

Scott
Dan
Posts: 273

Re: Error loading hunspell library on windows

Wed May 04, 2016 4:40 pm

Hello Scott,

We reproduced the problem on our side, with the latest JRE, and I can confirm that the code you posted loads hunspell DLL correctly on Windows. On Mac it fails.
We will take a closer look and keep you updated.

Regards,
Dan
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Wed May 04, 2016 4:47 pm

Dan, thanks for the update and thanks for hanging in there with me on this.

I was feeling like a lone voice in the wilderness.

too bad about it failing on the mac. I don't have one to test so must use a users feedback which can be problematic.

Scott
Dan
Posts: 273

Re: Error loading hunspell library on windows

Thu May 05, 2016 12:15 pm

Until we release a new SDK with the fix, please use this code in your app (it works also on the Mac ):

Code: Select all


    String os = System.getProperty("os.name").toLowerCase();
    String arch = System.getProperty("os.arch").toLowerCase();
    System.out.println("Loading Hunspell for OS:" + os + " on arch:" + arch);
    String libName = "";
    if (os.contains("win") || os.contains("Win")) {
      if (arch.equals("x86_64") || arch.equals("amd64"))
        libName = "hunspell-win-x86-64";
      else
        libName = "hunspell-win-x86-32";
    }
    if (os.contains("mac")) {
      if (arch.equals("x86_64") || arch.equals("amd64"))
        libName = "hunspell-darwin-x86-64";
      else
        libName = "hunspell-darwin-x86-32";
    }
    if (os.contains("nix") || os.contains("nux") || os.contains("aix")) {
      if (arch.equals("x86_64") || arch.equals("amd64"))
        libName = "hunspell-linux-x86-64";
      else
        libName = "hunspell-linux-x86-32";
    }


    if (libName.endsWith(".dylib")) {
      // In order to be able to load libraries that are on the system,
      // the lib name must end in .dylib.
      libName = libName.substring(0, libName.lastIndexOf(".dylib")) + ".jnilib";
    }

    String sysLibName = System.mapLibraryName(libName);
    System.out.println("After mapping " + sysLibName);

    System.loadLibrary(libName);
    System.out.println("Done loading Loading Hunspell basename:" + libName
        + " system name:" + sysLibName);


sderrick
Posts: 217

Re: Error loading hunspell library on windows

Thu May 05, 2016 3:56 pm

Dan,

many thanks! I'm installing a copy of OSx on virtualbox so I can test against the mac as well as windoze and linux.

I will report back on implementing your code.

Scott
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Fri May 06, 2016 4:00 pm

this code will never get executed? not sure why it is there?

Code: Select all

if (libName.endsWith(".dylib")) {
      // In order to be able to load libraries that are on the system,
      // the lib name must end in .dylib.
      libName = libName.substring(0, libName.lastIndexOf(".dylib")) + ".jnilib";
    }
Dan
Posts: 273

Re: Error loading hunspell library on windows

Mon May 09, 2016 9:59 am

It is executed on the Mac. If you remove it it will simply not find the library.
sderrick
Posts: 217

Re: Error loading hunspell library on windows

Mon May 09, 2016 4:14 pm

Sorry Dan, it will not ever be executed. have a programmer look at at it.

The variable libName will never end with .dylib

the variable sysLibName on the mac does end with dylib on the mac if you enable the java console.

The library is loaded successfully on the mac with the above code commented out or not.
Dan
Posts: 273

Re: Error loading hunspell library on windows

Tue May 10, 2016 10:48 am

Ok, no problem. I think this code was developed for Java 6 on Mac.
Dan
Posts: 273

Re: Error loading hunspell library on windows

Tue May 10, 2016 10:58 am

We migrated the fix into the SDK.
Make sure you use version 18.0.0.1 in your pom.xml file if you are using Maven, or download the entire set of libraries from: https://www.oxygenxml.com/maven/com/oxy ... .1-all.zip

Many regards,
Dan

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 0 guests