Understanding classloaders is not an unusual thing for "normal" Java developers to have difficulty with as it only comes up in situations like this. There are "creative" ways around it. The key is in simply understanding what has visibility to what. The Play classloader will have visibility to everything on the system class loader but the system class loader can't see anything in its child class loaders. The way around this is to add a class to the system class loader and then somehow manage to have the class in the child classloader "register" itself (i.e. - call a set method) to add itself to an instance of the class in the system classloader. For example, lets say you want to have an appender that requires stuff in the Play Framework. You would create an Appender on the system class loader that is a shell and by itself does nothing. Then your application finds that appender and calls a set method on it to register the functionality you want the appender to perform and then the appender will start functioning by calling the class instance you provided in your application. |