java.lang.reflect.InvocationTargetException

tip

A few things cause this exception: 1) Check if you have all jars and if they're in the correct path when running. 2) Your classpath might be broken, you can define it in the command line with "java -cp yourClassPath" or at your IDE if you're using one.

tip

Needs to add netty-transport-native-epoll with a OS classifier to the classpath, it's not included in netty-all

tip

This might be an issue with the file location in the Spark submit command. Try it with "spark-submit --master spark://master:7077 hello_world_from_pyspark.py {file location}"

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • GitHub comment 23#244897201
    via GitHub by gs-spadmanabhan
    ,
  • jogl - Error building JOGL with Java 7
    via by Unknown author,
  • Wield exception
    via GitHub by flyasky
    ,
  • SQuirreL SQL Client / Mailing Lists
    via by Unknown author,
  • findbugs plugin fails to parse reports that contain warnings of thirdparty extensions of findbugs-plugins, see the fb-contrib package, but also other thirdparty detectors fail. As a workaround we still use findbugs ver. 3.13 which has no problems. (We add custom messages to the fb-contrib-messages.xml and this seems work ok) Our reports are generated by ant version 1.7.1 / findbugs 1.3.9. The fb-contrib is a plugin inside findbugs plugin folder and are automatically added to reports. Exception: [FINDBUGS] Collecting findbugs analysis files... FATAL: org/apache/bcel/classfile/Code java.lang.NoClassDefFoundError: org/apache/bcel/classfile/Code at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2427) at java.lang.Class.getDeclaredMethod(Class.java:1935) at edu.umd.cs.findbugs.DetectorFactory$ReflectionDetectorCreator.<init>(DetectorFactory.java:54) at edu.umd.cs.findbugs.DetectorFactory.<init>(DetectorFactory.java:135) at edu.umd.cs.findbugs.PluginLoader.init(PluginLoader.java:329) at edu.umd.cs.findbugs.PluginLoader.getPlugin(PluginLoader.java:135) at edu.umd.cs.findbugs.DetectorFactoryCollection.loadPlugin(DetectorFactoryCollection.java:448) at edu.umd.cs.findbugs.DetectorFactoryCollection.loadPlugins(DetectorFactoryCollection.java:333) at edu.umd.cs.findbugs.DetectorFactoryCollection.ensureLoaded(DetectorFactoryCollection.java:296) at edu.umd.cs.findbugs.DetectorFactoryCollection.instance(DetectorFactoryCollection.java:116) at edu.umd.cs.findbugs.I18N.lookupBugPattern(I18N.java:92) at edu.umd.cs.findbugs.BugInstance.<init>(BugInstance.java:159) at edu.umd.cs.findbugs.SAXBugCollectionHandler.startElement(SAXBugCollectionHandler.java:202) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at edu.umd.cs.findbugs.SortedBugCollection.doReadXML(SortedBugCollection.java:286) at edu.umd.cs.findbugs.SortedBugCollection.readXML(SortedBugCollection.java:263) at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:193) at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:129) at hudson.plugins.findbugs.parser.FindBugsParser.parse(FindBugsParser.java:89) at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:197) at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:176) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:126) at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:29) at hudson.FilePath.act(FilePath.java:753) at hudson.FilePath.act(FilePath.java:735) at hudson.plugins.findbugs.FindBugsPublisher.perform(FindBugsPublisher.java:103) at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:208) at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580) at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558) at hudson.model.Build$RunnerImpl.post2(Build.java:158) at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528) at hudson.model.Run.run(Run.java:1271) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:129) Caused by: java.lang.ClassNotFoundException: org.apache.bcel.classfile.Code at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 47 more
    via by romos,
    • java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:483) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'httpHandler' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$WebReactiveHandlerConfiguration.class]: Unsatisfied dependency expressed through method 'httpHandler' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dispatcherHandler' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$DispatcherHandlerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.reactive.DispatcherHandler]: Factory method 'dispatcherHandler' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$WebReactiveConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.gainsight.common.service.Service com.gainsight.web.controller.ActivityController.getService() at org.springframework.boot.context.embedded.ReactiveWebApplicationContext.onRefresh(ReactiveWebApplicationContext.java:52) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:535) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:369) at org.springframework.boot.SpringApplication.run(SpringApplication.java:313) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1185) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1174) at com.gainsight.ScribbleApplication.main(ScribbleApplication.java:19) ... 6 more Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'httpHandler' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$WebReactiveHandlerConfiguration.class]: Unsatisfied dependency expressed through method 'httpHandler' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dispatcherHandler' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$DispatcherHandlerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.reactive.DispatcherHandler]: Factory method 'dispatcherHandler' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$WebReactiveConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.gainsight.common.service.Service com.gainsight.web.controller.ActivityController.getService() at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:467) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.boot.context.embedded.ReactiveWebApplicationContext.getHttpHandler(ReactiveWebApplicationContext.java:110) at org.springframework.boot.context.embedded.ReactiveWebApplicationContext.createReactiveHttpServer(ReactiveWebApplicationContext.java:71) at org.springframework.boot.context.embedded.ReactiveWebApplicationContext.onRefresh(ReactiveWebApplicationContext.java:49) ... 13 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dispatcherHandler' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$DispatcherHandlerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.reactive.DispatcherHandler]: Factory method 'dispatcherHandler' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$WebReactiveConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.gainsight.common.service.Service com.gainsight.web.controller.ActivityController.getService() at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1118) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1046) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:834) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) ... 25 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.reactive.DispatcherHandler]: Factory method 'dispatcherHandler' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$WebReactiveConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.gainsight.common.service.Service com.gainsight.web.controller.ActivityController.getService() at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ... 38 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/reactiveweb/ReactiveWebAutoConfiguration$WebReactiveConfig.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to introspect annotations on public com.gainsight.common.service.Service com.gainsight.web.controller.ActivityController.getService() at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:499) at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1192) at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:310) at org.springframework.web.reactive.DispatcherHandler.initStrategies(DispatcherHandler.java:88) at org.springframework.web.reactive.DispatcherHandler.setApplicationContext(DispatcherHandler.java:84) at org.springframework.boot.autoconfigure.reactiveweb.ReactiveWebAutoConfiguration$DispatcherHandlerConfiguration.dispatcherHandler(ReactiveWebAutoConfiguration.java:69) at org.springframework.boot.autoconfigure.reactiveweb.ReactiveWebAutoConfiguration$DispatcherHandlerConfiguration$$EnhancerBySpringCGLIB$$5aada75.CGLIB$dispatcherHandler$1(<generated>) at org.springframework.boot.autoconfigure.reactiveweb.ReactiveWebAutoConfiguration$DispatcherHandlerConfiguration$$EnhancerBySpringCGLIB$$5aada75$$FastClassBySpringCGLIB$$49e78723.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) at org.springframework.boot.autoconfigure.reactiveweb.ReactiveWebAutoConfiguration$DispatcherHandlerConfiguration$$EnhancerBySpringCGLIB$$5aada75.dispatcherHandler(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ... 39 more Caused by: java.lang.IllegalStateException: Failed to introspect annotations on public com.gainsight.common.service.Service com.gainsight.web.controller.ActivityController.getService() at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1044) at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1013) at org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotationAttributes(AnnotatedElementUtils.java:638) at org.springframework.core.annotation.AnnotatedElementUtils.findMergedAnnotation(AnnotatedElementUtils.java:712) at org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping.createRequestMappingInfo(RequestMappingHandlerMapping.java:195) at org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping.getMappingForMethod(RequestMappingHandlerMapping.java:177) at org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping.getMappingForMethod(RequestMappingHandlerMapping.java:43) at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.lambda$detectHandlerMethods$0(AbstractHandlerMethodMapping.java:171) at org.springframework.core.MethodIntrospector$1.doWith(MethodIntrospector.java:72) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:546) at org.springframework.core.MethodIntrospector.selectMethods(MethodIntrospector.java:68) at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:170) at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:154) at org.springframework.web.reactive.result.method.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:126) at org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:117) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579) ... 61 more Caused by: java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletResponse at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethod(Class.java:2128) at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1159) at org.springframework.core.annotation.AnnotatedElementUtils.searchWithFindSemantics(AnnotatedElementUtils.java:1039) ... 77 more Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletResponse at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 82 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    1421 more bugmates