shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Nelson (JIRA)" <>
Subject [jira] [Created] (SHIRO-537) Class load issue in OSGI in ClassUtils
Date Tue, 28 Jul 2015 18:26:04 GMT
Tom Nelson created SHIRO-537:

             Summary: Class load issue in OSGI in ClassUtils
                 Key: SHIRO-537
             Project: Shiro
          Issue Type: Bug
    Affects Versions: 1.2.3
         Environment: OSGi Felix 4.0.3
            Reporter: Tom Nelson

I had the same issue that is described in:
where it was suggested a bug was entered but never was, so here it is.  A similar workaround
worked for me:

            Thread currentThread = Thread.currentThread();
            ClassLoader originalCl = currentThread.getContextClassLoader();
            try {
                Class<?> clazz = ((InfrastructureServer) server).getBundleContext().getBundle()
                ClassLoader bundleClassLoader = clazz.getClassLoader();

            } catch (ClassNotFoundException e) {
                // TODO Auto-generated catch block
            } finally {

In addition, commons-collections 3.2.1 must be used in an OSGi environment, I suggest bumping
your dependency.

This message was sent by Atlassian JIRA

View raw message