# JNI error after sgadmin

**URL:** <https://forum.search-guard.com/t/jni-error-after-sgadmin/1034>\
**Category:** Search Guard\
**Created:** [July 23, 2018, 9:33am UTC](https://forum.search-guard.com/t/jni-error-after-sgadmin/1034 "2018-07-23T09:33:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eszter\_Csullog](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@Eszter\_Csullog](https://forum.search-guard.com/u/Eszter_Csullog)\
**Post date:** [July 23, 2018, 9:33am UTC](https://forum.search-guard.com/t/jni-error-after-sgadmin/1034/1 "2018-07-23T09:33:18Z")

</div>

Hi,

I installed the following modules:  
elasticsearch-6.3.1  
kibana-6.3.1-windows-x86\_64

search-guard-6-6.3.1-22.3

search-guard-tlstool-1.5

jdk1.8.0\_181

jre1.8.0\_181

The elastic search and the kibana are working. And first I can run sgadmin, so I could create the certificates. After that I want to add new users to internal\_users. But the sgadmin (use the same command) cause the next error:

Error: A JNI error has occurred, please check your installation and try again

Exception in thread “main” java.lang.NoClassDefFoundError: org/elasticsearch/client/transport/NoNodeAvailableException

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Unknown Source)

at java.lang.Class.privateGetMethodRecursive(Unknown Source)

at java.lang.Class.getMethod0(Unknown Source)

at java.lang.Class.getMethod(Unknown Source)

at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)

at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Caused by: java.lang.ClassNotFoundException: org.elasticsearch.client.transport.NoNodeAvailableException

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

… 7 more

In elasticsearch.yml:

cluster.name: TFClaster (I tried comment out it, but didn’t work)

node.name: TFnode-1

node.attr.rack: r1

path.data: C:\mypath\Desktop\ElasticData

path.logs: C:\mypath\Desktop\ElasticLog

network.host: DESKTOP-V10O5HE

transport.tcp.port: 9300

http.port: 9200

transport.host: 0.0.0.0

searchguard.enterprise\_modules\_enabled: false

xpack.monitoring.enabled: true

xpack.graph.enabled: false

xpack.ml.enabled: false

xpack.security.enabled: false

xpack.watcher.enabled: false

searchguard.ssl.transport.pemcert\_filepath: node1.pem

searchguard.ssl.transport.pemkey\_filepath: node1.key

searchguard.ssl.transport.pemkey\_password: MeFJjC46FtM4

searchguard.ssl.transport.pemtrustedcas\_filepath: root-ca.pem

searchguard.ssl.transport.enforce\_hostname\_verification: false

searchguard.ssl.transport.resolve\_hostname: false

searchguard.ssl.http.enabled: true

searchguard.ssl.http.pemcert\_filepath: node1\_http.pem

searchguard.ssl.http.pemkey\_filepath: node1\_http.key

searchguard.ssl.http.pemkey\_password: vkggFzIFpr6c

searchguard.ssl.http.pemtrustedcas\_filepath: root-ca.pem

searchguard.authcz.admin\_dn:

