Javax.mail.internet.AddressException while using logstash kafka input/output plugin


(Biswajit86) #1

Hi,

While using logstash kafka input/output plugins , i am getting an exception in my logs before logstash starts up. This isi a brief snippet of the error

Caused by: java.lang.ClassNotFoundException: javax.mail.internet.AddressException

  • I am on RHEL 5.11 version.
  • The exception is not critical, but is too long and fills up my console,
  • I am sure it is thrown when using the kafka plugin. I used to have a logstash config that read from topbeat and wrote to ealsticsearch. I split it into 2 different configs, one for reading from topbeat and writing to kafka , and the other for reading from kafka and writing to elastic. Both the configs are throwing this exception when starting up. This did not happen when I was reading from topbeat and writing to elastic

Could you please tell me what can be done to fix this?

Below is a brief stacktrace. The entire stacktrace s very long, so I have attached it across the posts and comments

Caused by: java.lang.ClassNotFoundException: javax.mail.internet.AddressException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.jruby.util.JRubyClassLoader.findClass(JRubyClassLoader.java:221)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 244 more


(Biswajit86) #2

stacktrace 1:

log4j:WARN Error during default initialization
java.lang.NoClassDefFoundError: javax/mail/internet/AddressException
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
at java.lang.Class.getConstructor0(Class.java:2885)
at java.lang.Class.newInstance(Class.java:350)
at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:247)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)
at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1004)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
at org.apache.log4j.LogManager.(LogManager.java:127)
at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:64)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:285)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:305)
at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:65)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.jruby.javasupport.JavaSupport.loadJavaClass(JavaSupport.java:149)
at org.jruby.javasupport.Java.getProxyClassOrNull(Java.java:879)
at org.jruby.javasupport.Java.getProxyClassOrNull(Java.java:872)
at org.jruby.javasupport.Java.getProxyOrPackageUnderPackage(Java.java:830)
at org.jruby.javasupport.Java.get_proxy_or_package_under_package(Java.java:932)


(Biswajit86) #3

stacktrace 2:

    at org.jruby.javasupport.JavaUtilities.get_proxy_or_package_under_package(JavaUtilities.java:54)
    at org.jruby.javasupport.JavaUtilities$INVOKER$s$2$0$get_proxy_or_package_under_package.call(JavaUtilities$INVOKER$s$2$0$get_proxy_or_package_under_package.gen)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:202)
    at rubyjit.Module$$method_missing_20d62b1d61b0eb3b2fb0311f0452a847295bc4361089920199.__file__(file:/local/0/deploy/nypntsrv/logstash/logstash-2.1.1/vendor/jruby/lib/jruby.jar!/jruby/java/java_package_module_template.rb:14)
    at rubyjit.Module$$method_missing_20d62b1d61b0eb3b2fb0311f0452a847295bc4361089920199.__file__(file:/local/0/deploy/nypntsrv/logstash/logstash-2.1.1/vendor/jruby/lib/jruby.jar!/jruby/java/java_package_module_template.rb)
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:101)
    at org.jruby.runtime.Helpers$MethodMissingMethod.call(Helpers.java:454)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:202)
    at org.jruby.runtime.callsite.CachingCallSite.callMethodMissing(CachingCallSite.java:393)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    at org.jruby.ast.ConstDeclNode.interpret(ConstDeclNode.java:98)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_CLASS(ASTInterpreter.java:103)
    at org.jruby.evaluator.ASTInterpreter.evalClassDefinitionBody(ASTInterpreter.java:280)
    at org.jruby.ast.ClassNode.interpret(ClassNode.java:138)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RootNode.interpret(RootNode.java:129)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_ROOT(ASTInterpreter.java:121)
    at org.jruby.Ruby.runInterpreter(Ruby.java:884)
    at org.jruby.Ruby.loadFile(Ruby.java:2833)
    at org.jruby.runtime.load.LibrarySearcher$ResourceLibrary.loadScript(LibrarySearcher.java:264)
    at org.jruby.runtime.load.LibrarySearcher$ResourceLibrary.load(LibrarySearcher.java:252)
    at org.jruby.runtime.load.LibrarySearcher$FoundLibrary.load(LibrarySearcher.java:51)
    at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:892)
    at org.jruby.runtime.load.LoadService.requireCommon(LoadService.java:465)
    at org.jruby.runtime.load.LoadService.require(LoadService.java:414)
    at org.jruby.RubyKernel.requireCommon(RubyKernel.java:1047)
    at org.jruby.RubyKernel.require19(RubyKernel.java:1040)
    at org.jruby.RubyKernel$INVOKER$s$1$0$require19.call(RubyKernel$INVOKER$s$1$0$require19.gen)
    at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:86)
    at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:86)
    at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:86)
    at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:177)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:183)
    at org.jruby.runtime.callsite.CachingCallSite.callVarargs(CachingCallSite.java:113)
    at rubyjit.Kernel$$require_8f79ae05d1a3860b56b459a5bdaaa9fdf709e8bc1089920199.chained_0_rescue_1$RUBY$SYNTHETIC__file__(/local/0/deploy/nypntsrv/logstash/logstash-stage-varys/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb:65)
    at rubyjit.Kernel$$require_8f79ae05d1a3860b56b459a5bdaaa9fdf709e8bc1089920199.__file__(/local/0/deploy/nypntsrv/logstash/logstash-stage-varys/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb)
    at rubyjit.Kernel$$require_8f79ae05d1a3860b56b459a5bdaaa9fdf709e8bc1089920199.__file__(/local/0/deploy/nypntsrv/logstash/logstash-stage-varys/vendor/bundle/jruby/1.9/gems/polyglot-0.3.5/lib/polyglot.rb)
    at org.jruby.ast.executable.AbstractScript.__file__(AbstractScript.java:42)

(Biswajit86) #4
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)

...

    at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
    at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
    at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
    at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
    at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:187)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    at org.jruby.ast.ReturnNode.interpret(ReturnNode.java:92)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
    at org.jruby.runtime.Block.call(Block.java:101)
    at org.jruby.RubyProc.call(RubyProc.java:300)
    at org.jruby.RubyProc.call19(RubyProc.java:281)
    at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:202)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:198)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:60)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
    at org.jruby.runtime.Block.call(Block.java:101)
    at org.jruby.RubyProc.call(RubyProc.java:300)
    at org.jruby.RubyProc.call19(RubyProc.java:281)
    at org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:202)
    at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:198)
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    at org.jruby.ast.CallSpecialArgNode.interpret(CallSpecialArgNode.java:65)
    at org.jruby.ast.DAsgnNode.interpret(DAsgnNode.java:110)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
    at org.jruby.ast.RescueNode.executeBody(RescueNode.java:221)
    at org.jruby.ast.RescueNode.interpret(RescueNode.java:116)
    at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
    at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
    at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
    at org.jruby.runtime.Block.call(Block.java:101)
    at org.jruby.RubyProc.call(RubyProc.java:300)
    at org.jruby.RubyProc.call(RubyProc.java:230)
    at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:99)
    at java.lang.Thread.run(Thread.java:745)

Caused by: java.lang.ClassNotFoundException: javax.mail.internet.AddressException
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
...
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 242 more


#5

we use logstash kafka plugin,it run very well?can you try update this jre version,i know logstash work in jdk 8 maybe well


(Biswajit86) #6

Let me try that,

Even if I upgrade to java8, unless java8 comes bundled with the necessary libs, I doubt it will help


#7

ok, because i start logstash by shell ,the command always alert this info


(system) #8