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

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.

tip

Check if you didn't forget to instantiate your topic in the kafka broker.

tip

NoClassDefFoundError means java has failed to find a class you're trying to instantiate, look if you've added the class you're trying to instantiate to the dependencies.

tip

You need to add httpcore to your dependencies. Try adding version 4.3 or further.

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

  • Jenkins users - Hudson *almost* starts, then 404
    via by Unknown author,
  • When Hudson CI is started using IBM JDK 6 via java -jar hudson.war, the following is output to the console: [Winstone 2010/10/25 08:21:40] - Error starting listener instance java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:516) at winstone.Launcher.spawnListener(Launcher.java:232) at winstone.Launcher.<init>(Launcher.java:205) at winstone.Launcher.main(Launcher.java:391) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:600) at Main.main(Main.java:200) Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen at winstone.ssl.HttpsListener.<init>(HttpsListener.java:111) ... 12 more Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:77) at java.net.URLClassLoader.findClass(URLClassLoader.java:385) at java.lang.ClassLoader.loadClass(ClassLoader.java:653) at java.lang.ClassLoader.loadClass(ClassLoader.java:619) ... 13 more According to the Winstone website (http://winstone.sourceforge.net/), the following option can be used to set the KeyManagerFactory: --httpsKeyManagerType = the SSL KeyManagerFactory type (eg SunX509, IbmX509). Default is SunX509 This option (or something similar) should be supported by the Hudson CI start up to allow IBM JDK 6 startup to complete without reporting any errors.
    via by jkwuc89,
  • When Hudson CI is started using IBM JDK 6 via java -jar hudson.war, the following is output to the console: [Winstone 2010/10/25 08:21:40] - Error starting listener instance java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:516) at winstone.Launcher.spawnListener(Launcher.java:232) at winstone.Launcher.<init>(Launcher.java:205) at winstone.Launcher.main(Launcher.java:391) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:600) at Main.main(Main.java:200) Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen at winstone.ssl.HttpsListener.<init>(HttpsListener.java:111) ... 12 more Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:77) at java.net.URLClassLoader.findClass(URLClassLoader.java:385) at java.lang.ClassLoader.loadClass(ClassLoader.java:653) at java.lang.ClassLoader.loadClass(ClassLoader.java:619) ... 13 more According to the Winstone website (http://winstone.sourceforge.net/), the following option can be used to set the KeyManagerFactory: --httpsKeyManagerType = the SSL KeyManagerFactory type (eg SunX509, IbmX509). Default is SunX509 This option (or something similar) should be supported by the Hudson CI start up to allow IBM JDK 6 startup to complete without reporting any errors.
    via by jkwuc89,
  • I try to upgrade jenkins from 1.415 to 1.427 and get following error message: [Winstone 2011/08/24 09:55:47] - Beginning extraction from war file Jenkins home directory: /home/hudson/.hudson found at: $user.home/.hudson [Winstone 2011/08/24 09:55:56] - HTTP Listener started: port=8080 [Winstone 2011/08/24 09:55:56] - AJP13 Listener started: port=8009 Using one-time self-signed certificate [Winstone 2011/08/24 09:55:56] - Winstone shutdown successfully [Winstone 2011/08/24 09:55:56] - Container startup failed java.io.IOException: Failed to start a listener: winstone.ssl.HttpsListener at winstone.Launcher.spawnListener(Launcher.java:250) at winstone.Launcher.<init>(Launcher.java:206) at winstone.Launcher.main(Launcher.java:398) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at Main._main(Main.java:268) at Main.main(Main.java:96) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:522) at winstone.Launcher.spawnListener(Launcher.java:238) ... 8 more Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen at winstone.ssl.HttpsListener.<init>(HttpsListener.java:111) ... 13 more Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen at java.net.URLClassLoader.findClass(URLClassLoader.java:496) at java.lang.ClassLoader.loadClass(ClassLoader.java:631) at java.lang.ClassLoader.loadClass(ClassLoader.java:597) ... 14 more Aug 24, 2011 9:55:56 AM hudson.WebAppMain$2 run SEVERE: Failed to initialize Jenkins java.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:199) at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:244) at jenkins.model.Jenkins.executeReactor(Jenkins.java:813) at jenkins.model.Jenkins.<init>(Jenkins.java:727) at hudson.model.Hudson.<init>(Hudson.java:81) at hudson.model.Hudson.<init>(Hudson.java:77) at hudson.WebAppMain$2.run(WebAppMain.java:217) Exception in thread "pool-2-thread-1" java.lang.NullPointerException at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:191) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:810) java version "1.6.0" Java(TM) SE Runtime Environment (build pap6460sr5-20090529_04(SR5)) IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr5-20090519_35743 (JIT enabled, AOT enabled) J9VM - 20090519_035743_BHdSMr JIT - r9_20090518_2017 GC - 20090417_AA) JCL - 20090529_01
    via by Thorsten Löber,
  • I try to upgrade jenkins from 1.415 to 1.427 and get following error message: [Winstone 2011/08/24 09:55:47] - Beginning extraction from war file Jenkins home directory: /home/hudson/.hudson found at: $user.home/.hudson [Winstone 2011/08/24 09:55:56] - HTTP Listener started: port=8080 [Winstone 2011/08/24 09:55:56] - AJP13 Listener started: port=8009 Using one-time self-signed certificate [Winstone 2011/08/24 09:55:56] - Winstone shutdown successfully [Winstone 2011/08/24 09:55:56] - Container startup failed java.io.IOException: Failed to start a listener: winstone.ssl.HttpsListener at winstone.Launcher.spawnListener(Launcher.java:250) at winstone.Launcher.<init>(Launcher.java:206) at winstone.Launcher.main(Launcher.java:398) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at Main._main(Main.java:268) at Main.main(Main.java:96) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:522) at winstone.Launcher.spawnListener(Launcher.java:238) ... 8 more Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen at winstone.ssl.HttpsListener.<init>(HttpsListener.java:111) ... 13 more Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen at java.net.URLClassLoader.findClass(URLClassLoader.java:496) at java.lang.ClassLoader.loadClass(ClassLoader.java:631) at java.lang.ClassLoader.loadClass(ClassLoader.java:597) ... 14 more Aug 24, 2011 9:55:56 AM hudson.WebAppMain$2 run SEVERE: Failed to initialize Jenkins java.lang.InterruptedException at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:199) at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:244) at jenkins.model.Jenkins.executeReactor(Jenkins.java:813) at jenkins.model.Jenkins.<init>(Jenkins.java:727) at hudson.model.Hudson.<init>(Hudson.java:81) at hudson.model.Hudson.<init>(Hudson.java:77) at hudson.WebAppMain$2.run(WebAppMain.java:217) Exception in thread "pool-2-thread-1" java.lang.NullPointerException at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:191) at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:94) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690) at java.lang.Thread.run(Thread.java:810) java version "1.6.0" Java(TM) SE Runtime Environment (build pap6460sr5-20090529_04(SR5)) IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 AIX ppc64-64 jvmap6460sr5-20090519_35743 (JIT enabled, AOT enabled) J9VM - 20090519_035743_BHdSMr JIT - r9_20090518_2017 GC - 20090417_AA) JCL - 20090529_01
    via by Thorsten Löber,
    • java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:44) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:516) at winstone.Launcher.spawnListener(Launcher.java:232) at winstone.Launcher.<init>(Launcher.java:205) at winstone.Launcher.main(Launcher.java:391) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:600) at Main.main(Main.java:200) Caused by: java.lang.NoClassDefFoundError: sun.security.x509.CertAndKeyGen at winstone.ssl.HttpsListener.<init>(HttpsListener.java:111) ... 12 more Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:77) at java.net.URLClassLoader.findClass(URLClassLoader.java:385) at java.lang.ClassLoader.loadClass(ClassLoader.java:653) at java.lang.ClassLoader.loadClass(ClassLoader.java:619) ... 13 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,
    1851 more bugmates