2 Replies Latest reply on Jul 5, 2011 6:25 AM by willstrong

    java.lang.IllegalStateException: Authorization Manager is null jboss6.0.0.M1

    willstrong

      20:24:39,406 ERROR [CoyoteAdapter] An exception or error occurred in the container during the request processing

      java.lang.IllegalStateException: Authorization Manager is null

          at org.jboss.security.plugins.javaee.WebAuthorizationHelper.hasUserDataPermission(WebAuthorizationHelper.java:185)

          at org.jboss.web.tomcat.security.JBossWebRealm.hasUserDataPermission(JBossWebRealm.java:644)

          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:461)

          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

          at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

          at java.lang.Thread.run(Thread.java:619)

       

       

       

      my login-config.xml and jboss-web.xml and web.xml file like this:

       

      login-config.xml

      <application-policy name = "testLoginModule">
         <authentication>
            <login-module code = "com.ben.common.security.LoginModule"
               flag = "required">
               <module-option name = "dsJndiName">java:/testds</module-option>
               <module-option name = "principalsQuery">SELECT PASSWORD FROM USERS WHERE LOGINID=?</module-option>
               <module-option name = "rolesQuery">SELECT ROLE ROLENAME,'Roles' FROM USER_ROLE WHERE LOGINID=?</module-option>
               <module-option name="hashAlgorithm">MD5</module-option>
         <module-option name="hashEncoding">base64</module-option>
         <module-option name="loginBo">com.ben.org.business.LoginBo</module-option>       
            </login-module>
         </authentication>
      </application-policy> 

       

      jboss-web.xml

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

      <jboss-web>

        <!-- Uncomment the security-domain to enable security. You will

            need to edit the htmladaptor login configuration to setup the

            login modules used to authentication users.

         -->

      <!-- 下面的nccnm就是在login-config.xml配置的application-policy的名称 -->

         <security-domain flushOnSessionInvalidation="true">java:/jaas/testLoginModule</security-domain>

      </jboss-web>

      web.xml

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

      <web-app version="2.5"

          xmlns="http://java.sun.com/xml/ns/javaee"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

         

           <security-constraint>

          <web-resource-collection>

            <web-resource-name>login required</web-resource-name>

            <url-pattern>*.jsp</url-pattern>

            <url-pattern>*.htm</url-pattern>

            <url-pattern>*.html</url-pattern>

            <url-pattern>*.do</url-pattern>

          </web-resource-collection>

          <auth-constraint>

            <role-name>role1</role-name>

          </auth-constraint>

      </security-constraint>

      <login-config>

             <!-- 通过表单方式来提交登录 -->

          <auth-method>FORM</auth-method>

          <realm-name>mydomain</realm-name>  

      <form-login-config>

             <!-- 登录页面为login.jsp -->

            <form-login-page>/login.jsp</form-login-page>

                  

                    <!--登录出错的话转到error.jsp页面 -->

            <form-error-page>/error.jsp</form-error-page>

          </form-login-config>

      </login-config>

      <security-role>

          <role-name>role1</role-name>

      </security-role>

         

        <welcome-file-list>

          <welcome-file>index.jsp</welcome-file>

        </welcome-file-list>

      </web-app>

       

      D:\jboss-6.0.0.M1\server\default\deploy\oracle-ds.xml

       


      <datasources>

       

        <local-tx-datasource>

          <jndi-name>testds</jndi-name>

             <connection-url>jdbc:oracle:thin:@127.0.0.1:1521:Oracle01</connection-url>   

          <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

          <user-name>willstrong</user-name>

          <password>qwer1234</password>

          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

            <metadata>

               <type-mapping>Oracle9i</type-mapping>

            </metadata>

        </local-tx-datasource>

       

      </datasources>

       

      thank you all the same!!!

        • 1. Re: java.lang.IllegalStateException: Authorization Manager is null jboss6.0.0.M1
          jfclere
          • 2. Re: java.lang.IllegalStateException: Authorization Manager is null jboss6.0.0.M1
            willstrong

            but I config the same code ,the exception is came out again!!

             

            18:21:10,421 ERROR [CoyoteAdapter] An exception or error occurred in the container during the request processing

            java.lang.IllegalStateException: Authorization Manager is null

                at org.jboss.security.plugins.javaee.WebAuthorizationHelper.hasUserDataPermission(WebAuthorizationHelper.java:185)

                at org.jboss.web.tomcat.security.JBossWebRealm.hasUserDataPermission(JBossWebRealm.java:644)

                at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:461)

                at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)

                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)

                at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)

                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

                at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)

                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)

                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)

                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)

                at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

                at java.lang.Thread.run(Thread.java:619)