Announcement Announcement Module
Collapse
No announcement yet.
Acegi works under JBoss, but not Websphere??? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Acegi works under JBoss, but not Websphere???

    I have been developing under JBoss and everything is working fine with Acegi, but when I deploy to WebSphere 5.1 I get and filter unavailable error:

    Error Message: Filter [Acegi Filter Chain Proxy]: filter is unavailable.
    Error Code: 500
    Target Servlet: null
    Error Stack:
    java.lang.NullPointerException
    at net.sf.acegisecurity.ui.session.HttpSessionEventPu blisher.sessionCreated(HttpSessionEventPublisher.j ava(Compiled Code))

    Error Page Exception:
    Error Message: Server caught unhandled exception from servlet [gpm]: null
    Error Code: 0
    Target Servlet: null
    Error Stack:
    java.lang.NullPointerException
    at net.sf.acegisecurity.ui.session.HttpSessionEventPu blisher.sessionCreated(HttpSessionEventPublisher.j ava(Compiled Code))
    at com.ibm.ws.webcontainer.httpsession.SessionContext .sessionCreatedEvent(SessionContext.java(Compiled Code))
    at com.ibm.ws.webcontainer.httpsession.SessionContext .createSession(SessionContext.java(Compiled Code))
    at com.ibm.ws.webcontainer.httpsession.SessionContext .getIHttpSession(SessionContext.java(Compiled Code))
    at com.ibm.ws.webcontainer.webapp.WebAppDispatcherCon text.getSession(WebAppDispatcherContext.java(Compi led Code))
    at com.ibm.ws.webcontainer.srt.SRTServletRequestConte xt.getSession(SRTServletRequestContext.java(Inline d Compiled Code))
    at com.ibm.ws.webcontainer.srt.SRTServletRequest.getS ession(SRTServletRequest.java(Inlined Compiled Code))
    at com.ibm.ws.webcontainer.srt.SRTServletRequest.getS ession(SRTServletRequest.java(Compiled Code))
    at org.apache.struts.action.RequestProcessor.processL ocale(RequestProcessor.java:602)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:179)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1164)
    at org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:397)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java(Compiled Code))
    at javax.servlet.http.HttpServlet.service(HttpServlet .java(Compiled Code))


    I have checked and it looks like it can find all the classes that it needs to. Any ideas?

  • #2
    Without line numbers it's really hard to tell. The HttpSessionEventPublisher is a relatively simple class that listens to the HttpSessionEvents and translates them into Spring ApplicationEvents. Off the top of my head, the only potential null pointer would be to the ApplicationContext itself. Meaning something may be wrong with the Spring webapp configuration.

    Are you using the Spring ContextLoaderListener, and is it properly configured? I'm sort of shooting in the dark though...

    Comment


    • #3
      web.xml snippet

      Yes I am using the ContextLoaderListener:

      <context-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>
      /WEB-INF/acegispring-authorization.xml,
      /WEB-INF/acegispring-security.xml,
      /WEB-INF/spring-context/spring-admin-context.xml,
      /WEB-INF/spring-context/spring-bac-context.xml,
      /WEB-INF/spring-context/spring-common-context.xml,
      /WEB-INF/spring-context/spring-locator-context.xml,
      /WEB-INF/spring-context/spring-menu-context.xml ,
      /WEB-INF/spring-context/spring-property-context.xml
      </param-value>
      </context-param>


      <listener>
      <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
      </listener>

      Which lines numbers do you want to see?

      Comment


      • #4
        Specifically, I'd like to see the line number in HttpSessionEventPublisher that causes the NullPointerException.

        Comment


        • #5
          line number

          java.lang.NullPointerException
          at net.sf.acegisecurity.ui.session.HttpSessionEventPu blisher.sessionCreated(HttpSessionEventPublisher.j ava:90)
          at com.ibm.ws.webcontainer.httpsession.SessionContext .sessionCreatedEvent(SessionContext.java:2903)
          at com.ibm.ws.webcontainer.httpsession.SessionContext .createSession(SessionContext.java:901)
          at com.ibm.ws.webcontainer.httpsession.SessionContext .getIHttpSession(SessionContext.java:2292)
          at com.ibm.ws.webcontainer.webapp.WebAppDispatcherCon text.getSession(WebAppDispatcherContext.java(Compi led Code))
          at com.ibm.ws.webcontainer.srt.SRTServletRequestConte xt.getSession(SRTServletRequestContext.java(Inline d Compiled Code))
          at com.ibm.ws.webcontainer.srt.SRTServletRequest.getS ession(SRTServletRequest.java(Inlined Compiled Code))
          at com.ibm.ws.webcontainer.srt.SRTServletRequest.getS ession(SRTServletRequest.java(Compiled Code))
          at org.apache.struts.action.RequestProcessor.processL ocale(RequestProcessor.java:602)
          at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:179)
          at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1164)
          at org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:397)
          at javax.servlet.http.HttpServlet.service(HttpServlet .java:740)
          at javax.servlet.http.HttpServlet.service(HttpServlet .java(Compiled Code))
          at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java(Compiled Code))
          at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java(Compiled Code))
          at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:313)
          at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
          at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java(Compiled Code))
          at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java( Compiled Code))
          at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java(Comp iled Code))
          at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:76)
          at org.displaytag.filter.ResponseOverrideFilter.doFil ter(ResponseOverrideFilter.java:125)
          at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:132)
          at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:71)
          at org.springframework.orm.hibernate.support.OpenSess ionInViewFilter.doFilterInternal(OpenSessionInView Filter.java:171)
          at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
          at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:132)
          at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:71)
          at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java(Compiled Code))
          at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java(Compile d Code))
          at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:200)
          at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForwar d(WebAppInvoker.java:119)
          at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleIn vocationHook(WebAppInvoker.java:276)
          at com.ibm.ws.webcontainer.cache.invocation.CachedInv ocation.handleInvocation(CachedInvocation.java:71)
          at com.ibm.ws.webcontainer.cache.invocation.Cacheable InvocationContext.invoke(CacheableInvocationContex t.java:114)
          at com.ibm.ws.webcontainer.srp.ServletRequestProcesso r.dispatchByURI(ServletRequestProcessor.java:186)
          at com.ibm.ws.webcontainer.oselistener.OSEListenerDis patcher.service(OSEListener.java:334)
          at com.ibm.ws.webcontainer.http.HttpConnection.handle Request(HttpConnection.java:56)
          at com.ibm.ws.http.HttpConnection.readAndHandleReques t(HttpConnection.java(Compiled Code))
          at com.ibm.ws.http.HttpConnection.run(HttpConnection. java(Compiled Code))
          at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava(Compiled Code))

          Comment


          • #6
            Sorry, one more question, what version of Acegi is it?

            Comment


            • #7
              version 0.8.1

              Version 0.8.1 I was just going to upgrade it to 0.8.2 to see if it makes any difference.

              Thanks for all the quick replies!

              Comment


              • #8
                Wow...
                First, the line number is off by one, wich is odd. Line 90 is a brace :P

                Anyway, the version was a dumb question, the HttpSessionEventPublisher hasn't been modified since it was commited....

                http://cvs.sourceforge.net/viewcvs.p...Publisher.java

                I can only assume it's really line 89, and the context is null somehow. I have absolutely no idea why though. Unless the WebApplicationContextUtils.getRequiredWebApplicati onContext isn't working correctly.

                Comment


                • #9
                  Spring version?

                  I am using Spring version 1.1.4 Think that could be a problem?

                  Comment


                  • #10
                    Same error message

                    I am using Spring 1.2-rc2 Acegi 0.8.2. Here is the error message:

                    Original Exception:
                    Error Message: Filter [AcegiFilterChainProxy]: filter is unavailable.
                    Error Code: 500
                    Target Servlet: null
                    Error Stack:
                    java.lang.NullPointerException
                    at net.sf.acegisecurity.ui.session.HttpSessionEventPu blisher.sessionCreated(HttpSessionEventPublisher.j ava:89)
                    at com.ibm.ws.webcontainer.httpsession.SessionContext .sessionCreatedEvent(SessionContext.java:2903)
                    at com.ibm.ws.webcontainer.httpsession.SessionContext .createSession(SessionContext.java:901)
                    at com.ibm.ws.webcontainer.httpsession.SessionContext .getIHttpSession(SessionContext.java:2292)
                    at com.ibm.ws.webcontainer.webapp.WebAppDispatcherCon text.getSession(WebAppDispatcherContext.java:178)
                    at com.ibm.ws.webcontainer.srt.SRTServletRequestConte xt.getSession(SRTServletRequestContext.java:211)
                    at com.ibm.ws.webcontainer.srt.SRTServletRequest.getS ession(SRTServletRequest.java:664)
                    at com.ibm.ws.webcontainer.srt.SRTServletRequest.getS ession(SRTServletRequest.java:655)
                    at net.sf.acegisecurity.intercept.web.SecurityEnforce mentFilter.sendStartAuthentication(SecurityEnforce mentFilter.java:254)
                    at net.sf.acegisecurity.intercept.web.SecurityEnforce mentFilter.doFilter(SecurityEnforcementFilter.java :202)
                    at net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:303)
                    at net.sf.acegisecurity.providers.anonymous.Anonymous ProcessingFilter.doFilter(AnonymousProcessingFilte r.java:153)
                    at net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:303)
                    at net.sf.acegisecurity.ui.basicauth.BasicProcessingF ilter.doFilter(BasicProcessingFilter.java:206)
                    at net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:303)
                    at net.sf.acegisecurity.ui.AbstractProcessingFilter.d oFilter(AbstractProcessingFilter.java:305)
                    at net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:303)
                    at net.sf.acegisecurity.context.HttpSessionContextInt egrationFilter.doFilter(HttpSessionContextIntegrat ionFilter.java:225)
                    at net.sf.acegisecurity.util.FilterChainProxy$Virtual FilterChain.doFilter(FilterChainProxy.java:303)
                    at net.sf.acegisecurity.util.FilterChainProxy.doFilte r(FilterChainProxy.java:173)
                    at net.sf.acegisecurity.util.FilterToBeanProxy.doFilt er(FilterToBeanProxy.java:125)
                    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:132)
                    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:71)
                    at org.displaytag.filter.ResponseOverrideFilter.doFil ter(ResponseOverrideFilter.java:125)
                    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:132)
                    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:71)
                    at org.springframework.orm.hibernate.support.OpenSess ionInViewFilter.doFilterInternal(OpenSessionInView Filter.java:172)
                    at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
                    at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:132)
                    at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:71)
                    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:965)
                    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:555)
                    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:200)
                    at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForwar d(WebAppInvoker.java:119)
                    at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleIn vocationHook(WebAppInvoker.java:276)
                    at com.ibm.ws.webcontainer.cache.invocation.CachedInv ocation.handleInvocation(CachedInvocation.java:71)
                    at com.ibm.ws.webcontainer.srp.ServletRequestProcesso r.dispatchByURI(ServletRequestProcessor.java:182)
                    at com.ibm.ws.webcontainer.oselistener.OSEListenerDis patcher.service(OSEListener.java:334)
                    at com.ibm.ws.webcontainer.http.HttpConnection.handle Request(HttpConnection.java:56)
                    at com.ibm.ws.http.HttpConnection.readAndHandleReques t(HttpConnection.java:618)
                    at com.ibm.ws.http.HttpConnection.run(HttpConnection. java:439)
                    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:593)



                    Error Page Exception:
                    Error Message: Server caught unhandled exception from servlet [gpm]: null
                    Error Code: 0
                    Target Servlet: null
                    Error Stack:
                    java.lang.NullPointerException
                    at net.sf.acegisecurity.ui.session.HttpSessionEventPu blisher.sessionCreated(HttpSessionEventPublisher.j ava:89)
                    at com.ibm.ws.webcontainer.httpsession.SessionContext .sessionCreatedEvent(SessionContext.java:2903)
                    at com.ibm.ws.webcontainer.httpsession.SessionContext .createSession(SessionContext.java:901)
                    at com.ibm.ws.webcontainer.httpsession.SessionContext .getIHttpSession(SessionContext.java:2292)
                    at com.ibm.ws.webcontainer.webapp.WebAppDispatcherCon text.getSession(WebAppDispatcherContext.java:178)
                    at com.ibm.ws.webcontainer.srt.SRTServletRequestConte xt.getSession(SRTServletRequestContext.java:211)
                    at com.ibm.ws.webcontainer.srt.SRTServletRequest.getS ession(SRTServletRequest.java:664)
                    at com.ibm.ws.webcontainer.srt.SRTServletRequest.getS ession(SRTServletRequest.java:655)
                    at org.apache.struts.action.RequestProcessor.processL ocale(RequestProcessor.java:602)
                    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:179)
                    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1164)
                    at org.apache.struts.action.ActionServlet.doGet(Actio nServlet.java:397)
                    at javax.servlet.http.HttpServlet.service(HttpServlet .java:740)
                    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
                    at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:110)
                    at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:174)
                    at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:313)
                    at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:116)
                    at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:283)
                    at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java: 42)
                    at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:40)
                    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:969)
                    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:555)
                    at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:200)
                    at com.ibm.ws.webcontainer.webapp.WebApp.handleError( WebApp.java:1035)
                    at com.ibm.ws.webcontainer.webapp.WebApp.sendError(We bApp.java:897)
                    at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForwar d(WebAppInvoker.java:185)
                    at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleIn vocationHook(WebAppInvoker.java:276)
                    at com.ibm.ws.webcontainer.cache.invocation.CachedInv ocation.handleInvocation(CachedInvocation.java:71)
                    at com.ibm.ws.webcontainer.srp.ServletRequestProcesso r.dispatchByURI(ServletRequestProcessor.java:182)
                    at com.ibm.ws.webcontainer.oselistener.OSEListenerDis patcher.service(OSEListener.java:334)
                    at com.ibm.ws.webcontainer.http.HttpConnection.handle Request(HttpConnection.java:56)
                    at com.ibm.ws.http.HttpConnection.readAndHandleReques t(HttpConnection.java:618)
                    at com.ibm.ws.http.HttpConnection.run(HttpConnection. java:439)
                    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:593)







                    This is my web.xml:





                    <?xml version="1.0" encoding="UTF-8"?>

                    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">

                    <web-app>

                    <context-param>
                    <param-name>javax.servlet.jsp.jstl.fmt.localizationContex t</param-name>
                    <param-value>ApplicationResources</param-value>
                    </context-param>

                    <context-param>
                    <param-name>contextConfigLocation</param-name>
                    <param-value>
                    /WEB-INF/acegispring-authorization.xml,
                    /WEB-INF/acegispring-security.xml,
                    /WEB-INF/spring-context/spring-admin-context.xml,
                    /WEB-INF/spring-context/spring-bac-context.xml,
                    /WEB-INF/spring-context/spring-common-context.xml,
                    /WEB-INF/spring-context/spring-locator-context.xml,
                    /WEB-INF/spring-context/spring-menu-context.xml ,
                    /WEB-INF/spring-context/spring-property-context.xml
                    </param-value>
                    </context-param>

                    <filter>
                    <filter-name>HibernateFilter</filter-name>
                    <filter-class>org.springframework.orm.hibernate.support.Op enSessionInViewFilter</filter-class>
                    </filter>

                    <filter>
                    <filter-name>AcegiFilterChainProxy</filter-name>
                    <filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
                    <init-param>
                    <param-name>targetClass</param-name>
                    <param-value>net.sf.acegisecurity.util.FilterChainProxy</param-value>
                    </init-param>
                    </filter>

                    <filter-mapping>
                    <filter-name>HibernateFilter</filter-name>
                    <url-pattern>/*</url-pattern>
                    </filter-mapping>

                    <filter-mapping>
                    <filter-name>AcegiFilterChainProxy</filter-name>
                    <url-pattern>/*</url-pattern>
                    </filter-mapping>

                    <listener>
                    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
                    </listener>

                    <listener>
                    <listener-class>org.proj.web.WebAppContextListener</listener-class>
                    </listener>

                    <listener>
                    <listener-class>net.sf.acegisecurity.ui.session.HttpSessionE ventPublisher</listener-class>
                    </listener>

                    <servlet>
                    <servlet-name>gpm</servlet-name>
                    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
                    <init-param>
                    <param-name>config</param-name>
                    <param-value>/WEB-INF/struts-config.xml</param-value>
                    </init-param>
                    <load-on-startup>1</load-on-startup>
                    </servlet>

                    <servlet-mapping>
                    <servlet-name>gpm</servlet-name>
                    <url-pattern>*.do</url-pattern>
                    </servlet-mapping>

                    <session-config>
                    <session-timeout>180</session-timeout>
                    </session-config>

                    <taglib>
                    <taglib-uri>http://jakarta.apache.org/struts/tags-tiles</taglib-uri>
                    <taglib-location>tlds/struts-tiles.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://jakarta.apache.org/struts/tags-html</taglib-uri>
                    <taglib-location>tlds/struts-html.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://jakarta.apache.org/struts/tags-html-el</taglib-uri>
                    <taglib-location>tlds/struts-html-el.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://jakarta.apache.org/struts/tags-bean</taglib-uri>
                    <taglib-location>tlds/struts-bean.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>tlds/struts-layout.tld</taglib-uri>
                    <taglib-location>tlds/struts-layout.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://jakarta.apache.org/struts/tags-logic</taglib-uri>
                    <taglib-location>tlds/struts-logic.tld</taglib-location>
                    </taglib>

                    <taglib>
                    <taglib-uri>http://jakarta.apache.org/struts/tags-template</taglib-uri>
                    <taglib-location>tlds/struts-template.tld</taglib-location>
                    </taglib>

                    <resource-ref id="A134DS">
                    <res-ref-name>jdbc/fmatDataSource</res-ref-name>
                    <res-type>javax.sql.DataSource</res-type>
                    <res-auth>Application</res-auth>
                    <res-sharing-scope>Shareable</res-sharing-scope>
                    </resource-ref>

                    </web-app>




                    And this is the spring configuration file:





                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

                    <beans>

                    <bean id="anonymousAuthenticationProvider" class="net.sf.acegisecurity.providers.anonymous.An onymousAuthenticationProvider">
                    <property name="key"><value>foobar</value></property>
                    </bean>

                    <bean id="anonymousProcessingFilter" class="net.sf.acegisecurity.providers.anonymous.An onymousProcessingFilter">
                    <property name="key"><value>foobar</value></property>
                    <property name="userAttribute"><value>anonymousUser,ROLE_ANO NYMOUS</value></property>
                    </bean>

                    <bean id="authenticationProcessingFilter" class="net.sf.acegisecurity.ui.webapp.Authenticati onProcessingFilter">
                    <property name="authenticationManager"><ref bean="authenticationManager"/></property>
                    <property name="authenticationFailureUrl"><value>/security/login.jsp?login_error=1</value></property>
                    <property name="defaultTargetUrl"><value>/gpm/index.jsp</value></property>
                    <property name="filterProcessesUrl"><value>/security/j_acegi_security_check</value></property>
                    </bean>

                    <bean id="authenticationManager" class="net.sf.acegisecurity.providers.ProviderMana ger">
                    <property name="providers">
                    <list>
                    <ref bean="authenticationProvider"/>
                    <ref local="anonymousAuthenticationProvider"/>
                    </list>
                    </property>
                    </bean>

                    <bean id="authenticationEntryPoint" class="net.sf.acegisecurity.ui.webapp.Authenticati onProcessingFilterEntryPoint">
                    <property name="loginFormUrl"><value>/security/login.jsp</value></property>
                    <property name="forceHttps"><value>false</value></property>
                    </bean>

                    <bean id="authenticationProvider" class="net.sf.acegisecurity.providers.dao.Password DaoAuthenticationProvider">
                    <property name="passwordAuthenticationDao">
                    <ref bean="ldapAndDaoProvider"/>
                    <!-- <ref bean="inMemoryProviderDao"/>-->
                    </property>
                    <property name="userCache"><ref local="userCache"/></property>
                    </bean>

                    <bean id="basicProcessingFilter" class="net.sf.acegisecurity.ui.basicauth.BasicProc essingFilter">
                    <property name="authenticationManager"><ref local="authenticationManager"/></property>
                    <property name="authenticationEntryPoint"><ref local="basicProcessingFilterEntryPoint"/></property>
                    </bean>

                    <bean id="basicProcessingFilterEntryPoint" class="net.sf.acegisecurity.ui.basicauth.BasicProc essingFilterEntryPoint">
                    <property name="realmName"><value>GPM Realm</value></property>
                    </bean>

                    <bean id="userCacheManager" class="org.springframework.cache.ehcache.EhCacheMa nagerFactoryBean">
                    <property name="configLocation"><value>/WEB-INF/ehcache-spring.xml</value></property>
                    </bean>

                    <bean id="filterChainProxy" class="net.sf.acegisecurity.util.FilterChainProxy" >
                    <property name="filterInvocationDefinitionSource">
                    <value>
                    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
                    PATTERN_TYPE_APACHE_ANT
                    /**=httpSessionContextIntegrationFilter,authenticat ionProcessingFilter,basicProcessingFilter,anonymou sProcessingFilter,securityEnforcementFilter
                    </value>
                    </property>
                    </bean>

                    <!-- Note the order that entries are placed against the objectDefinitionSource is critical.
                    The FilterSecurityInterceptor will work from the top of the list down to the FIRST pattern that matches the request URL.
                    Accordingly, you should place MOST SPECIFIC (ie a/b/c/d.*) expressions first, with LEAST SPECIFIC (ie a/.*) expressions last -->
                    <bean id="filterInvocationInterceptor" class="net.sf.acegisecurity.intercept.web.FilterSe curityInterceptor">
                    <property name="authenticationManager"><ref bean="authenticationManager"/></property>
                    <property name="accessDecisionManager"><ref local="httpRequestAccessDecisionManager"/></property>
                    <property name="objectDefinitionSource">
                    <value>
                    CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
                    PATTERN_TYPE_APACHE_ANT
                    <!-- /index.jsp=ROLE_ANONYMOUS,ROLE_USER,ROLE_SUPERVISOR-->
                    /security/login.jsp*=ROLE_ANONYMOUS,ROLE_USER,ROLE_SUPERVISO R
                    /**=ROLE_USER,ROLE_SUPERVISOR
                    </value>
                    </property>
                    </bean>

                    <bean id="httpRequestAccessDecisionManager" class="net.sf.acegisecurity.vote.AffirmativeBased" >
                    <property name="allowIfAllAbstainDecisions"><value>false</value></property>
                    <property name="decisionVoters">
                    <list>
                    <ref bean="roleVoter"/>
                    </list>
                    </property>
                    </bean>

                    <bean id="httpSessionContextIntegrationFilter" class="net.sf.acegisecurity.context.HttpSessionCon textIntegrationFilter">
                    <property name="context"><value>net.sf.acegisecurity.context .security.SecureContextImpl</value></property>
                    </bean>

                    <bean id="inMemoryProviderDao" class="net.sf.acegisecurity.providers.dao.memory.I nMemoryDaoImpl">
                    <property name="userMap">
                    <value>
                    hansenbk=password,ROLE_SUPERVISOR
                    </value>
                    </property>
                    </bean>

                    <bean id="ldapAndDaoProvider" class="org.lds.ics.base.security.provider.LdapAndD aoAuthenticationDao">
                    <property name="factoryClass" >
                    <value>com.sun.jndi.ldap.LdapCtxFactory</value>
                    </property>
                    <property name="providerUrl" >
                    <value>ldap://10.51.95.193</value>
                    </property>
                    <property name="providerPort" >
                    <value>389</value>
                    </property>
                    <property name="securityPrincipal" >
                    <value>ou=People,o=WH</value>
                    </property>
                    <property name="appAttribute" >
                    <value>FMATUser</value>
                    </property>
                    </bean>

                    <bean id="securityEnforcementFilter" class="net.sf.acegisecurity.intercept.web.Security EnforcementFilter">
                    <property name="filterSecurityInterceptor"><ref local="filterInvocationInterceptor"/></property>
                    <property name="authenticationEntryPoint"><ref local="authenticationEntryPoint"/></property>
                    </bean>

                    <bean id="userCache" class="net.sf.acegisecurity.providers.dao.cache.Eh CacheBasedUserCache">
                    <property name="cache"><ref local="userCacheBackend"/></property>
                    </bean>

                    <bean id="userCacheBackend" class="org.springframework.cache.ehcache.EhCacheFa ctoryBean">
                    <property name="cacheManager">
                    <ref local="userCacheManager"/>
                    </property>

                    <property name="cacheName">
                    <value>userCache</value>
                    </property>
                    </bean>
                    </beans>




                    Thanks,

                    Bryan

                    Comment


                    • #11
                      Websphere and Acegi

                      Is anyone using Acegi with Websphere? I started a different thread because I tried deploying the sample app and it doesn't work with Websphere. Has anyone had luck using Acegi with Webspere period? I have searched the forums and only seen 4 posts other than mine that mention WebSphere. Is there and extra configuration that needs to be made for Websphere???

                      BTW it was the same error message as listed above:

                      Error 500: Filter [Acegi Filter Chain Proxy]: filter is unavailable.

                      Comment


                      • #12
                        Log files

                        Is there anything from the log files that might be helpful other than what I provided?

                        Comment


                        • #13
                          It seems like WebSphere is either not calling the Filter.init(FilterConfig) method, or something is wrong with Spring when it comes to calling WebApplicationContextUtils.

                          If you look at the source for the HttpSessionEventPublisher.init(...) method,
                          http://cvs.sourceforge.net/viewcvs.p...=1.1&view=auto

                          It's pretty straightforward. At line 89 context is null, I'll put in a null check for that later. Right now it seems like something is horribly wrong for it to be null in the first place.

                          The "filter is unavailable" thing is because the HttpSessionEventPublisher caused a NullPointerException. Websphere is telling you it that it's unusable. I have never used Websphere so I have no tips there.

                          Comment


                          • #14
                            OH, hey, if you setup Logging for full DEBUG of Acegi, do you see the debug message from the HttpSessionEventPublisher saying "Using context: blah"?

                            Comment


                            • #15
                              Originally posted by RayKrueger
                              OH, hey, if you setup Logging for full DEBUG of Acegi, do you see the debug message from the HttpSessionEventPublisher saying "Using context: blah"?
                              I haven't done this yet. I am assuming that it is just a configuration in Log4J.properties? Or is there something else that I need to do?

                              Comment

                              Working...
                              X