UnsatisfiedLinkError calling updateFields()

Hi,

I’m using Aspose.Words for java Version 18.8 in a webapp and get a UnsatisfiedLinkError (see stacktrace below) when calling updateFields.

System:

  • Windows 10
  • Tomcat 8.5.32
  • Java 1.8.0_171

Steps to reproduce:

  • Download the sample webapp project: testProject.zip (15.1 KB)
  • Build the maven project (or use testProject.war.zip (9.9 MB))
  • Copy war from target folder to Tomcat webapps folder
  • Start Tomcat
  • Open context in browser
  • Click “Generate” link (document is loaded, fields are updated, document is saved)
  • Open Tomcat manager and undeploy “testProject” (do not shut down the Tomcat server)
  • Add the same war to Tomcat webapps folder
  • Open context in browser
  • Click “Generate” link -> !!!UnsatisfiedLinkError!!!

The error cannot be reproduced with the version 18.7!

Regards
Ingo Gutzeit

 java.lang.UnsatisfiedLinkError: Native Library C:\Programme\apache-tomcat-8.5.32\temp\WindowsNativeCall\WindowsNativeCall_x64.dll already loaded in another classloader
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1907)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
        at java.lang.Runtime.load0(Runtime.java:809)
        at java.lang.System.load(System.java:1086)
        at asposewobfuscated.zz2Q.zzzR(Unknown Source)
        at com.aspose.words.WindowsNativeCall.<clinit>(Unknown Source)
        at asposewobfuscated.zzA1.<clinit>(Unknown Source)
        at asposewobfuscated.zzC1.zzU(Unknown Source)
        at asposewobfuscated.zzC2.zzQK(Unknown Source)
        at asposewobfuscated.zzRF.zzZ(Unknown Source)
        at asposewobfuscated.zzRZ.zzQN(Unknown Source)
        at asposewobfuscated.zzRZ.zzS(Unknown Source)
        at asposewobfuscated.zzRZ.zzT(Unknown Source)
        at com.aspose.words.FontSettings.zzT(Unknown Source)
        at com.aspose.words.zz97.zzR(Unknown Source)
        at com.aspose.words.zz97.zzQ(Unknown Source)
        at com.aspose.words.zz00.zzYJ(Unknown Source)
        at com.aspose.words.zz8Z$zzZ.zzZX(Unknown Source)
        at asposewobfuscated.zzCT.moveNext(Unknown Source)
        at com.aspose.words.zz8Z.zzZ(Unknown Source)
        at com.aspose.words.zzZ0G.zzZlX(Unknown Source)
        at com.aspose.words.zzZ0G.zzX(Unknown Source)
        at com.aspose.words.zz8Z.<init>(Unknown Source)
        at com.aspose.words.zzYXQ.zzZ(Unknown Source)
        at com.aspose.words.zz8Y.moveNext(Unknown Source)
        at com.aspose.words.zzZMT.zzZ(Unknown Source)
        at com.aspose.words.Document.updatePageLayout(Unknown Source)
        at com.aspose.words.zz4D.perform(Unknown Source)
        at com.aspose.words.zz4E.zzM6(Unknown Source)
        at com.aspose.words.zz1F.zzYZ(Unknown Source)
        at com.aspose.words.zz1F.zzZ(Unknown Source)
        at com.aspose.words.zz1F.zzZD(Unknown Source)
        at com.aspose.words.Range.updateFields(Unknown Source)
        at com.aspose.words.Document.updateFields(Unknown Source)
        at com.test.testproject.TestServlet.doPost(TestServlet.java:34)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)

@gutzeit

Thanks for your inquiry. We have tested the scenario using apache-tomcat-8.0.14 and have not found the shared issue. Could you please try latest version of Aspose.Words for Java 18.9 and let us know how it goes on your side? If you still face problem, please share the WAR file that contains the Aspose.Words for Java 18.9. We will investigate the issue on our side and provide you more information.

Hi,

thanks for the quick response.
I have tested the issue with the latest tomcat 8.5 and Aspose.Words version.

Please execute the following steps to reproduce the error:
Prepare Tomcat:

  • Download the Tomcat 8.5.33 as zip archive (https://tomcat.apache.org/download-80.cgi)
  • Unzip Tomcat
  • Set system variables
    – Add CATALINA_HOME variable = path to Tomcat folder
    – Add JAVA_HOME variable = path to jdk
    – Add CATALINA_HOME and JAVA_HOME to variable “Path” (%CATALINA_HOME%\bin; %JAVA_HOME%\bin)
  • Change conf/tomcat-users.xml
    – Add the following tags before the end of the file (before </tomcat-users>)
    <role rolename=“manager-gui”/>
    <user username=“admin” password=“admin” roles=“manager-gui”/>

Test with Aspose.Words 18.9

  • Download testProject - aspose.words_18.9.war.zip (9.9 MB)
  • Place war in Tomcat webapps folder
  • Start Tomcat with bin\startup.bat
  • war is unpacked by Tomcat
  • Open unpacked context in browser (http://localhost:8080/testProject%20-%20aspose.words_18.9)
  • Click link “Generate” (a document is loaded, fields are updates, document is saved)
  • Open Tomcat manager in browser (http://localhost:8080/manager)
    – user and password is “admin”
  • Undeploy application “testProject - aspose.words_18.9”
  • The war and unpacked folder in Tomcat wabapps folder was deleted
  • Copy the war from above to Tomcat webapps folder
  • Wait until war is unpacked (folder is created)
  • Open unpacked context in browser (http://localhost:8080/testProject%20-%20aspose.words_18.9)
  • Click link “Generate”
    Error

Test with Aspose.Words 18.7

  • Download testProject - aspose.words_18.7.war.zip (9.9 MB)
  • Place war in Tomcat webapps folder
  • Start Tomcat with bin\startup.bat
  • war is unpacked by Tomcat
  • Open unpacked context in browser (http://localhost:8080/testProject%20-%20aspose.words_18.7)
  • Click link “Generate” (a document is loaded, fields are updates, document is saved)
  • Open Tomcat manager in browser (http://localhost:8080/manager)
    – user and password is “admin”
  • Undeploy application “testProject - aspose.words_18.9”
  • The war and unpacked folder in Tomcat wabapps folder was deleted
  • Copy the war from above to Tomcat webapps folder
  • Wait until war is unpacked (folder is created)
  • Open unpacked context in browser (http://localhost:8080/testProject%20-%20aspose.words_18.7)
  • Click link “Generate”
    it works

With the same Tomcat Aspose 18.7 is working and 18.8/18.9 are not working. It must be a bug in Aspose.Words. If you have any questions feel free to ask.

Regards
Ingo Gutzeit

@gutzeit

Thanks for sharing the detail. We are setting up the environment as of yours and will test this scenario. We will get back to you soon.

@gutzeit

Thanks for your patience. We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSJAVA-1891. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@tahir.manzoor
Thanks for your help.

Hi @tahir.manzoor ,
the status of the issue WORDSJAVA-1891 is “Closed”. Has the bug been fixed?

Regards
Ingo Gutzeit

@gutzeit

Thanks for your inquiry. Yes, this issue has been resolved and its fix will be available in next version of Aspose.Words i.e. 18.10. Hopefully, it will be published by the end of this week.

The issues you have found earlier (filed as WORDSJAVA-1891) have been fixed in this Aspose.Words for .NET 18.10 update and this Aspose.Words for Java 18.10 update.