Exception while starting Logstash [LoadError: load error: jopenssl/load -- java.lang.VerifyError: class org.bouncycastle.asn1.ASN1Primitive overrides final method equals]

I am getting below exception while starting logstash [logstash-1.5.3]. Can any one please help me.
LoadError: load error: jopenssl/load -- java.lang.VerifyError: class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.(Ljava/lang/Object;)Z
require at org/jruby/RubyKernel.java:1072
(root) at /home/release/release_independent/elk/logstash/logstash-1.5.3/vendor/jruby/lib/ruby/shared/openssl.rb:1
require at org/jruby/RubyKernel.java:1072
(root) at /home/release/release_independent/elk/logstash/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/patches/stronger_openssl_defaults.rb:1
require at org/jruby/RubyKernel.java:1072
(root) at /home/release/release_independent/elk/logstash/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/patches/stronger_openssl_defaults.rb:2
require at org/jruby/RubyKernel.java:1072
(root) at /home/release/release_independent/elk/logstash/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/patches.rb:1
require at org/jruby/RubyKernel.java:1072
(root) at /home/release/release_independent/elk/logstash/logstash-1.5.3/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.3-java/lib/logstash/patches.rb:4
require at org/jruby/RubyKernel.java:1072
(root) at /home/release/release_independent/elk/logstash/logstash-1.5.3/lib/bootstrap/environment.rb:47

This issue is due to 2 different versions of bouncycastle jars.
One version of jar is located at $JAVA_HOME/jre/lib/ext/bcprov-*.jar
and another is located at logstash
./logstash-1.5.3/vendor/jruby/lib/ruby/shared/org/bouncycastle/bcprov-jdk15on/1.50/bcprov-jdk15on-1.50.jar.
Because of incompatible versions we get this error.

Solution is to overriding the JRE lib/ext folder using -Djava.ext.dirs=/some/dummy/path.
Refer the below link.