java.lang.ClassNotFoundException: com.atlassian.jira.crowd.embedded.ofbiz.DirectoryEntityKey not found by com.almworks.jira.structure [18] (no security manager: RMI class loader disabled)

Atlassian JIRA | Taiwo Akindele [Atlassian] | 4 months ago
  1. 0

    h3. Summary In a JIRA Data Center Environment, ClassNotFoundException can be seen in the logs due to an installed plugin thread initializing JIRA Data Center cache with it's own classloader. h3. Environment * Reproduced with JIRA Data Center 7.1.x with Structure Plugin 3.1 h3. Steps to Reproduce # Setup a JIRA Data Center with 2 nodes. # The error can be thrown under very specific conditions where an installed plugin code initializes cache in core JIRA code. h3. Expected Results The correct classloader is used to initialize and access the cache, and there are no errors with replicating the cache to other nodes h3. Actual Results # Cache is initialized with the plugin's class loader, rather than the correct class loader for the code. # Errors similar to the following are thrown in the application logs during cache replication to other nodes. Note that this errors will be show at "healthy node" and actual problem is at other node(s). {code:java} 2016-05-26 12:03:12,218 http-nio-8080-exec-8 ERROR anonymous 723x169744x1 1fhqh5i 10.223.41.99,10.233.128.11 /rest/gadget/1.0/login [n.s.ehcache.distribution.RMISynchronousCacheReplicator] Exception on replication of removeNotification. RemoteException occurred in server thread; nested exception is:     java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:     java.lang.ClassNotFoundException: com.atlassian.jira.crowd.embedded.ofbiz.DirectoryEntityKey not found by com.almworks.jira.structure [18] (no security manager: RMI class loader disabled). Continuing... java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: com.atlassian.jira.crowd.embedded.ofbiz.DirectoryEntityKey not found by com.almworks.jira.structure [18] (no security manager: RMI class loader disabled) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:354) {code} or {code:borderStyle=solid} 2016-08-01 16:44:50,516 Caesium-1-4 ERROR [n.s.ehcache.distribution.RMISynchronousCacheReplicator] Exception on replication of putNotification. RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: net.sf.ehcache.Element not found by com.almworks.jira.structure [17] (no security manager: RMI class loader disabled). Continuing... java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.Element not found by com.almworks.jira.structure [17] (no security manager: RMI class loader disabled) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:396) {code} h3. Workaround (for plugin developers) * Plugin developers may consider wrapping such calls with a class loader switching code, to ensure that the right class loader is used. For example, in a case of calling ApplicationUser's static methods, the class loader switch may be as easy as: {code:java} ClassLoader previous = Thread.currentThread().getContextClassLoader(); try {    Thread.currentThread().setContextClassLoader(ApplicationUsers.class.getClassLoader());    ApplicationUsers.getKey() } finally {    Thread.currentThread().setContextClassLoader(previous); } {code} h3. Workaround (for users) # Disable plugin triggeed cache problem: Structure or other # Restart node(s) not having mentioned error # Enable plugin again

    Atlassian JIRA | 4 months ago | Taiwo Akindele [Atlassian]
    java.lang.ClassNotFoundException: com.atlassian.jira.crowd.embedded.ofbiz.DirectoryEntityKey not found by com.almworks.jira.structure [18] (no security manager: RMI class loader disabled)
  2. 0

    Java error RMI exception

    Stack Overflow | 3 years ago | capa57
    java.lang.ClassNotFoundException: remote.RemoteEvent
  3. 0

    Java RMI InitialContext: Equivalent of LocateRegistry.createRegistry(int)?

    Stack Overflow | 7 years ago | bguiz
    java.lang.ClassNotFoundException: bguiz.scratch.CustomObj
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    RMI server does not dynamically load missing classes from its HTTP codebase server

    Stack Overflow | 2 years ago | mins
    java.lang.ClassNotFoundException: WorkRequestSquare
  6. 0

    RMI server ClassNotFoundException

    Oracle Community | 1 decade ago | 843793
    java.lang.ClassNotFoundException: Message

    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

      com.atlassian.jira.crowd.embedded.ofbiz.DirectoryEntityKey not found by com.almworks.jira.structure [18] (no security manager: RMI class loader disabled)

      at sun.rmi.server.UnicastServerRef.dispatch()
    2. Java RT
      UnicastServerRef.dispatch
      1. sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:354)
      1 frame