4 Replies Latest reply on Oct 25, 2004 3:56 PM by sunofra

    SecurityException in Duke's Bank example

    rallar

      Hi,

      I have checked it for several times now and I think I did everything right so far. But I cannot manage to logon to the application. Everytime I do so with the credentials from 'users.properties' an exception is thrown like this:

      EJBException in method: public abstract com.sun.ebank.ejb.customer.CustomerController com.sun.ebank.ejb.customer.CustomerControllerHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException,
      causedBy:
      java.lang.SecurityException: Authentication exception, principal=null


      I am running JBoss4 and using the j2eetutorial14. The database is up and running and the application deploys without any exceptions. These are the steps I've made:

      1. Added the security-domain to both jboss.xml and jboss-web.xml
      2. Added an entry to the conf/login.xml file for the dukesbank security domain
      3. users.properties and roles.properties are inside of the EAR file
      4. Repackaged, reassambled and redeployed the EAR file

      Is anybody out there who has encountered the same/a similar problem and has a clue how to fix it?

      Any help appriciated. TIA

        • 1. Re: SecurityException in Duke's Bank example
          rallar

          Okay I found a solution. This problem was already posted as a bug on sourceforge (#1040200) and is resolved in JBoss 4.0.1RC1. There is also a description for a temporary workaround which works fine.

          • 2. Re: SecurityException in Duke's Bank example
            myibingbb

            Hi,
            I did exactly the same things as you did after adding the security-domain, but an exception that is slightly different from yours occurred when I managed to logon to the application :

            -----------
            Your request cannot be completed. The server got the following error:
            javax.servlet.jsp.JspTagException: javax.servlet.jsp.el.ELException: An error occurred while getting property "accounts" from an instance of class com.sun.ebank.web.CustomerBean
            ----------

            Unfortunately, the bug posted on sourceforge (#1040200) is no longer existed. I would like to know if replacing JBoss-4.0.0 with JBoss-4.0.1RC1 is the only solution to the problem?

            Any suggestions are appreciated!

            Yibing

            • 3. Re: SecurityException in Duke's Bank example
              breaston

              myibingbb,
              You can look at the sourceforge bug here:
              1040200

              • 4. Re: SecurityException in Duke's Bank example
                sunofra

                I looked at the sourceforge bug and got this to work for me for the web-app.
                I'm wondering how I can add authentication ability like this to the app-client. Can someone point me in the right direction?
                I guess I'm wondering if there is some default LoginDialog in the client jars that can be made to pop up when authentication is needed. Or if not, where/how do I provide code for my own login dialog.

                Thanks!