5 Replies Latest reply on Oct 25, 2002 12:43 PM by Shane

    DatabaseServerLoginModule : principle=null after successful

    Shane Newbie

      Hi

      After reading through a lot of posts, I don't have a solution to this problem. I login succesfully via Login.jsp, using j_security_check. The required jsp displays after accessing a secured stateless session bean.
      This is displayed in the console :-

      12:21:57,322 DEBUG [JBossUserRealm#MySqlDbRealm] authenticating: Name:ldl Password:****
      12:21:57,322 DEBUG [JBossUserRealm#MySqlDbRealm] authenticated: ldl
      12:21:57,322 DEBUG [JBossUserRealm#MySqlDbRealm] JBossUserPrincipal: ldl is in Role: Programme Manag
      er


      When I try to follow a link on this page, I get the following error :-

      12:22:05,954 ERROR [SecurityInterceptor] Authentication exception, principal=null
      12:22:05,954 ERROR [LogInterceptor] EJBException, causedBy:
      java.lang.SecurityException: Authentication exception, principal=null
      at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.ja
      va:173)


      It occurs when execute this line :
      MySessionHome home = (MySessionHome) ServiceLocator.getInstance().getHome("MySession", homeClass)


      Why is this happening? Are my xml files not set up correctly? I am using the DatabaseServerLoginModule - do I need anything else? How do I "keep" the principal for subsequent calls to ejbs for the duration of the session?

      Just another question - what is j_subject and how do you use it?

        • 1. Re: DatabaseServerLoginModule : principle=null after success
          James Moring Newbie

          Post your xml files. web.xml, jbossweb.xml, ejb.xml, jboss.xml.

          • 2. Re: DatabaseServerLoginModule : principle=null after success
            Shane Newbie

            Here are the xml files :

            web.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <!-- edited with XML Spy v4.3 U (http://www.xmlspy.com) by 3.5 Site license for 5 users (RMB Technology) -->
            <!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>
            <display-name>ProofWeb</display-name>
            ProofWeb

            <servlet-name>FrontController</servlet-name>
            <servlet-class>za.co.rmb.proof.controller.FrontController</servlet-class>

            <servlet-mapping>
            <servlet-name>FrontController</servlet-name>
            <url-pattern>/FrontController</url-pattern>
            </servlet-mapping>

            <taglib-uri>Custom</taglib-uri>
            <taglib-location>/WEB-INF/custom.tld</taglib-location>


            <taglib-uri>Standard</taglib-uri>
            <taglib-location>/WEB-INF/c.tld</taglib-location>


            <taglib-uri>Number</taglib-uri>
            <taglib-location>/WEB-INF/numtag.tld</taglib-location>

            <security-constraint>
            <web-resource-collection>
            <web-resource-name>ProofWeb</web-resource-name>
            <url-pattern>/restricted/*</url-pattern>
            <http-method>HEAD</http-method>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
            <http-method>PUT</http-method>
            <http-method>DELETE</http-method>
            </web-resource-collection>
            <auth-constraint>
            <role-name>Business Analyst</role-name>
            <role-name>Developer</role-name>
            <role-name>Finance</role-name>
            <role-name>Project Manager</role-name>
            <role-name>Programme Manager</role-name>
            </auth-constraint>
            <user-data-constraint>
            <transport-guarantee>NONE</transport-guarantee>
            </user-data-constraint>
            </security-constraint>
            <login-config>
            <auth-method>FORM</auth-method>
            <realm-name>MySqlDbRealm</realm-name>
            <form-login-config>
            <form-login-page>/Login.jsp</form-login-page>
            <form-error-page>/LoginError.jsp</form-error-page>
            </form-login-config>
            </login-config>
            <security-role>
            <role-name>Programme Manager</role-name>
            </security-role>
            </web-app>


            jboss-web.xml
            <?xml version='1.0' encoding='UTF-8' ?>

            <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_0.dtd">

            <jboss-web>
            <security-domain>java:/jaas/MySqlDbRealm</security-domain>
            </jboss-web>

            jboss.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd">



            <security-domain>java:/jaas/MySqlDbRealm</security-domain>
            <unauthenticated-principal>nobody</unauthenticated-principal>

            <enterprise-beans>


            <ejb-name>Project</ejb-name>
            <local-jndi-name>ProjectLocal</local-jndi-name>



            <ejb-name>PeopleResource</ejb-name>
            <local-jndi-name>PeopleResourceLocal</local-jndi-name>



            <ejb-name>Task</ejb-name>
            <local-jndi-name>TaskLocal</local-jndi-name>




            <ejb-name>UserSession</ejb-name>
            <jndi-name>UserSession</jndi-name>


            <ejb-name>PeopleResourceSession</ejb-name>
            <jndi-name>PeopleResourceSession</jndi-name>


            <ejb-name>ProjectSession</ejb-name>
            <jndi-name>ProjectSession</jndi-name>


            <ejb-name>TaskSession</ejb-name>
            <jndi-name>TaskSession</jndi-name>


            <ejb-name>TimeSheetSession</ejb-name>
            <jndi-name>TimeSheetSession</jndi-name>


            </enterprise-beans>

            <resource-managers>
            </resource-managers>



            ejb-jar.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

            <ejb-jar >
            <display-name>Generated by XDoclet</display-name>
            <enterprise-beans>

            <!-- Session Beans -->

            <display-name>UserSession</display-name>
            <ejb-name>UserSession</ejb-name>
            UserSessionHome
            UserSession
            <ejb-class>UserSessionBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>



            <display-name>PeopleResourceSession</display-name>
            <ejb-name>PeopleResourceSession</ejb-name>
            PeopleResourceSessionHome
            PeopleResourceSession
            <ejb-class>PeopleResourceSessionBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>



            <display-name>ProjectSession</display-name>
            <ejb-name>ProjectSession</ejb-name>
            ProjectSessionHome
            ProjectSession
            <ejb-class>ProjectSessionBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>



            <display-name>TaskSession</display-name>
            <ejb-name>TaskSession</ejb-name>
            TaskSessionHome
            TaskSession
            <ejb-class>TaskSessionBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>



            <display-name>TimeSheetSession</display-name>
            <ejb-name>TimeSheetSession</ejb-name>
            TimeSheetSessionHome
            TimeSheetSession
            <ejb-class>TimeSheetSessionBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>


            <!--
            To add session beans that you have deployment descriptor info for, add
            a file to your XDoclet merge directory called session-beans.xml that contains
            the markup for those beans.
            -->

            <!-- Entity Beans -->

            <display-name>Project</display-name>
            <ejb-name>Project</ejb-name>
            <local-home>ejb.ProjectLocalHome</local-home>
            ejb.ProjectLocal
            <ejb-class>ejb.ProjectBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.math.BigDecimal</prim-key-class>
            False
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>Project</abstract-schema-name>
            <cmp-field >
            <![CDATA[]]>
            <field-name>id</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>name</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>excoSponsor</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>sponsor</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>departments</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>priority</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>status</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>implementDate</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>expectedDate</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>actualDate</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>constraints</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>expectedStartDate</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>actualStartDate</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>baselineBudget</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>system</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>level</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>methodologyStage</field-name>
            </cmp-field>
            <primkey-field>id</primkey-field>

            <resource-ref >
            <res-ref-name>ProofDS</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>

            <!-- Write a file named ejb-finders-ProjectBean.xml if you want to define extra finders. -->



            <![CDATA[]]>
            <display-name>PeopleResource</display-name>

            <ejb-name>PeopleResource</ejb-name>

            <local-home>ejb.PeopleResourceLocalHome</local-home>
            ejb.PeopleResourceLocal

            <ejb-class>ejb.PeopleResourceBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.math.BigDecimal</prim-key-class>
            False
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>PeopleResource</abstract-schema-name>
            <cmp-field >
            <![CDATA[]]>
            <field-name>id</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>shortName</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>surname</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>name</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>types</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>roles</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>capacity</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>hourlyRate</field-name>
            </cmp-field>
            <primkey-field>id</primkey-field>

            <resource-ref >
            <res-ref-name>ProofDS</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>


            <query-method>
            <method-name>findByShortName</method-name>
            <method-params>
            <method-param>java.lang.String</method-param>
            </method-params>
            </query-method>
            <result-type-mapping>Local</result-type-mapping>
            <ejb-ql><![CDATA[SELECT OBJECT(p) FROM PeopleResource p WHERE p.shortName = ?1]]></ejb-ql>

            <!-- Write a file named ejb-finders-PeopleResourceBean.xml if you want to define extra finders. -->



            <![CDATA[]]>
            <display-name>Task</display-name>

            <ejb-name>Task</ejb-name>

            <local-home>ejb.TaskLocalHome</local-home>
            ejb.TaskLocal

            <ejb-class>ejb.TaskBean</ejb-class>
            <persistence-type>Container</persistence-type>
            <prim-key-class>java.math.BigDecimal</prim-key-class>
            False
            <cmp-version>2.x</cmp-version>
            <abstract-schema-name>Task</abstract-schema-name>
            <cmp-field >
            <![CDATA[]]>
            <field-name>id</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>name</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>description</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>estimatedDuration</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>type</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>reason</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>priority</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>status</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>budgetCost</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>actualCost</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>startDate</field-name>
            </cmp-field>
            <cmp-field >
            <![CDATA[]]>
            <field-name>endDate</field-name>
            </cmp-field>
            <primkey-field>id</primkey-field>

            <resource-ref >
            <res-ref-name>ProofDS</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>

            <!-- Write a file named ejb-finders-TaskBean.xml if you want to define extra finders. -->


            <!--
            To add entity beans that you have deployment descriptor info for, add
            a file to your XDoclet merge directory called entity-beans.xml that contains
            the markup for those beans.
            -->

            <!-- Message Driven Beans -->
            <!--
            To add message driven beans that you have deployment descriptor info for, add
            a file to your XDoclet merge directory called message-driven-beans.xml that contains
            the <message-driven></message-driven> markup for those beans.
            -->

            </enterprise-beans>

            <!-- Relationships -->

            <ejb-relation >
            <ejb-relation-name>Project-Task</ejb-relation-name>

            <ejb-relationship-role >
            <ejb-relationship-role-name>Project-has-Task</ejb-relationship-role-name>
            One
            <relationship-role-source >
            <ejb-name>Project</ejb-name>
            </relationship-role-source>
            <cmr-field >
            <cmr-field-name>tasks</cmr-field-name>
            <cmr-field-type>java.util.Collection</cmr-field-type>
            </cmr-field>
            </ejb-relationship-role>

            <ejb-relationship-role >
            <ejb-relationship-role-name>Task-assigned-to-Project</ejb-relationship-role-name>
            Many
            <relationship-role-source >
            <ejb-name>Task</ejb-name>
            </relationship-role-source>
            </ejb-relationship-role>

            </ejb-relation>
            <ejb-relation >
            <ejb-relation-name>Task-PeopleResource</ejb-relation-name>

            <ejb-relationship-role >
            <ejb-relationship-role-name>Task-has-Resource</ejb-relationship-role-name>
            Many
            <relationship-role-source >
            <ejb-name>Task</ejb-name>
            </relationship-role-source>
            <cmr-field >
            <cmr-field-name>peopleResources</cmr-field-name>
            <cmr-field-type>java.util.Collection</cmr-field-type>
            </cmr-field>
            </ejb-relationship-role>

            <ejb-relationship-role >
            <ejb-relationship-role-name>Resource-assigned-to-Task</ejb-relationship-role-name>
            Many
            <relationship-role-source >
            <ejb-name>PeopleResource</ejb-name>
            </relationship-role-source>
            </ejb-relationship-role>

            </ejb-relation>
            <ejb-relation >
            <ejb-relation-name>Project-Project</ejb-relation-name>

            <ejb-relationship-role >
            <ejb-relationship-role-name>Project-has-Project</ejb-relationship-role-name>
            Many
            <relationship-role-source >
            <ejb-name>Project</ejb-name>
            </relationship-role-source>
            <cmr-field >
            <cmr-field-name>project</cmr-field-name>
            </cmr-field>
            </ejb-relationship-role>

            <ejb-relationship-role >
            <ejb-relationship-role-name>Project-assigned-to-Project</ejb-relationship-role-name>
            One
            <relationship-role-source >
            <ejb-name>Project</ejb-name>
            </relationship-role-source>
            <cmr-field >
            <cmr-field-name>projects</cmr-field-name>
            <cmr-field-type>java.util.Collection</cmr-field-type>
            </cmr-field>
            </ejb-relationship-role>

            </ejb-relation>
            <ejb-relation >
            <ejb-relation-name>Project-PeopleResource</ejb-relation-name>

            <ejb-relationship-role >
            <ejb-relationship-role-name>Project-has-Resource</ejb-relationship-role-name>
            Many
            <relationship-role-source >
            <ejb-name>Project</ejb-name>
            </relationship-role-source>
            <cmr-field >
            <cmr-field-name>peopleResources</cmr-field-name>
            <cmr-field-type>java.util.Collection</cmr-field-type>
            </cmr-field>
            </ejb-relationship-role>

            <ejb-relationship-role >
            <ejb-relationship-role-name>Resource-assigned-to-Project</ejb-relationship-role-name>
            Many
            <relationship-role-source >
            <ejb-name>PeopleResource</ejb-name>
            </relationship-role-source>
            </ejb-relationship-role>

            </ejb-relation>


            <!-- Assembly Descriptor -->
            <assembly-descriptor >
            <security-role>
            <role-name>Business Analyst</role-name>
            </security-role>
            <security-role>
            <role-name>Developer</role-name>
            </security-role>
            <security-role>
            <role-name>Finance</role-name>
            </security-role>
            <security-role>
            <role-name>Project Manager</role-name>
            </security-role>
            <security-role>
            <role-name>Programme Manager</role-name>
            </security-role>
            <method-permission>
            <role-name>Business Analyst</role-name>

            <ejb-name>PeopleResource</ejb-name>
            <method-name>*</method-name>


            <ejb-name>PeopleResourceSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Project</ejb-name>
            <method-name>*</method-name>


            <ejb-name>ProjectSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Task</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TaskSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TimeSheetSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>UserSession</ejb-name>
            <method-name>*</method-name>

            </method-permission>
            <method-permission>
            <role-name>Developer</role-name>

            <ejb-name>PeopleResource</ejb-name>
            <method-name>*</method-name>


            <ejb-name>PeopleResourceSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Project</ejb-name>
            <method-name>*</method-name>


            <ejb-name>ProjectSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Task</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TaskSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TimeSheetSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>UserSession</ejb-name>
            <method-name>*</method-name>

            </method-permission>
            <method-permission>
            <role-name>Finance</role-name>

            <ejb-name>PeopleResource</ejb-name>
            <method-name>*</method-name>


            <ejb-name>PeopleResourceSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Project</ejb-name>
            <method-name>*</method-name>


            <ejb-name>ProjectSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Task</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TaskSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TimeSheetSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>UserSession</ejb-name>
            <method-name>*</method-name>

            </method-permission>
            <method-permission>
            <role-name>Project Manager</role-name>

            <ejb-name>PeopleResource</ejb-name>
            <method-name>*</method-name>


            <ejb-name>PeopleResourceSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Project</ejb-name>
            <method-name>*</method-name>


            <ejb-name>ProjectSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Task</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TaskSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TimeSheetSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>UserSession</ejb-name>
            <method-name>*</method-name>

            </method-permission>
            <method-permission>
            <role-name>Programme Manager</role-name>

            <ejb-name>PeopleResource</ejb-name>
            <method-name>*</method-name>


            <ejb-name>PeopleResourceSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Project</ejb-name>
            <method-name>*</method-name>


            <ejb-name>ProjectSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>Task</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TaskSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>TimeSheetSession</ejb-name>
            <method-name>*</method-name>


            <ejb-name>UserSession</ejb-name>
            <method-name>*</method-name>

            </method-permission>

            <!-- finder permissions -->

            <!-- finder permissions -->

            <!-- finder permissions -->

            <!-- finder permissions -->

            <!-- finder permissions -->

            <!-- finder permissions -->

            <!-- finder permissions -->

            <!-- finder permissions -->

            <!-- transactions -->
            <container-transaction >

            <ejb-name>UserSession</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            <container-transaction >

            <ejb-name>Project</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            <container-transaction >

            <ejb-name>PeopleResourceSession</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            <container-transaction >

            <ejb-name>ProjectSession</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            <container-transaction >

            <ejb-name>PeopleResource</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            <container-transaction >

            <ejb-name>TaskSession</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            <container-transaction >

            <ejb-name>Task</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>
            <container-transaction >

            <ejb-name>TimeSheetSession</ejb-name>
            <method-name>*</method-name>

            <trans-attribute>Required</trans-attribute>
            </container-transaction>

            <!-- finder transactions -->
            </assembly-descriptor>

            </ejb-jar>

            • 3. Re: DatabaseServerLoginModule : principle=null after success
              Mike Pettit Newbie

              Hi -
              I am having a similar problem. principal=null. I am using a custom JAAS LoginModule (has to work on wl7 too).
              What does JBoss require to set/persist the principal?

              TIA,
              mp

              • 4. Re: DatabaseServerLoginModule : principle=null after success
                James Moring Newbie

                Your web.xml is missing references to the ejb it will call. I believe this is required to have the credentials sent from the servlet to the ejb.

                This article spells the whole process out:
                http://www.javaworld.com/javaworld/jw-08-2001/jw-0831-jaas.html?

                HTH

                • 5. Re: DatabaseServerLoginModule : principle=null after success
                  Shane Newbie

                  Tried this, but it does not work. I use the MVC pattern.

                  This is the process.
                  1. Try to access secure jsp page.
                  2. Login.jsp prompts for username and password.
                  3. Submit to j_security_check.
                  4. Authenticates.
                  5. ControllerServlet calls Delegate, which gets a home interface, which in turn calls the create to get a remote interface.
                  6. The necessary work is done and the specified jsp displays ! No problems.
                  7. Select a link on the above jsp.
                  8. ControllerServlet calls Delegate, which gets the same home interface, which in turn tries to call the same create method above, but fails with this error :

                  17:40:52,803 ERROR [SecurityInterceptor] Authentication exception, principal=null
                  17:40:52,813 ERROR [LogInterceptor] EJBException, causedBy:
                  java.lang.SecurityException: Authentication exception, principal=null
                  at org.jboss.ejb.plugins.SecurityInterceptor.checkSecurityAssociation(SecurityInterceptor.ja
                  va:173)
                  at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:94)
                  at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)

                  Any ideas ?
                  Cos I am starting to lose hope in getting this working and my company using JBoss.