Hi,
I've installed the Hunk MongoDB App to connect to my local mongoDB (v. 3.0.6), created a provider for it and a virtual index for one of my collections. If I try to search for the index I get the following error message: [local-mongodb] Error while running external process, return_code=1.
So I've checked the search.log and found a NoClassDefFound Error:
10-06-2015 13:55:33.855 ERROR ERP.local-mongodb - Error: A JNI error has occurred, please check your installation and try again
10-06-2015 13:55:33.856 ERROR ERP.local-mongodb - Exception in thread "main" java.lang.NoClassDefFoundError: com/splunk> > >/util/WildcardList
>10-06-2015 13:55:33.856 ERROR ERP.local-mongodb - at java.lang.Class.getDeclaredMethods0(Native Method)
>10-06-2015 13:55:33.856 ERROR ERP.local-mongodb - at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
>10-06-2015 13:55:33.856 ERROR ERP.local-mongodb - at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
>10-06-2015 13:55:33.856 ERROR ERP.local-mongodb - at java.lang.Class.getMethod0(Class.java:3018)
>10-06-2015 13:55:33.856 ERROR ERP.local-mongodb - at java.lang.Class.getMethod(Class.java:1784)
>10-06-2015 13:55:33.857 ERROR ERP.local-mongodb - at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
>10-06-2015 13:55:33.857 ERROR ERP.local-mongodb - at >sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
>10-06-2015 13:55:33.857 ERROR ERP.local-mongodb - Caused by: java.lang.ClassNotFoundException: com.splunk.util.WildcardList
>10-06-2015 13:55:33.857 ERROR ERP.local-mongodb - at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
>10-06-2015 13:55:33.857 ERROR ERP.local-mongodb - at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>10-06-2015 13:55:33.857 ERROR ERP.local-mongodb - at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
>10-06-2015 13:55:33.858 ERROR ERP.local-mongodb - at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>10-06-2015 13:55:33.858 ERROR ERP.local-mongodb - ... 7 more
My config looks like this:
[Provider]
Name: local-mongodb
Additional Settings:
vix.commmand /usr/java/latest/bin/java
vix.command.arg.1 -Xmx512m
vix.command.arg.2 -classpath
vix.command.arg.4 com.splunk.erp.mongodb.MongoDBERP
vix.mode stream
vix.mongodb.host localhost:27017
[Virtual index]
Name: status_threatstatus
Provider: local-mongodb
Path to data in HDFS*: (why should I put something here?)
Settings:
vix.mongodb.collection threatStatus
vix.mongodb.db status
vix.mongodb.field.time _id
vix.mongodb.field.time.format ObjectId
I have no authentication and other clients have no problem to connect to the mongo. What can I do to solve this issue?
Greets Tobias
If you are using Hunk 6.3 try this:
go to /opt/splunk/etc/apps/MongoDB/default -> indexes.conf
Modify this line:
Old
vix.command.arg.3 = $SPLUNK_HOME/bin/jars/SplunkMR-s6.0-h1.0.jar:$SPLUNK_HOME/etc/apps/MongoDBApp/bin/hunk_mongodb_app.jar:$SPLUNK_HOME/etc/apps/MongoDBApp/bin/lib/*
vix.command.arg.4 = com.splunk.erp.mongodb.MongoDBERP
New
vix.command.arg.3 = $SPLUNK_HOME/bin/jars/SplunkMR-h1.jar:$SPLUNK_HOME/etc/apps/MongoDBApp/bin/hunk_mongodb_app.jar:$SPLUNK_HOME/etc/apps/MongoDBApp/bin/lib/*
vix.command.arg.4 = com.splunk.erp.mongodb.MongoDBERP
If you are using Hunk 6.3 try this:
go to /opt/splunk/etc/apps/MongoDB/default -> indexes.conf
Modify this line:
Old
vix.command.arg.3 = $SPLUNK_HOME/bin/jars/SplunkMR-s6.0-h1.0.jar:$SPLUNK_HOME/etc/apps/MongoDBApp/bin/hunk_mongodb_app.jar:$SPLUNK_HOME/etc/apps/MongoDBApp/bin/lib/*
vix.command.arg.4 = com.splunk.erp.mongodb.MongoDBERP
New
vix.command.arg.3 = $SPLUNK_HOME/bin/jars/SplunkMR-h1.jar:$SPLUNK_HOME/etc/apps/MongoDBApp/bin/hunk_mongodb_app.jar:$SPLUNK_HOME/etc/apps/MongoDBApp/bin/lib/*
vix.command.arg.4 = com.splunk.erp.mongodb.MongoDBERP
YES. This was it.
yep, helped me as well. With no restart.
Thanks this helped me too. Note - I did not edit the indexes.conf directly, but updated the the provider settings by going to Settings - > Virtual Indexes -> "local-mongodb". I added the vix.command.arg.3 setting through the GUI and was able to connect to MongoDB.
Thank you, that worked 🙂