3 Replies Latest reply on Jun 1, 2012 5:22 AM by Hubert Cumberdale

    EJBAccessException: Invalid User

    Hubert Cumberdale Newbie

      Hi, I'm trying to get authentication to work but it fails with javax.ejb.EJBAccessException: JBAS013323: Invalid User. For a start I try not logging in but using unauthenticatedIdentity. When I then call a method from the security domain I get the error. Eclipse is configured to use standalone-full.xml where I have:


      <subsystem xmlns="urn:jboss:domain:security:1.1">



          <security-domain name="SomeDomain" cache-type="default">


              <login-module code="Database" flag="required">

                <module-option name="dsJndiName" value="java:jboss/datasources/SomeDS"/>

                <module-option name="principalsQuery" value="SELECT password FROM Customer WHERE username=?"/>

                <module-option name="rolesQuery" value="SELECT rolename, 'Roles' FROM Role WHERE username=?"/>

                <module-option name="unauthenticatedIdentity" value="guest"/>







      The data source is specified again in standalone-full.xml with:


      <subsystem xmlns="urn:jboss:domain:datasources:1.0">


          <datasource jta="true" jndi-name="java:jboss/datasources/SomeDS" pool-name="SomeDS_Pool">









            <driver name="h2" module="com.h2database.h2">







      In the Role table I have a dataset (guest, customer).


      The bean that I access from the client looks like:




      public class SomeBean implements SomeRemote, SomeLocal { .. }


      The methods don't have annotations.


      I read in a book that the message "Invalid User" is typical if the data base tables are not found, but when I connect to the database with the connection url from standalone-config.xml I can see them.


      I'm using Jboss AS 7.1, EJB 3.1 and for security the three jars from picketbox + jboss-ejb3-ext-api-1.1.1.jar for the SecurityDomain annotation


      Edit: Problem solved I didn't add the security domain to the application realm