All Apps and Add-ons

Why am I getting error "Unsupported major.minor version 51.0" using HUNK App for MongoDB?

hsesterhenn
Path Finder

Hi,

Environment:
HUNK Sandbox running with VMware Fusion 5 on MacOSX 10.9

(http://www.splunk.com/goto/downloadhunksandbox)

MongoDB 2.6.4 running locally on MAC (Access localhost via Mongo Shell and MongoHub works)

HUNK VM and MAC can communicate using VMware NAT device (172.16.x.x/24 Network)

Telnet from VM to MAC on port 27017 works (message: connected)

Installed MongoDB App v1.0.3

Changed config of MongoDB provider and created new virtual indexes according to the YouTube-Video of Raanan (cloning indexes would be great 🙂

When searching an index with "index=mongo_northwind_products" I get no results and see an exception in search.log:

    08-30-2014 15:25:35.779 ERROR ERP.local-mongodb -  Exception in thread "main" java.lang.UnsupportedClassVersionError: com/splunk/erp/mongodb/MongoDBERP : Unsupported major.minor version 51.0
08-30-2014 15:25:35.779 ERROR ERP.local-mongodb -   at java.lang.ClassLoader.defineClass1(Native Method)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.security.AccessController.doPrivileged(Native Method)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
08-30-2014 15:25:35.780 ERROR ERP.local-mongodb -   at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
08-30-2014 15:25:35.793 ERROR ERP.local-mongodb -  Could not find the main class: com.splunk.erp.mongodb.MongoDBERP. Program will exit.
08-30-2014 15:25:35.796 ERROR SearchOperator:stdin - Cannot consume data with unset stream_type
08-30-2014 15:25:35.796 ERROR ExternalResultProvider - Error in 'SearchOperator:stdin': Cannot consume data with unset stream_type
0

I think "Unsupported major.minor version 51.0" sounds strange...

Any ideas what to do?

BR,

Holger

0 Karma
1 Solution

Damien_Dallimor
Ultra Champion

The error :

Unsupported major.minor version 51.0

Is due to your Java Runtime(JRE) not being the correct version to load the MongoDBERP class file .
Major version 51 means that the MongoDBERP class file was compiled with Java 7. I can confirm this if I open the class file :

alt text

Its in hex , but at the beginning you can see "0000 0033" which is the minor version(0000 in hex 0, in decimal) & major version(0033 in hex , 51 in decimal) of the class file.

So try updating your Java runtime to version 7 and you should be good to go 🙂

View solution in original post

Damien_Dallimor
Ultra Champion

The error :

Unsupported major.minor version 51.0

Is due to your Java Runtime(JRE) not being the correct version to load the MongoDBERP class file .
Major version 51 means that the MongoDBERP class file was compiled with Java 7. I can confirm this if I open the class file :

alt text

Its in hex , but at the beginning you can see "0000 0033" which is the minor version(0000 in hex 0, in decimal) & major version(0033 in hex , 51 in decimal) of the class file.

So try updating your Java runtime to version 7 and you should be good to go 🙂

hsesterhenn
Path Finder

OK, after some troubleshooting I found out that the MongoDB app requires Java 1.7 (as mentioned by Damien).

One important thing: Configure your virtual index to use the correct database!
It might be useful to switch on the verbose logging of MongoDB to see whether the requests from HUNK are correct.

Damien, Thank you!!!

hsesterhenn
Path Finder

OK, update to OpenJDK 1.7.0.x was successful.
No errors regarding version mismatch anymore.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...