https://issues.apache.org/bugzilla/show_bug.cgi?id=54700
Bug ID: 54700
Summary: Improvement: Add support for system property to
specify location of APR/native library
Product: Tomcat 8
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: Connectors
Assignee: [email protected]
Reporter: [email protected]
Classification: Unclassified
Created attachment 30053
--> https://issues.apache.org/bugzilla/attachment.cgi?id=30053&action=edit
Patch to implement improvement suggestion
Currently o.a.tomcat.jni.Library uses System#loadLibrary(String) to load the
APR/native library. This is hard-coded and unchangeable. Therefore, the only
ways to get the library loaded are:
1) Add the library file to the system library path.
2) Customize the system library path AT STARTUP (you can't change the system
library path at runtime without using reflection to clear the library path
cache).
However, it would be very nice if the native library could be loaded without 1
or 2. This would enable loading it from a location determined at runtime OR
loading it with a Java startup property without customizing the system library
path.
I propose a new system property org.apache.tomcat.jni.Library.LIBRARY_FILE that
enables specification of the APR/native library file, which would be loaded
with System#load(String). In the absence of this property,
o.a.tomcat.jni.Library would look for the library using the traditional logic.
This way you could specify the library location at startup from the command
line:
-Dorg.apache.tomcat.jni.Library.LIBRARY_FILE=/path/to/tcnative.lib.file
OR at runtime when, for example, using an Embedded Tomcat (before
Tomcat#start() is called, of course):
System.setProperty(Library.LIBRARY_FILE_PROPERTY,
"/path/to/tcnative.lib.file");
I have attached a patch that implements this proposal. I can successfully load
the library manually, load it with traditional logic, or not load it at all (if
no property and library not on the path).
It would be great if this could also be back-ported to Tomcat 7.0.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]