- [CN=kirk.example.com](http://CN=kirk.example.com),OU=Ops,O=Example Com, Inc.,DC=example,DC=com

searchguard.cert.oid: 1.2.3.4.5.5

Could you help me? I can’t find the problem ☹

---

<div class="post-metadata">

**Author:** ![jkressin](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/jkressin/32/9_2.png) [@jkressin](https://forum.search-guard.com/u/jkressin)\
**Post date:** [July 23, 2018, 7:54pm UTC](https://forum.search-guard.com/t/jni-error-after-sgadmin/1034/2 "2018-07-23T19:54:09Z")

</div>

Sorry, I don’t fully understand this issue. First, how exactly did you install Search Guard? And what does your elasticsearch.yml look like?

When you say:

“And first I can run sgadmin, so I could create the certificates”

what do you mean? Did you run sgadmin successfully? And how does running sgadmin relate to creating certificates?

“But the sgadmin (use the same command) cause the next error”

I also don’t understand, sorry. Do you mean you ran sgadmin once successfully, and the exact same command failed the second time?

What exact command did you run?

> **···**
>
> On Monday, July 23, 2018 at 11:33:18 AM UTC+2, csullogesztee wrote:
> 
> > Hi,
> > 
> > I installed the following modules:  
> > elasticsearch-6.3.1  
> > kibana-6.3.1-windows-x86\_64
> 
> > search-guard-6-6.3.1-22.3
> 
> > search-guard-tlstool-1.5
> 
> > jdk1.8.0\_181
> 
> > jre1.8.0\_181
> 
> > 
> 
> > The elastic search and the kibana are working. And first I can run sgadmin, so I could create the certificates. After that I want to add new users to internal\_users. But the sgadmin (use the same command) cause the next error:
> 
> > Error: A JNI error has occurred, please check your installation and try again
> 
> > Exception in thread “main” java.lang.NoClassDefFoundError: org/elasticsearch/client/transport/NoNodeAvailableException
> 
> > at java.lang.Class.getDeclaredMethods0(Native Method)
> 
> > at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> 
> > at java.lang.Class.privateGetMethodRecursive(Unknown Source)
> 
> > at java.lang.Class.getMethod0(Unknown Source)
> 
> > at java.lang.Class.getMethod(Unknown Source)
> 
> > at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
> 
> > at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
> 
> > Caused by: java.lang.ClassNotFoundException: org.elasticsearch.client.transport.NoNodeAvailableException
> 
> > at java.net.URLClassLoader.findClass(Unknown Source)
> 
> > at java.lang.ClassLoader.loadClass(Unknown Source)
> 
> > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> 
> > at java.lang.ClassLoader.loadClass(Unknown Source)
> 
> > … 7 more
> 
> > 
> 
> > In elasticsearch.yml:
> 
> > [cluster.name](http://cluster.name): TFClaster (I tried comment out it, but didn’t work)
> 
> > 
> 
> > [node.name](http://node.name): TFnode-1
> 
> > 
> 
> > node.attr.rack: r1
> 
> > 
> 
> > path.data: C:\mypath\Desktop\ElasticData
> 
> > 
> 
> > path.logs: C:\mypath\Desktop\ElasticLog
> 
> > 
> 
> > 
> 
> > network.host: DESKTOP-V10O5HE
> 
> > 
> 
> > transport.tcp.port: 9300
> 
> > http.port: 9200
> 
> > transport.host: 0.0.0.0
> 
> > 
> 
> > searchguard.enterprise\_modules\_enabled: false
> 
> > xpack.monitoring.enabled: true
> 
> > xpack.graph.enabled: false
> 
> > xpack.ml.enabled: false
> 
> > xpack.security.enabled: false
> 
> > xpack.watcher.enabled: false
> 
> > searchguard.ssl.transport.pemcert\_filepath: node1.pem
> 
> > searchguard.ssl.transport.pemkey\_filepath: node1.key
> 
> > searchguard.ssl.transport.pemkey\_password: MeFJjC46FtM4
> 
> > searchguard.ssl.transport.pemtrustedcas\_filepath: root-ca.pem
> 
> > searchguard.ssl.transport.enforce\_hostname\_verification: false
> 
> > searchguard.ssl.transport.resolve\_hostname: false
> 
> > searchguard.ssl.http.enabled: true
> 
> > searchguard.ssl.http.pemcert\_filepath: node1\_http.pem
> 
> > searchguard.ssl.http.pemkey\_filepath: node1\_http.key
> 
> > searchguard.ssl.http.pemkey\_password: vkggFzIFpr6c
> 
> > searchguard.ssl.http.pemtrustedcas\_filepath: root-ca.pem
> 
> > searchguard.authcz.admin\_dn:
> 
> > - CN=[kirk.example.com](http://kirk.example.com),OU=Ops,O=Example Com, Inc.,DC=example,DC=com
> 
> > searchguard.cert.oid: 1.2.3.4.5.5
> 
> > 
> 
> > 
> 
> > Could you help me? I can’t find the problem ☹

---

<div class="post-metadata">

**Author:** ![Eszter\_Csullog](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@Eszter\_Csullog](https://forum.search-guard.com/u/Eszter_Csullog)\
**Post date:** [July 24, 2018, 7:16am UTC](https://forum.search-guard.com/t/jni-error-after-sgadmin/1034/3 "2018-07-24T07:16:34Z")

</div>

Sorry, it’s my fault. I’m beginner and it’s my first installation. That step was the created the certificates for me. But it contain create the certificates with Offline TLS Tools and after that pushed configuration changes to SG with sgadmin.  
The command was:  
sgadmin.bat -cd ..\sgconfig\ -icl -nhnv -cacert ......\config\root-ca.pem -cert ......\config\kirk.pem --hostname desktop-v10o5he -key ......\config\kirk.key -keypass 7zojtw0eJTIF  
It worked. Next step was configuring the elastic.yml and kibana.yml. The ES and the kibana works and run in https. When I tried add new users to Kibana I modified the sg\_internal\_users. If I know well I have to run sgadmin again (I use the same command first, after I try this: ./sgadmin.sh -f ../sg\_internal\_users.yml -t internalusers -ts … -tspass … -ks … -kspass … with the correct values) But I got the upper exception. And I don’t know why.

My full elastic.yml:

# ---------------------------------- Cluster -----------------------------------

> **···**
>
> 2018-07-23 21:54 GMT+02:00 Jochen Kressin [jkressin@floragunn.com](mailto:jkressin@floragunn.com):
> 
> > Sorry, I don’t fully understand this issue. First, how exactly did you install Search Guard? And what does your elasticsearch.yml look like?
> 
> > When you say:
> 
> > 
> 
> > “And first I can run sgadmin, so I could create the certificates”
> 
> > 
> 
> > what do you mean? Did you run sgadmin successfully? And how does running sgadmin relate to creating certificates?
> 
> > 
> 
> > “But the sgadmin (use the same command) cause the next error”
> 
> > 
> 
> > I also don’t understand, sorry. Do you mean you ran sgadmin once successfully, and the exact same command failed the second time?
> 
> > 
> 
> > What exact command did you run?
> 
> > On Monday, July 23, 2018 at 11:33:18 AM UTC+2, csullogesztee wrote:
> > 
> > > Hi,
> > > 
> > > I installed the following modules:  
> > > elasticsearch-6.3.1  
> > > kibana-6.3.1-windows-x86\_64
> 
> > > search-guard-6-6.3.1-22.3
> 
> > > search-guard-tlstool-1.5
> 
> > > jdk1.8.0\_181
> 
> > > jre1.8.0\_181
> 
> > >
> 
> > > The elastic search and the kibana are working. And first I can run sgadmin, so I could create the certificates. After that I want to add new users to internal\_users. But the sgadmin (use the same command) cause the next error:
> 
> > > Error: A JNI error has occurred, please check your installation and try again
> 
> > > Exception in thread “main” java.lang.NoClassDefFoundError: org/elasticsearch/client/transport/NoNodeAvailableException
> 
> > > at java.lang.Class.getDeclaredMethods0(Native Method)
> 
> > > at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> 
> > > at java.lang.Class.privateGetMethodRecursive(Unknown Source)
> 
> > > at java.lang.Class.getMethod0(Unknown Source)
> 
> > > at java.lang.Class.getMethod(Unknown Source)
> 
> > > at [sun.launcher.LauncherHelper.va](http://sun.launcher.LauncherHelper.va)lidateMainClass(Unknown Source)
> 
> > > at [sun.launcher.LauncherHelper.ch](http://sun.launcher.LauncherHelper.ch)eckAndLoadMain(Unknown Source)
> 
> > > Caused by: java.lang.ClassNotFoundException: org.elasticsearch.client.transport.NoNodeAvailableException
> 
> > > at java.net.URLClassLoader.findClass(Unknown Source)
> 
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> 
> > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> 
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> 
> > > … 7 more
> 
> > >
> 
> > > In elasticsearch.yml:
> 
> > > [cluster.name](http://cluster.name): TFClaster (I tried comment out it, but didn’t work)
> 
> > >
> 
> > > [node.name](http://node.name): TFnode-1
> 
> > >
> 
> > > node.attr.rack: r1
> 
> > >
> 
> > > path.data: C:\mypath\Desktop\ElasticData
> 
> > >
> 
> > > path.logs: C:\mypath\Desktop\ElasticLog
> 
> > >
> 
> > >
> 
> > > network.host: DESKTOP-V10O5HE
> 
> > >
> 
> > > transport.tcp.port: 9300
> 
> > > http.port: 9200
> 
> > > transport.host: 0.0.0.0
> 
> > >
> 
> > > searchguard.enterprise\_modules\_enabled: false
> 
> > > xpack.monitoring.enabled: true
> 
> > > xpack.graph.enabled: false
> 
> > > xpack.ml.enabled: false
> 
> > > xpack.security.enabled: false
> 
> > > xpack.watcher.enabled: false
> 
> > > searchguard.ssl.transport.pemcert\_filepath: node1.pem
> 
> > > searchguard.ssl.transport.pemkey\_filepath: node1.key
> 
> > > searchguard.ssl.transport.pemkey\_password: MeFJjC46FtM4
> 
> > > searchguard.ssl.transport.pemtrustedcas\_filepath: root-ca.pem
> 
> > > searchguard.ssl.transport.enforce\_hostname\_verification: false
> 
> > > searchguard.ssl.transport.resolve\_hostname: false
> 
> > > searchguard.ssl.http.enabled: true
> 
> > > searchguard.ssl.http.pemcert\_filepath: node1\_http.pem
> 
> > > searchguard.ssl.http.pemkey\_filepath: node1\_http.key
> 
> > > searchguard.ssl.http.pemkey\_password: vkggFzIFpr6c
> 
> > > searchguard.ssl.http.pemtrustedcas\_filepath: root-ca.pem
> 
> > > searchguard.authcz.admin\_dn:
> 
> > > - CN=[kirk.example.com](http://kirk.example.com),OU=Ops,O=Example Com, Inc.,DC=example,DC=com
> 
> > > searchguard.cert.oid: 1.2.3.4.5.5
> 
> > >
> 
> > >
> 
> > > Could you help me? I can’t find the problem ☹
> 
> > –
> > 
> > You received this message because you are subscribed to the Google Groups “Search Guard Community Forum” group.
> > 
> > To unsubscribe from this group and stop receiving emails from it, send an email to [search-guard+unsubscribe@googlegroups.com](mailto:search-guard+unsubscribe@googlegroups.com).
> > 
> > To post to this group, send email to [search-guard@googlegroups.com](mailto:search-guard@googlegroups.com).
> 
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/4401f888-76a1-40cd-914a-22af16c05a1a%40googlegroups.com](https://groups.google.com/d/msgid/search-guard/4401f888-76a1-40cd-914a-22af16c05a1a%40googlegroups.com?utm_medium=email&utm_source=footer).
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
