You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by Dan Tran <da...@gmail.com> on 2011/10/08 19:31:27 UTC

Need help to debug shiro-ehcache with my JSF2/Spring app

Hi

I follow the instructions from shiro to integrate my
standalone/nocluster JSF2/spring app. Configuration run fine, except
where after successful login, it kicks me back to login page when I
attempt to navigate to other page. In summary:

Shiro able to forward me to the configured login page, after
successfully logon, it forwards me the first page, and that is it.

Tips on how to trouble shoot this is issue is very much appreciated

Note before the integration, everything works exception seeing 'No
cache or cacheManager properties have been set.  Authorization cache
cannot be obtained.
No cache or cacheManager properties have been set.  Authorization
cache cannot be obtained.' in the log.

Thanks

Here is my spring  config

  <bean id="sessionDAO"
class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO"/>
  <bean id="cacheManager"
class="org.apache.shiro.cache.ehcache.EhCacheManager"/>

  <bean id="sessionManager"
class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager" >
    <property name="globalSessionTimeout" value="1800000" />
    <property name="sessionDAO" ref="sessionDAO" />
    <property name="cacheManager" ref="cacheManager" />
  </bean>
  <bean id="securityManager"
class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">

    <property name="realms" ref="realms" />

    <property name="sessionManager" ref="sessionManager" />

  </bean>

  <bean id="lifecycleBeanPostProcessor"
class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />

  <bean id="shiroFilter"
class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">

    <property name="securityManager" ref="securityManager" />

    <!-- override these for application-specific URLs if you like: -->
    <property name="loginUrl" value="/login/login.jsf" />
    <property name="successUrl" value="/dashboard/dashboard.jsf" />
    <property name="unauthorizedUrl" value="/dashboard/dashboardNoAccess.jsf" />

    <property name="filterChainDefinitions">
      <value>
        <!-- 'first match wins' for url pattern matching -->
        /javax.faces.resource/** = anon
        /resources/** = anon
        /login/login.jsf = authc
        /userManagement/** = authc, perms[ADMIN]
        /config/** = authc, perms[ADMIN]
        /backup/** = authc, perms[ADMIN]
        /target/** = authc, perms[TARGET_WRITE]
        /batch/** = authc, perms[TARGET_WRITE]
        /** = authc
      </value>
    </property>
  </bean>

  <bean id="realms" class="java.util.HashSet">
    <constructor-arg>
      <set>
        <ref bean="localRealm" />
      </set>
    </constructor-arg>
  </bean>