java.lang.reflect.InvocationTargetException

Stack Overflow | Alexiy | 4 months ago
  1. 0

    Designing an API - troubles with class loading (Groovy)

    Stack Overflow | 4 months ago | Alexiy
    java.lang.reflect.InvocationTargetException
  2. 0

    Java program that uses pptx4j throws org/apache/commons/lang/NotImplementedException

    Stack Overflow | 2 years ago
    java.lang.NoClassDefFoundError: org/apache/commons/lang/NotImplementedException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    java.lang.NoClassDefFoundError: javax/el/PropertyNotFoundException

    Google Groups | 2 years ago | Lunen de Lange
    java.lang.ClassNotFoundException: javax.el.PropertyNotFoundException*
  5. 0

    When we register a jar on the Hive console. Hive creates a fresh URL classloader which includes the path of the current jar to be registered and all the jar paths of the parent classloader. The parent classlaoder is the current ThreadContextClassLoader. Once the URLClassloader is created Hive sets that as the current ThreadContextClassloader. So if we register multiple jars in Hive, there will be multiple URLClassLoaders created, each classloader including the jars from its parent and the one extra jar to be registered. The last URLClassLoader created will end up as the current ThreadContextClassLoader. (See details: org.apache.hadoop.hive.ql.exec.Utilities#addToClassPath) Now here's an example in which the above strategy can lead to a CNF exception. We register 2 jars *j1* and *j2* in Hive console. *j1* contains the UDF class *c1* and internally relies on class *c2* in jar *j2*. We register *j1* first, the URLClassLoader *u1* is created and also set as the ThreadContextClassLoader. We register *j2* next, the new URLClassLoader created will be *u2* with *u1* as parent and *u2* becomes the new ThreadContextClassLoader. Note *u2* includes paths to both jars *j1* and *j2* whereas *u1* only has paths to *j1* (For details see: org.apache.hadoop.hive.ql.exec.Utilities#addToClassPath). Now when we register class *c1* under a temporary function in Hive, we load the class using {code} class.forName("c1", true, Thread.currentThread().getContextClassLoader()) {code} . The currentThreadContext class-loader is *u2*, and it has the path to the class *c1*, but note that Class-loaders work by delegating to parent class-loader first. In this case class *c1* will be found and *defined* by class-loader *u1*. Now *c1* from jar *j1* has *u1* as its class-loader. If a method (say initialize) is called in *c1*, which references the class *c2*, *c2* will not be found since the class-loader used to search for *c2* will be *u1* (Since the caller's class-loader is used to load a class) I've added a qtest to explain the problem. Please see the attached patch

    Apache's JIRA Issue Tracker | 1 year ago | Ratandeep Ratti
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

  1. andyglick 2 times, last 1 day ago
  2. richard77 1 times, last 4 days ago
  3. musketyr 2 times, last 5 days ago
  4. michallos 2 times, last 5 days ago
  5. batwalrus76 2 times, last 5 days ago
67 more registered users
28 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    jace/plugins/JavaPlugin.class

    at java.net.URLClassLoader.findClass()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    2. java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    3. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    4. java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    4 frames
  3. Unknown
    java_lang_ClassLoader$loadClass.call
    1. java_lang_ClassLoader$loadClass.call(Unknown Source)
    1 frame
  4. Groovy
    AbstractCallSite.call
    1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    2. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    3. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    3 frames
  5. jace
    Jace.start
    1. jace.Configuration.processConfiguration(Configuration.groovy:87)
    2. jace.Jace.start(Jace.java:56)
    2 frames
  6. com.sun.javafx
    PlatformImpl.lambda$null$173
    1. com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    2. com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    3. com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    3 frames
  7. Java RT
    AccessController.doPrivileged
    1. java.security.AccessController.doPrivileged(Native Method)
    1 frame
  8. com.sun.javafx
    PlatformImpl.lambda$runLater$174
    1. com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    1 frame
  9. com.sun.glass
    GtkApplication._runLoop
    1. com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    2. com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    2 frames