一尘不染

如何在Tomcat中添加本机库?

tomcat

我想在Tomcat中添加gdal库。我读了Tomcat中找不到的本机库,但不知道startup.bat应该在哪里添加-Djava.library.path

错误:

exception

javax.servlet.ServletException: Servlet execution threw an exception
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:70)

root cause

java.lang.UnsatisfiedLinkError: org.gdal.ogr.ogrJNI.GetDriverCount()I
org.gdal.ogr.ogrJNI.GetDriverCount(Native Method)
org.gdal.ogr.ogr.GetDriverCount(ogr.java:98)
org.geotools.data.ogr.OGRDataStore.<clinit>(OGRDataStore.java:169)
test.Read.getKadnum(Read.java:56)
test.Zipper.mifUnzip(Zipper.java:139)
test.Zipper.Unzip(Zipper.java:60)
test.uploadfile.doPost(uploadfile.java:105)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:72)
com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:70)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.23 logs.

我从以下网址下载了gdal
64位:http
://vbkto.dyndns.org:1280/sdk/PackageList.aspx?file=
release-1600-x64-gdal-1-9-mapserver-6-2.zip


阅读 464

收藏
2020-06-16

共1个答案

一尘不染

必须在catalina.bat而不是startup.bat中进行设置。

set JAVA_OPTS="-Djava.library.path=/usr/tomcat/shared/lib"

可以放在之后

:noJuliManager
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%
2020-06-16