You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Diogo Guerra <di...@gmail.com> on 2012/06/13 00:40:43 UTC

DefaultWebSecurityManager.setSessionMode has been deprecated

Hi all,

We are using Shiro to manage security in our application server. The
application server also has a web server.

The way we had implemented in the previous version was using native
sessions in order to share all the sessions being from a web application or
not.

(this is our shiro.ini)

[main]
securityManager = org.apache.shiro.web.mgt.DefaultWebSecurityManager
# Cache for single sign on
ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
ssoCacheManager.cacheManagerConfigFile = conf/engine/shiro/ehcache.xml
securityManager.cacheManager = $ssoCacheManager

# native for single sign on
securityManager.sessionMode = native

# DAO for single sign on
sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
securityManager.sessionManager.sessionDAO = $sessionDAO

# cookie for single sign on
cookie = org.apache.shiro.web.servlet.SimpleCookie
cookie.name = SSOcookie
cookie.path = /
securityManager.sessionManager.sessionIdCookie = $cookie


Since shiro 1.2.0 we have being notified with the following message:

         ! 12-Jun 23:39:26 DefaultWebSecurityManager.setSessionMode:114
 The 'sessionMode' property has been deprecated.  Please configure an
appropriate WebSessionManager instance instead of using
this property.  This property/method will be removed in a later version.

I've been looking in the documentation but I'm not certain of how to
achieve this...

Any help?

--Diogo

Re: DefaultWebSecurityManager.setSessionMode has been deprecated

Posted by Jared Bunting <ja...@peachjean.com>.
Whoops.  Looks like I typoed.  Just spell the classname correctly, should
fix it right up.
On Jun 12, 2012 7:07 PM, "Diogo Guerra" <di...@gmail.com> wrote:

> Hi,
>
> I'm getting this error initiating shiro. But shiro-web is in the
> classpath...
>
> org.apache.shiro.config.ConfigurationException: Unable to instantiate
> class [org.apache.shiro.web.session.mgt.DefaultWebSessioManager] for object
> named 'sessionManager'.  Please ensure you've specified the fully qualified
> class name correctly.
>                           at
> org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:148)
>                           at
> org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:119)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:170)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:119)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:97)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:83)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:41)
>                           at
> org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
>                           at
> org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
>
>
> My configuration is:
>
> [main]
> securityManager = org.apache.shiro.web.mgt.DefaultWebSecurityManager
>
> ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
> ssoCacheManager.cacheManagerConfigFile = conf/engine/shiro/ehcache.xml
> securityManager.cacheManager = $ssoCacheManager
>
> securityManager.sessionMode = native
>
> sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessioManager
> securityManager.sessionManager=$sessionManager
>
> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
> securityManager.sessionManager.sessionDAO = $sessionDAO
>
> cookie = org.apache.shiro.web.servlet.SimpleCookie
> cookie.name = SSOcookie
> cookie.path = /
> securityManager.sessionManager.sessionIdCookie = $cookie
>
> Am I missing anything?
>
> --Diogo
>
>
> On Wed, Jun 13, 2012 at 12:42 AM, Jared Bunting <
> jared.bunting@peachjean.com> wrote:
>
>> Try:
>>
>> sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessioManager
>> securityManager.sessionManager=$sessionManager
>>
>> -Jared
>> On Jun 12, 2012 5:41 PM, "Diogo Guerra" <di...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> We are using Shiro to manage security in our application server. The
>>> application server also has a web server.
>>>
>>> The way we had implemented in the previous version was using native
>>> sessions in order to share all the sessions being from a web application or
>>> not.
>>>
>>> (this is our shiro.ini)
>>>
>>> [main]
>>> securityManager = org.apache.shiro.web.mgt.DefaultWebSecurityManager
>>> # Cache for single sign on
>>> ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
>>> ssoCacheManager.cacheManagerConfigFile = conf/engine/shiro/ehcache.xml
>>> securityManager.cacheManager = $ssoCacheManager
>>>
>>> # native for single sign on
>>> securityManager.sessionMode = native
>>>
>>> # DAO for single sign on
>>> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
>>> securityManager.sessionManager.sessionDAO = $sessionDAO
>>>
>>> # cookie for single sign on
>>> cookie = org.apache.shiro.web.servlet.SimpleCookie
>>> cookie.name = SSOcookie
>>> cookie.path = /
>>> securityManager.sessionManager.sessionIdCookie = $cookie
>>>
>>>
>>> Since shiro 1.2.0 we have being notified with the following message:
>>>
>>>          ! 12-Jun 23:39:26 DefaultWebSecurityManager.setSessionMode:114
>>>    The 'sessionMode' property has been deprecated.  Please configure an
>>> appropriate WebSessionManager instance instead of using
>>> this property.  This property/method will be removed in a later version.
>>>
>>> I've been looking in the documentation but I'm not certain of how to
>>> achieve this...
>>>
>>> Any help?
>>>
>>> --Diogo
>>>
>>>
>

Re: DefaultWebSecurityManager.setSessionMode has been deprecated

Posted by Diogo Guerra <di...@gmail.com>.
Hi,

Thanks, I've managed to fix the problem.

Cheers,

--Diogo


On Thu, Jun 14, 2012 at 2:18 AM, drmike01 <ms...@gmail.com> wrote:

> Where in the .ini parsing does that error get generated?  My only thought
> is
> that maybe it requires the SessionDAO when it initiates the cache (I could
> be wrong on that, though).
>
> Also, you can and should completely remove the sessionMode=native piece,
> that's implied when you use the DefaultWebSessionManager.
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/DefaultWebSecurityManager-setSessionMode-has-been-deprecated-tp7577499p7577507.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>

Re: DefaultWebSecurityManager.setSessionMode has been deprecated

Posted by drmike01 <ms...@gmail.com>.
Where in the .ini parsing does that error get generated?  My only thought is
that maybe it requires the SessionDAO when it initiates the cache (I could
be wrong on that, though).

Also, you can and should completely remove the sessionMode=native piece,
that's implied when you use the DefaultWebSessionManager.

--
View this message in context: http://shiro-user.582556.n2.nabble.com/DefaultWebSecurityManager-setSessionMode-has-been-deprecated-tp7577499p7577507.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: DefaultWebSecurityManager.setSessionMode has been deprecated

Posted by Diogo Guerra <di...@gmail.com>.
Hi,

Sorry for the typo, that was the problem (for now...)

After fixing the typo the error is diferent:

Property 'sessionManager.sessionDAO' does not exist for object of type
org.apache.shiro.web.mgt.DefaultWebSecurityManager

Thanks

--Diogo


On Wed, Jun 13, 2012 at 1:07 AM, Diogo Guerra <di...@gmail.com> wrote:

