ESGF / esgf-installer

ESGF P2P Node Installer
https://esgf.llnl.gov/
Other
21 stars 21 forks source link

Java cannot load netcdf library #210

Open alaniwi opened 6 years ago

alaniwi commented 6 years ago

I am getting the following error in /esg/content/thredds/logs/serverStartup.log

2017-08-05T10:20:41.961+0100 [     47909][        ] WARN  serverStartup: Nc4Iosp: NetCDF-4 C library not present (jna_path='null', libname='netcdf').
java.lang.UnsatisfiedLinkError: Unable to load library 'netcdf': Native library (linux-x86-64/libnetcdf.so) not found in resource path ([file:/usr/local/apache-tomcat-8.5.9/webapps/thredds/WEB-INF/classes/, file:/usr/local/apache-tomcat-8.5.9/webapps/thredds/WEB-INF/lib/xml-apis-1.4.01.jar, ...

followed by a long list of jar files (snipped).

and the traceback

        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:277) ~[jna-4.2.2.jar:4.2.2 (b0)]
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:403) ~[jna-4.2.2.jar:4.2.2 (b0)]
        at com.sun.jna.Library$Handler.<init>(Library.java:147) ~[jna-4.2.2.jar:4.2.2 (b0)]
        at com.sun.jna.Native.loadLibrary(Native.java:502) ~[jna-4.2.2.jar:4.2.2 (b0)]
        at com.sun.jna.Native.loadLibrary(Native.java:481) ~[jna-4.2.2.jar:4.2.2 (b0)]
        at ucar.nc2.jni.netcdf.Nc4Iosp.load(Nc4Iosp.java:148) [netcdf4-5.0.0-SNAPSHOT.jar:5.0.0-SNAPSHOT]
        at ucar.nc2.jni.netcdf.Nc4Iosp.isClibraryPresent(Nc4Iosp.java:174) [netcdf4-5.0.0-SNAPSHOT.jar:5.0.0-SNAPSHOT]
        at thredds.server.config.TdsInit.readThreddsConfig(TdsInit.java:297) [classes/:5.0.0-SNAPSHOT]
        at thredds.server.config.TdsInit.onApplicationEvent(TdsInit.java:149) [classes/:5.0.0-SNAPSHOT]
        at thredds.server.config.TdsInit.onApplicationEvent(TdsInit.java:89) [classes/:5.0.0-SNAPSHOT]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) [spring-context-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443) [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325) [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727) [catalina.jar:8.5.9]
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189) [catalina.jar:8.5.9]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:8.5.9]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752) [catalina.jar:8.5.9]
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728) [catalina.jar:8.5.9]
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:8.5.9]
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1107) [catalina.jar:8.5.9]
        at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1841) [catalina.jar:8.5.9]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_131]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
alaniwi commented 6 years ago

This is on a recently installed v2.5.12-devel-release

alaniwi commented 6 years ago

If I install netcdf from an RPM, which provides /usr/lib64/libnetcdf.so, this error goes away. (Due to the yum setup on our machines, this finds an RPM that I built for netcdf 4.4.0, but presumably it would be the same if the RPM for 4.1.1 from EPEL was used.)

So it seems that netcdf needs to be included in the RPM dependencies.

William-Hill commented 6 years ago

@alaniwi, What install type did you use? Going to try to reproduce the problem.

William-Hill commented 6 years ago

cc @alaniwi Update on issue from Sean Arms:

"That is just a warning that the TDS could not find the netCDF-C library and should not prevent the TDS from starting up or running properly. If one wishes to have the netCDFSubsetService return netCDF-4 files, you need to link against the netCDF-C library (currently the only way to write netCDF-4 files). If you would like to specify where the C library lives, you can do so in threddsConfig.xml:

http://www.unidata.ucar.edu/software/thredds/current/tds/reference/ThreddsConfigXMLFile.html#netcdfCLibrary

If you do not want netCDF-4 files returned from the NetcdfSubsetService, then it is safe to ignore the message.

That said, I'm not sure why the stack trace is dumping to the log file. Is the TDS failing to start all together?

Cheers,

Sean"

pchengi commented 6 years ago

@William-Hill , how was this resolved? Was something changed in the xml config file?

William-Hill commented 6 years ago

@pchengi I didn't make any changes. The issue is still marked as open. Has the problem been reproduced in test installs?

pchengi commented 6 years ago

@alaniwi , can you please let me know what I need to do to reproduce this issue? If this is not an issue now, I'd like to close this issue.