Skip to content

Instantly share code, notes, and snippets.

@jhowarth
Created April 15, 2011 21:23
Show Gist options
  • Save jhowarth/922504 to your computer and use it in GitHub Desktop.
Save jhowarth/922504 to your computer and use it in GitHub Desktop.
How to fix thread class loader issues in OSGi
ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
...initialize Toplink...
Thread.currentThread.setContextClassLoader(oldLoader);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment