Skip to content
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

Add dependency on jna to fix chatty Elasticseach log message #2342

Merged
merged 1 commit into from Jun 9, 2016

Conversation

@bernd
Copy link
Member

@bernd bernd commented Jun 8, 2016

Since Elasticsearch 2.3.3, Elasticsearch logs a warning with a huge backtrace if jna is not available.

2016-06-08 17:30:23,909 WARN : org.elasticsearch.bootstrap - JNA not found. native methods will be disabled.
java.lang.ClassNotFoundException: com.sun.jna.Native
  at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_91]
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_91]
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[?:1.8.0_91]
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_91]
  at java.lang.Class.forName0(Native Method) ~[?:1.8.0_91]
  at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_91]
  at org.elasticsearch.bootstrap.Natives.<clinit>(Natives.java:45) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.bootstrap.BootstrapInfo.isMemoryLocked(BootstrapInfo.java:44) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.monitor.process.ProcessProbe.processInfo(ProcessProbe.java:130) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.monitor.process.ProcessService.<init>(ProcessService.java:44) [elasticsearch-2.3.3.jar:2.3.3]
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_91]
  at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [?:1.8.0_91]
  at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [?:1.8.0_91]
  at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [?:1.8.0_91]
  at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:50) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:104) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:47) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:886) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:59) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:46) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:85) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:104) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:85) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:104) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:47) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:886) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:43) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:59) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:46) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:201) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:193) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:879) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InjectorBuilder.loadEagerSingletons(InjectorBuilder.java:193) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:175) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:96) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:46) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.node.Node.<init>(Node.java:213) [elasticsearch-2.3.3.jar:2.3.3]
  at org.elasticsearch.node.GraylogNode.<init>(GraylogNode.java:37) [classes/:2.3.3]
  at org.graylog2.bindings.providers.EsNodeProvider.get(EsNodeProvider.java:57) [classes/:?]

We are adding the dependency instead of silencing the log message because it adds useful features like mlockall.

Since Elasticsearch 2.3.3, Elasticsearch logs a warning with a huge
backtrace if jna is not available.

We are adding the dependency instead of silencing the log message
because it adds useful features like mlockall.
@bernd bernd added this to the 2.1.0 milestone Jun 8, 2016
@joschi joschi self-assigned this Jun 9, 2016
@joschi
Copy link
Contributor

@joschi joschi commented Jun 9, 2016

LGTM.

@joschi joschi merged commit b67141f into master Jun 9, 2016
4 checks passed
4 checks passed
@garybot2
ci-server-integration Jenkins build graylog2-server-integration-pr 977 has succeeded
Details
@garybot2
ci-web-linter Jenkins build graylog-pr-linter-check 463 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@joschi joschi deleted the add-jna-dependency branch Jun 9, 2016
@helloworldtang
Copy link

@helloworldtang helloworldtang commented Sep 11, 2016

    <dependency>
        <groupId>com.sun.jna</groupId>
        <artifactId>jna</artifactId>
        <version>3.0.9</version>
    </dependency>
@Graylog2 Graylog2 locked and limited conversation to collaborators Sep 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants