shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mladen Marev (JIRA)" <>
Subject [jira] [Commented] (SHIRO-389) Fix OSGI Exports for shiro-ehcache
Date Wed, 02 Jan 2013 13:46:12 GMT


Mladen Marev commented on SHIRO-389:

We need that, because we will be able to run with ehcache configured manager from shiro.ini
and without.
If application needs it, it has to add it to OSGi runtime and modify configuration file. Because
it is optional it will be loaded only if available.
If application does not need shiro-ehcache it just does not add shiro-ehcache bundle to OSGi
environment and optional import does not break shiro-core from starting up and initialize
If you use shiro-ehcache and you do not have the import, then initialization fails even if
the bundle is available in the OSGi runtime, because classloader does not see the class located
in shiro-ehcache bundle.
So to summarize it is needed as optional, because shiro-core bundle class loader does not
know at startup if ehcache is needed or not. It knows it later (after startup) when it reads
configuration file.
You say shiro-core has no dependency on shiro-ehcache.
You can try this configuration in OSGi environment (example is taken from shiro documentation
on session management):
cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
securityManager.cacheManager = $cacheManager

You will see, how ClassNotFoundException is thrown on initialization even if shiro-ehcache
bundle is available and loaded in the OSGi runtime.
I hope this info is enough.
> Fix OSGI Exports for shiro-ehcache
> ----------------------------------
>                 Key: SHIRO-389
>                 URL:
>             Project: Shiro
>          Issue Type: Bug
>          Components: Caching 
>    Affects Versions: 1.2.0, 1.2.1
>            Reporter: Chris Geer
>            Assignee: Les Hazlewood
>             Fix For: 1.2.2, 1.3.0
>         Attachments: SHIRO_389_core.patch, SHIRO-389.patch
> Currently the osgi-export in the pom file is org.apache.shiro.ehcache which isn't a valid
package. It should be changed to org.apache.shiro.cache.ehcache

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message