> Hi,
>
> I'm getting this error initiating shiro. But shiro-web is in the
> classpath...
>
> org.apache.shiro.config.ConfigurationException: Unable to instantiate
> class [org.apache.shiro.web.session.mgt.DefaultWebSessioManager] for object
> named 'sessionManager'.  Please ensure you've specified the fully qualified
> class name correctly.
>                           at
> org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:148)
>                           at
> org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:119)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:170)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:119)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:97)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:83)
>                           at
> org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:41)
>                           at
> org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
>                           at
> org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)
>
>
> My configuration is:
>
> [main]
> securityManager = org.apache.shiro.web.mgt.DefaultWebSecurityManager
>
> ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
> ssoCacheManager.cacheManagerConfigFile = conf/engine/shiro/ehcache.xml
> securityManager.cacheManager = $ssoCacheManager
>
> securityManager.sessionMode = native
>
> sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessioManager
>  securityManager.sessionManager=$sessionManager
>
> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
> securityManager.sessionManager.sessionDAO = $sessionDAO
>
> cookie = org.apache.shiro.web.servlet.SimpleCookie
> cookie.name = SSOcookie
> cookie.path = /
> securityManager.sessionManager.sessionIdCookie = $cookie
>
> Am I missing anything?
>
> --Diogo
>
>
>
> On Wed, Jun 13, 2012 at 12:42 AM, Jared Bunting <
> jared.bunting@peachjean.com> wrote:
>
>> Try:
>>
>> sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessioManager
>> securityManager.sessionManager=$sessionManager
>>
>> -Jared
>> On Jun 12, 2012 5:41 PM, "Diogo Guerra" <di...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> We are using Shiro to manage security in our application server. The
>>> application server also has a web server.
>>>
>>> The way we had implemented in the previous version was using native
>>> sessions in order to share all the sessions being from a web application or
>>> not.
>>>
>>> (this is our shiro.ini)
>>>
>>> [main]
>>> securityManager = org.apache.shiro.web.mgt.DefaultWebSecurityManager
>>> # Cache for single sign on
>>> ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
>>> ssoCacheManager.cacheManagerConfigFile = conf/engine/shiro/ehcache.xml
>>> securityManager.cacheManager = $ssoCacheManager
>>>
>>> # native for single sign on
>>> securityManager.sessionMode = native
>>>
>>> # DAO for single sign on
>>> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
>>> securityManager.sessionManager.sessionDAO = $sessionDAO
>>>
>>> # cookie for single sign on
>>> cookie = org.apache.shiro.web.servlet.SimpleCookie
>>> cookie.name = SSOcookie
>>> cookie.path = /
>>> securityManager.sessionManager.sessionIdCookie = $cookie
>>>
>>>
>>> Since shiro 1.2.0 we have being notified with the following message:
>>>
>>>          ! 12-Jun 23:39:26 DefaultWebSecurityManager.setSessionMode:114
>>>    The 'sessionMode' property has been deprecated.  Please configure an
>>> appropriate WebSessionManager instance instead of using
>>> this property.  This property/method will be removed in a later version.
>>>
>>> I've been looking in the documentation but I'm not certain of how to
>>> achieve this...
>>>
>>> Any help?
>>>
>>> --Diogo
>>>
>>>
>

Re: DefaultWebSecurityManager.setSessionMode has been deprecated

Posted by Diogo Guerra <di...@gmail.com>.
Hi,

I'm getting this error initiating shiro. But shiro-web is in the
classpath...

org.apache.shiro.config.ConfigurationException: Unable to instantiate class
[org.apache.shiro.web.session.mgt.DefaultWebSessioManager] for object named
'sessionManager'.  Please ensure you've specified the fully qualified class
name correctly.
                          at
org.apache.shiro.config.ReflectionBuilder.createNewInstance(ReflectionBuilder.java:148)
                          at
org.apache.shiro.config.ReflectionBuilder.buildObjects(ReflectionBuilder.java:119)
                          at
org.apache.shiro.config.IniSecurityManagerFactory.buildInstances(IniSecurityManagerFactory.java:170)
                          at
org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:119)
                          at
org.apache.shiro.config.IniSecurityManagerFactory.createSecurityManager(IniSecurityManagerFactory.java:97)
                          at
org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:83)
                          at
org.apache.shiro.config.IniSecurityManagerFactory.createInstance(IniSecurityManagerFactory.java:41)
                          at
org.apache.shiro.config.IniFactorySupport.createInstance(IniFactorySupport.java:123)
                          at
org.apache.shiro.util.AbstractFactory.getInstance(AbstractFactory.java:47)


My configuration is:

[main]
securityManager = org.apache.shiro.web.mgt.DefaultWebSecurityManager

ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
ssoCacheManager.cacheManagerConfigFile = conf/engine/shiro/ehcache.xml
securityManager.cacheManager = $ssoCacheManager

securityManager.sessionMode = native

sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessioManager
securityManager.sessionManager=$sessionManager

sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
securityManager.sessionManager.sessionDAO = $sessionDAO

