Logstash JMS Input with Weblogic JMS server

Hi,

I'm having problems configuring the Logstash JMS input plugin in order to read messages from a queue on Oracle Weblogic JMS server.

I'm using Logstash v7.9.3 and the version of the jms input plugin is v3.1.2 (the one that comes from the default installation of Logstash).

My pipeline configuration is the following:

input {
    jms {
		include_header => true
		include_properties => true
		include_body => true
		use_jms_timestamp => true
		interval => 10
		timeout => -1
		destination => "jms/Queue/loggerMessageQueue"
		pub_sub => false
		yaml_file => "/app/elk/logstash-test/pipelines/jms-broker-connection.yml"
		yaml_section => "weblogic_jms_host1"
    }
}

filter {
}

output {
	stdout {
		codec => "rubydebug"
	}
}

The YAML file that is referenced in the pipeline conf has the following content:

weblogic_jms_host1:
  :jndi_name: jms/ConnFactory/ConnFactoryLogger
  :jndi_context: 
    java.naming.factory.initial: weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url: 't3://host1:9011'
    java.naming.factory.url.pkgs: javax.naming:javax.jms
    java.naming.security.principal: admin
    java.naming.security.credentials: admin
  :require_jars:
    - '/app/elk/jms-lib/wlthint3client.jar'
    - '/app/elk/jms-lib/wljmsclient.jar'
    - '/app/elk/jms-lib/wlclient.jar'
    - '/app/elk/jms-lib/glassfish-corba-omgapi-4.2.4.jar'
  :username: admin
  :password: admin

Here host1 is the hostname of the machine where the JMS server is located.

I'm using these jars as recommended by the admins of the JMS server:

wlthint3client.jar
wljmsclient.jar
wlclient.jar

and I added this other jar file: glassfish-corba-omgapi-4.2.4.jar, because Logstash was getting a NoClassDefFoundError exception for class org.omg.PortableInterceptor.ORBInitializer.

After I added the latest version of glassfish-corba-omgapi Java package (glassfish-corba-omgapi-4.2.4.jar) which containes this class, I'm not getting this error anymore, but Logstash gives me this warning message:

[WARN ][logstash.inputs.jms ][test][jms_input_weblogic_osbfe1] JMS Consumer Died {:exception=>"Java::JavaxNaming::CommunicationException", :exception_message=>"[JDK 1.3 or higher required]", :backtrace=>["weblogic.jndi.internal.ExceptionTranslator.toNamingException(weblogic/jndi/internal/ExceptionTranslator.java:40)", "weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(weblogic/jndi/WLInitialContextFactoryDelegate.java:808)", "weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(weblogic/jndi/WLInitialContextFactoryDelegate.java:363)", "weblogic.jndi.Environment.getContext(weblogic/jndi/Environment.java:319)", "weblogic.jndi.Environment.getContext(weblogic/jndi/Environment.java:288)", "weblogic.jndi.WLInitialContextFactory.getInitialContext(weblogic/jndi/WLInitialContextFactory.java:117)", "javax.naming.spi.NamingManager.getInitialContext(javax/naming/spi/NamingManager.java:730)", "javax.naming.InitialContext.getDefaultInitCtx(javax/naming/InitialContext.java:305)", "javax.naming.InitialContext.init(javax/naming/InitialContext.java:236)", "javax.naming.InitialContext.(javax/naming/InitialContext.java:208)", "jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)", "jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(jdk/internal/reflect/NativeConstructorAccessorImpl.java:62)", "jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(jdk/internal/reflect/DelegatingConstructorAccessorImpl.java:45)", "java.lang.reflect.Constructor.newInstanceWithCaller(java/lang/reflect/Constructor.java:500)", "java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor.java:481)", "org.jruby.javasupport.JavaConstructor.newInstanceDirect(org/jruby/javasupport/JavaConstructor.java:285)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:918)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "app.elk.bin.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.jruby_minus_jms_minus_1_dot_3_dot_0_minus_java.lib.jms.connection.initialize(/app/elk/bin/logstash/vendor/bundle/jruby/2.5.0/gems/jruby-jms-1.3.0-java/lib/jms/connection.rb:175)", "app.elk.bin.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_input_minus_jms_minus_3_dot_1_dot_2_minus_java.lib.logstash.inputs.jms.run(/app/elk/bin/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jms-3.1.2-java/lib/logstash/inputs/jms.rb:225)", "app.elk.bin.logstash.vendor.bundle.jruby.$2_dot_5_dot_0.gems.logstash_minus_input_minus_jms_minus_3_dot_1_dot_2_minus_java.lib.logstash.inputs.jms.RUBY$method$run$0$VARARGS(app/elk/bin/logstash/vendor/bundle/jruby/$2_dot_5_dot_0/gems/logstash_minus_input_minus_jms_minus_3_dot_1_dot_2_minus_java/lib/logstash/inputs//app/elk/bin/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-jms-3.1.2-java/lib/logstash/inputs/jms.rb)", "app.elk.bin.logstash.logstash_minus_core.lib.logstash.pipeline.inputworker(/app/elk/bin/logstash/logstash-core/lib/logstash/pipeline.rb:474)", "app.elk.bin.logstash.logstash_minus_core.lib.logstash.pipeline.RUBY$method$inputworker$0$VARARGS(app/elk/bin/logstash/logstash_minus_core/lib/logstash//app/elk/bin/logstash/logstash-core/lib/logstash/pipeline.rb)", "app.elk.bin.logstash.logstash_minus_core.lib.logstash.pipeline.start_input(/app/elk/bin/logstash/logstash-core/lib/logstash/pipeline.rb:466)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:318)", "java.lang.Thread.run(java/lang/Thread.java:830)"], :root_cause=>{:exception=>"Java::WeblogicSocket::UnrecoverableConnectException", :exception_message=>"[JDK 1.3 or higher required]"}}

and it is not producing any event.

The warning seems to suggest the JDK that Logstash is using has not right version.
I'm using this version of Java (from command java --version):

openjdk 13 2019-09-17
OpenJDK Runtime Environment AdoptOpenJDK (build 13+33)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13+33, mixed mode, sharing)

I got this JDK from the Elasticsearch installation directory (v7.9.3).
I do not know if this version is compatible or not with what is required by the JMS client.

Does anyone has any clue?
Could the cause of the error be something unrelated to the JDK and I'm missing something?

Any suggestions would be greatly appreciated!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.