TongWeb部署报错:java.lang.UnsatisfiedLinkError:Native Library XXX.so already loaded in another classload

Symptom: TongWeb deploys the application successfully, but the application function is abnormal. The error message reported in the console log is:

due to exception [Native Library  /opt/XXX/lib/XXX.so  already loaded inanother classloader]

java.lang.UnsatisfiedLinkError:Native Library /opt/XXX/lib/XXX.so already loaded in another classloader]

After confirming with Dongfangtong Technology: this jni so library can only be loaded once during redeployment. The new version solved this problem by removing the reference to this so library when de-deploying the previous application, and then loading it again during deployment. . The old version also finalizes class loading and jni loading during de-deployment. The jni call of so is quite special, and the finalize of class loading is not recycled. The new version has strengthened it on the basis of this finalize; this problem should be solved It is solved after version 7048M1.

Solution: Upgrade the TongWeb version, or try: After undeploying the application, stop tongweb, start tongweb again, and then deploy the application. It is recommended to upgrade TongWeb.

Of course, there is another possibility: there is a problem with the so library itself. If this is the case, the application itself needs to make changes, change it to a pure Java non-so library calling method, or repair the so library itself.

Guess you like

Origin blog.csdn.net/yeyuningzi/article/details/132858008