2 Replies Latest reply on Nov 20, 2010 2:51 AM by jbossuser71

    Spring security and JBoss EAP 5.0

    mentus

      Hello everyone,

      I'm migrating my J2EE application from JBoss 4.2.2 under JBoss EAP 5.0.
      I'm using the same configuration spring security, in my login-config.xml is:

      <application-policy name="my_app">
           <authentication>
           <login-module code="org.acegisecurity.adapters.jboss.JbossAcegiLoginModule" flag="required">
                <module-option name = "appContextLocation">WEB-INF/applicationContext-auth.xml</module-option>
                <module-option name="key">password</module-option>
           </login-module>                    
           </authentication>
      </application-policy>
      

      and when I try login to application, I don't have any exceptions, only report:

      14:19:53,916 INFO  [JbossAcegiLoginModule] initializing jboss login module
      14:19:53,917 INFO  [JbossAcegiLoginModule] cannot locate WEB-INF/applicationContext-auth.xml
      

      But my applicationContext-auth.xml there is in  WEB-INF directory
      Anyone of you use spring seciurity under JBoss EAP 5.0?

      Thanks for your help.

        • 1. Re: Spring security and JBoss EAP 5.0
          mentus

          Solved.
          I had to move my applicationContext-auth.xml into  JBOSS_HOME/server/[config]/conf directory. Now, it works fine.

          Cheers.

          • 2. Re: Spring security and JBoss EAP 5.0
            jbossuser71

            Hi Jan,

            I am very new to JBoss. I am using JBoss 5.1 GA App server with Spring Security 3.

             

            Can you pls. tell me what kind of configuration changes need to made in JBoss so that I can use Spring Security instead of JAAS?

            My EAR deploys fine but when I try to access an EJB from web layer, I always get this error.

             

            =====================

            Caused by: java.lang.NullPointerException
                    at org.jboss.ejb3.security.helpers.EJBContextHelper.getCallerPrincipal(EJBContextHelper.java:99)
                    at org.jboss.ejb3.EJBContextImpl.getCallerPrincipal(EJBContextImpl.java:136)

             

             

            Thanks a lot in advance,