Opened 4 years ago

Closed 3 years ago

#2237 closed enhancement (wontfix)

Petascope - cannot redeploy on tomcat with error gdal-java JNI

Reported by: Bang Pham Huu Owned by: Bang Pham Huu
Priority: major Milestone: 11.0
Component: petascope Version: 9.8
Keywords: Cc: Dimitar Misev
Complexity: Medium

Description

Tomcat will need to restart when petascope is redeployed as it has this kind of error

Caused by: java.lang.UnsatisfiedLinkError: 'void org.gdal.gdal.gdalJNI.AllRegister()'

Some information may help:

https://stackoverflow.com/questions/53444627/java-lang-unsatisfiedlinkerror-native-library-already-loaded-in-another-classloa

https://cwiki.apache.org/confluence/display/tomcat/HowTo#HowTo-I'mencounteringclassloaderproblemswhenusingJNIunderTomcat (creating a dummy application to load GDAL JNI and it can be reused by petascope).

Change History (2)

comment:1 by Bang Pham Huu, 4 years ago

The only possible solution is: it needs a jar in tomcat's lib folder to load gdal-java JNI for any web application which uses it. Otherwise, when deploying a new petascope, tomcat must be restarted (reason: "Tomcat, uses separate class loaders for each of the web application, and it wont allow you load a same native library more than once to JVM via another class loader").

+ Source: https://cwiki.apache.org/confluence/display/tomcat/HowTo#HowTo-I'mencounteringclassloaderproblemswhenusingJNIunderTomcat
+ https://stackoverflow.com/a/40047031

comment:2 by Dimitar Misev, 3 years ago

Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.