-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removing System.loadLibrary() calls #76
Open
pmauduit
wants to merge
91
commits into
geosolutions-it:master
Choose a base branch
from
pmauduit:no-loadlibrary-calls
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1260 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1261 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1264 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1270 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1271 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1272 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1275 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1280 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1284 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1285 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1286 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1289 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1290 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1293 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1294 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1295 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1296 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1299 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1303 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1304 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1312 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1314 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1319 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1323 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1325 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1327 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1336 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1338 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1349 866bbf7d-4862-ccf5-812a-c90ffd63a74d
git-svn-id: https://svn.java.net/svn/imageio-ext~svn/trunk@1354 866bbf7d-4862-ccf5-812a-c90ffd63a74d
netcdf merge into geotools
Test image reduction to 1x1 Minor fixes on the TIFFMetadataTest and TIFFReadTest
Fixed Issue geosolutions-it#54 and minor fixes on TIFFReadTest
Added png encoder and minor modifications on the ImageOutputStream
Fixing typo
This is not the role of this lib to load it, this has to be done by the gdal/ogr jar bindings. This presumably could cause issues in some specific classloading environments (tomcat with several webapps using the same jars) If you have a look at gdal sources (generated swig bindings): swig/java/org/src/gdal/gdal/gdalJNI.java:18: System.loadLibrary("gdaljni"); The lib should already be loaded there ; this might cause these kind of messages into Tomcat logs (tested with 2 webapps making use of imageio-ext): Native library load failed. java.lang.UnsatisfiedLinkError: Native Library [...]libgdaljni[...] already loaded in another classloader
Ensures that the underlying class (org.gdal.gdal which would load the native lib actually) can be resolved by the VM.
Class name is org.gdal.gdal.gdal, adding a catch block, to be able to debug at runtime more efficiently.
See pmauduit/geotools@311e84f for explanations about the motivations. TL;DR: This is not the role of imageio-Ext to call System.loadLibrary, this has to be done by the GDAL/OGR java bindings (which most of the time has to be provided by the distro). With some specific classloaders (e.g. tomcat), a second call to loadLibrary using the same lib as argument raises an exception (already loaded in another classloader), so even if we can make use of the native lib, it is reported as being unavailable.
No feedback on this PR since 9 months ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove calls to System.loadLibrary (GDAL only, I was not sure on how to rework other ones)
This PR follows the one made on GeoTools here:
planetfederal/geotools#15
Calls to System.loadLibrary() should be done by the GDAL/OGR java bindings (gdal.jar, which most of the time is provided by the distro). With some specific classloaders (e.g. tomcat), a second call to loadLibrary using the same lib as argument raises an exception (UnsatisfiedLinkError: "already loaded in another classloader"), so even if we can make use of the native GDAL lib, it is reported as being unavailable.
Of course, comments are welcome