Question: How can I go about loading a Spring context with my own `ClassLoader` instance?

Answer: 
Many Spring Context Loader (for example [ClassPathXmlApplicationContext](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/context/support/ClassPathXmlApplicationContext.html)
) are subclass of [DefaultResourceLoader](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/core/io/DefaultResourceLoader.html).

`DefaultResourceLoader` has a [constructor](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/core/io/DefaultResourceLoader.html#DefaultResourceLoader%28java.lang.ClassLoader%29) where you can specify the Classloader and also has a [`setClassLoader`](http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/core/io/DefaultResourceLoader.html#setClassLoader%28java.lang.ClassLoader%29) method.

So it is your task to find a constructor of the Spring Context Loader you need, where you can specify the classloader, or just create it, and then use the set to set the classloader you want.
People who are using spring boot and wants to use custom classloader to create application context can do it like this:

```
@SpringBootApplication
public class Application
{

public static void main(String[] args) {

        SpringApplication app =
            new SpringApplication(Application.class);

        ResourceLoader resourceLoader = new DefaultResourceLoader();

        YourClassLoaderObject yourClassLoaderObject = new YourClassLoaderObject();

        ((DefaultResourceLoader)resourceLoader).setClassLoader(yourClassLoaderObject);

        app.setResourceLoader(resourceLoader);

        context = app.run(args);

    }

}

```