Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-5374

remote file operation failed .... NullPointerException - ClassLoader is null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • remoting
    • None
    • Linux CentOS 5, jdk 1.6.10 mixed mode

      Hello,

      I updated our hudson from version 1.315 to version 1.342.
      After the update only the master was able to build the projects.
      Our slave nodes failed with the following message.
      ############################
      Started by an SCM change
      Building remotely on XXXX
      Checking out XXXX
      remote file operation failed: XXXX at hudson.remoting.Channel@1c3e3b:XXXX
      Notifying upstream projects of job completion
      Finished: FAILURE
      ############################

      After a bit of debugging I found out that the Problem is a NullPointerException within the
      hudson.remoting.RemoteClassLoader.ClassLoaderProxy class.
      Sometimes the ClassLoader of a class can be null. Refer to the javadoc http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#getClassLoader%28%29
      ########################################################
      getClassLoader

      public ClassLoader getClassLoader()

      Returns the class loader for the class. Some implementations may use null to represent the bootstrap class loader. This method will return null in such implementations if this class was loaded by the bootstrap class loader.

      If a security manager is present, and the caller's class loader is not null and the caller's class loader is not the same as or an ancestor of the class loader for the class whose class loader is requested, then this method calls the security manager's checkPermission method with a RuntimePermission("getClassLoader") permission to ensure it's ok to access the class loader for the class.

      If this object represents a primitive type or void, null is returned.

      Returns:
      the class loader that loaded the class or interface represented by this object.
      Throws:
      SecurityException - if a security manager exists and its checkPermission method denies access to the class loader for the class.
      See Also:
      ClassLoader, SecurityManager.checkPermission(java.security.Permission), RuntimePermission
      ########################################################

      I found out that the ClassLoader was null in fact for the SAXParserFactoryImpl class.
      So the RemoteClassLoader failed at line 121 on the slave.

      ########################################################
      ClassFile cf = proxy.fetch2(name);
      ########################################################

      This method calls "static int exportId(ClassLoader cl, Channel local)" and finally
      hudson.remoting.RemoteClassLoader.ClassLoaderProxy.hashCode() is called wich leads to the NullPointerException

      Best regards

            oleg_nenashev Oleg Nenashev
            rlink77de rlink77de
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: