All Apps and Add-ons

JMS Modular Input - Unsupported major.minor version 51.0

nikduvall
Explorer

Since installing JMS Modular Input version 1.3.8, I am getting the following errors when Splunk starts:

02-17-2015 09:19:30.278 -0500 ERROR ModularInputs - Unable to initialize modular input "jms"  defined inside the app "jms_ta": Introspecting scheme=jms: script running failed (exited with code 1).
02-17-2015 09:19:30.237 -0500 ERROR ModularInputs - Introspecting scheme=jms: script running failed (exited with code 1).
02-17-2015 09:19:29.999 -0500 INFO  SpecFiles - Found external scheme definition for stanza "jms://" with 23 parameters: jndi_initialcontext_factory, jndi_provider_url, jndi_user, jndi_pass, destination_user, destination_pass, jms_connection_factory_name, durable, index_message_properties, index_message_header, message_selector, strip_newlines, init_mode, local_init_mode_resource_factory_impl, local_init_mode_resource_factory_params, message_handler_impl, message_handler_params, client_id, user_jndi_properties, browse_queue_only, browse_frequency, browse_mode, jvm_system_properties
0

When I run the command 'splunk cmd python /opt/splunk/etc/apps/jms_ta/bin/jms.py --scheme' as the user splunkd runs as, I get the following error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/splunk/modinput/jms/JMSModularInput : Unsupported major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: com.splunk.modinput.jms.JMSModularInput. Program will exit.

What do I need to do to resolve this?

0 Karma

bfernandez
Communicator

I have found a workaround for this issue configuring JAVA_HOME variable in $SPLUNK_HOME/etc/splunk-launch.conf.

0 Karma

nikduvall
Explorer

Dug deeper and discovered that openjdk 1.6 is pre-installed on our RedHat server image. Not sure what has changed between 1.3.7 and 1.3.8 in terms of how you find the java executable to use, but 1.3.7 finds jre 1.7 and 1.3.8 was finds openjdk 1.6 and throwing the Unsupported version error even though JAVA_HOME is mapped to jre 1.7.

To resolve the issue, I first uninstalled openjdk 1.6, which caused jmy.py to throw a 'file not found' error. Next, I re-installed jre 1.7 and 1.3.8 worked fine.

0 Karma

Damien_Dallimor
Ultra Champion

There are no changes in jms.py in 1.3.8 with respect to looking for the java executable.

1) script looks for JAVA_HOME for the current user Splunk is running under to determine the location of the java executable
2) if this is not set , then looks for the java executable on the PATH

0 Karma

Damien_Dallimor
Ultra Champion

Well I'm a bit stumped....I cant reproduce this at all. The JMS Mod Input is compiled with java version "1.7.0_67" , and that is the version I run with in all my test environments.

Further more the compilation Java version is identical in v1.3.7 and v1.3.8 (the 0000 0033 bytes below mean Major version 51 Minor version 0 = Java 7)

alt text
alt text

0 Karma

Damien_Dallimor
Ultra Champion

Major.minor version 51.0 is Java version 7 , the version that the JMS Mod Input is compiled to.

Is it possible that there is a Java runtime earlier than version 7 in your environment that is getting invoked ?

0 Karma

nikduvall
Explorer

Only Java 1.7u67 is installed and $JAVA_HOME is mapped to /usr/java/latest:

[user@server java]$ sudo echo $JAVA_HOME
/usr/java/latest/bin/java
[user@server java]$ sudo ls -la /usr/java
total 12
drwxr-xr-x   3 root root 4096 Feb 17 09:08 .
drwxr-xr-x. 15 root root 4096 Feb 17 09:08 ..
lrwxrwxrwx   1 root root   16 Feb 17 09:08 default -> /usr/java/latest
drwxr-xr-x   6 root root 4096 Feb 17 09:08 jre1.7.0_67
lrwxrwxrwx   1 root root   21 Feb 17 09:08 latest -> /usr/java/jre1.7.0_67
[user@server java]$
0 Karma

nikduvall
Explorer

I also have re-installed 1.3.7 and the same command returns the schema.

0 Karma
Get Updates on the Splunk Community!

Routing Data to Different Splunk Indexes in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. The OpenTelemetry project is the second largest ...

Getting Started with AIOps: Event Correlation Basics and Alert Storm Detection in ...

Getting Started with AIOps:Event Correlation Basics and Alert Storm Detection in Splunk IT Service ...

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...