cookie = org.apache.shiro.web.servlet.SimpleCookie
cookie.name = SSOcookie
cookie.path = /
securityManager.sessionManager.sessionIdCookie = $cookie

Am I missing anything?

--Diogo


On Wed, Jun 13, 2012 at 12:42 AM, Jared Bunting <jared.bunting@peachjean.com
> wrote:

> Try:
>
> sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessioManager
> securityManager.sessionManager=$sessionManager
>
> -Jared
> On Jun 12, 2012 5:41 PM, "Diogo Guerra" <di...@gmail.com> wrote:
>
>> Hi all,
>>
>> We are using Shiro to manage security in our application server. The
>> application server also has a web server.
>>
>> The way we had implemented in the previous version was using native
>> sessions in order to share all the sessions being from a web application or
>> not.
>>
>> (this is our shiro.ini)
>>
>> [main]
>> securityManager = org.apache.shiro.web.mgt.DefaultWebSecurityManager
>> # Cache for single sign on
>> ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
>> ssoCacheManager.cacheManagerConfigFile = conf/engine/shiro/ehcache.xml
>> securityManager.cacheManager = $ssoCacheManager
>>
>> # native for single sign on
>> securityManager.sessionMode = native
>>
>> # DAO for single sign on
>> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
>> securityManager.sessionManager.sessionDAO = $sessionDAO
>>
>> # cookie for single sign on
>> cookie = org.apache.shiro.web.servlet.SimpleCookie
>> cookie.name = SSOcookie
>> cookie.path = /
>> securityManager.sessionManager.sessionIdCookie = $cookie
>>
>>
>> Since shiro 1.2.0 we have being notified with the following message:
>>
>>          ! 12-Jun 23:39:26 DefaultWebSecurityManager.setSessionMode:114
>>  The 'sessionMode' property has been deprecated.  Please configure an
>> appropriate WebSessionManager instance instead of using
>> this property.  This property/method will be removed in a later version.
>>
>> I've been looking in the documentation but I'm not certain of how to
>> achieve this...
>>
>> Any help?
>>
>> --Diogo
>>
>>

Re: DefaultWebSecurityManager.setSessionMode has been deprecated

Posted by Jared Bunting <ja...@peachjean.com>.
Try:

sessionManager=org.apache.shiro.web.session.mgt.DefaultWebSessioManager
securityManager.sessionManager=$sessionManager

-Jared
On Jun 12, 2012 5:41 PM, "Diogo Guerra" <di...@gmail.com> wrote:

> Hi all,
>
> We are using Shiro to manage security in our application server. The
> application server also has a web server.
>
> The way we had implemented in the previous version was using native
> sessions in order to share all the sessions being from a web application or
> not.
>
> (this is our shiro.ini)
>
> [main]
> securityManager = org.apache.shiro.web.mgt.DefaultWebSecurityManager
> # Cache for single sign on
> ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
> ssoCacheManager.cacheManagerConfigFile = conf/engine/shiro/ehcache.xml
> securityManager.cacheManager = $ssoCacheManager
>
> # native for single sign on
> securityManager.sessionMode = native
>
> # DAO for single sign on
> sessionDAO = org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO
> securityManager.sessionManager.sessionDAO = $sessionDAO
>
> # cookie for single sign on
> cookie = org.apache.shiro.web.servlet.SimpleCookie
> cookie.name = SSOcookie
> cookie.path = /
> securityManager.sessionManager.sessionIdCookie = $cookie
>
>
> Since shiro 1.2.0 we have being notified with the following message:
>
>          ! 12-Jun 23:39:26 DefaultWebSecurityManager.setSessionMode:114
>  The 'sessionMode' property has been deprecated.  Please configure an
> appropriate WebSessionManager instance instead of using
> this property.  This property/method will be removed in a later version.
>
> I've been looking in the documentation but I'm not certain of how to
> achieve this...
>
> Any help?
>
> --Diogo
>
>