Hi all,
    I was trying my first step with shiro, without any luck. Despite I set
up web.xml shiro says that no SecurityManager has been set.

I decided to add these lines to my code to make SecurityManager
sessionable....

    @Override protected void onBeginRequest() {

     super.onBeginRequest();

     ThreadContext.bind(new org.apache.shiro.web.DefaultWebSecurityManager(
new MyRealm()));

    }

    @Override protected void onEndRequest() {

     super.onEndRequest();

     ThreadContext.unbindSecurityManager();

    }


Now I get a


java.lang.IllegalStateException: ServletRequest is not available! A
ServletRequest must be present in either the Subject context map, on an
existing WebSubject or via the thread context. This exception is probably
indicative of an erroneous application configuration.
at
org.apache.shiro.web.mgt.DefaultWebSubjectFactory.getServletRequest(DefaultWebSubjectFactory.java:67)
at
org.apache.shiro.web.mgt.DefaultWebSubjectFactory.getHost(DefaultWebSubjectFactory.java:103)


I suppose that the session is bind in shiroFilter, but It doesnt seem the
case

My Shiro Filter....



<!-- SHIRO FILTER -->

    <filter>

        <filter-name>ShiroFilter</filter-name>

        <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class
>

        <init-param>

           <param-name>config</param-name>

           <param-value>

 [main]

 realmA = com.misPartidos.web.MyRealm

           </param-value>

        </init-param>

    </filter>


  <filter-mapping>

   <filter-name>ShiroFilter</filter-name>

    <url-pattern>/*</url-pattern>

  </filter-mapping>



As I dont know spring I couldnt understand the example given enogh .


Thank in advance

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus

Reply via email to