Error while using sgadmin.sh

52 views
Skip to first unread message

Rajat Singh

unread,
Oct 14, 2016, 1:01:29 AM10/14/16
to Search Guard

Hello folks,

I am getting error while using the ./sgadmin.sh -ts truststore.jks -ks kirk-keystore.jks -cd ../sgconfig -icl
i had copied the truststor and kirk-keystore files in the same directory of  sgadmin.sh 

aslo made the changes to the eleasticsearch.yml file
searchguard.authcz.admin_dn:
  - CN=kirk,OU=client,O=client,L=test, C=DE
as i am using example pki  scripts for creating the certificates 



Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

in...@search-guard.com

unread,
Oct 15, 2016, 4:15:26 PM10/15/16
to Search Guard
your directory structure seems to be messed up. The sgadmin.sh script should set the classpath properly normally.
commons-cli-1.3.1.jar is in lib/ folder of elasticsearch and this whole folder is included in the classpath when running sgadmin.sh

How does you directory structure looks like and from which directory you call sgadmin.sh?

Rajat Singh

unread,
Oct 17, 2016, 7:00:33 AM10/17/16
to search...@googlegroups.com
Thanks for the reply 
I am calling the sgadmin.sh from the 
Elasticsearch
 Plugins
   Search-guard-2
     Tools
       sgadmin.sh
and in the same folder i am having truststore.jks and kirk-keystore.jks
       sgconfig file is inside the Tools directory



Please Tell me if any other thing is required in order to figure out the issue




--
You received this message because you are subscribed to a topic in the Google Groups "Search Guard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/search-guard/5HrqvwFZJfw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to search-guard+unsubscribe@googlegroups.com.
To post to this group, send email to search...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/search-guard/7e152efa-c059-44c4-87c6-7c930f5d8d5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ZillaYT

unread,
Oct 17, 2016, 9:17:33 AM10/17/16
to Search Guard
The keystore and truststore JKS files should be in the /path-to-ES/plugins/search-guard-2/sgconfig dir, since you specify "-cd ../sgconfig" in your command line. The "-cd" option says "look for the JKS files relative to that path"
To unsubscribe from this group and all its topics, send an email to search-guard...@googlegroups.com.

Rajat Singh

unread,
Oct 18, 2016, 2:08:16 AM10/18/16
to search...@googlegroups.com
Hello folks,
I had changed the path of truststore and kirk file and placed it in sgconfig folder but then also i am getting the same error

Looking forward for reply
Thanks,
Rajat Singh

To unsubscribe from this group and all its topics, send an email to search-guard+unsubscribe@googlegroups.com.

To post to this group, send email to search...@googlegroups.com.

ZillaYT

unread,
Nov 3, 2016, 5:15:52 PM11/3/16
to Search Guard
I use absolute paths, like this

./sgadmin.sh -ts /path_to/truststore.jks -ks /path_to/kirk-keystore.jks -cd ../sgconfig -icl

in...@search-guard.com

unread,
Nov 15, 2016, 1:52:09 PM11/15/16
to Search Guard
Actually, that's not true. The -cd switch only specifies where your config files are located. It has nothing to do with the keystore or truststore paths. The key- and truststore paths are relative to the directory where you execute sgadmin from. So, the bullet-proof way is either to use absolute paths, or, just place the files in the tools directory and execute sgadmin from there.
Reply all
Reply to author
Forward
0 new messages