Problem solved: the login must be done over the 
org.jboss.security.client.SecurityClient

public class SecureClient {
        public static void main(String[] args) {
                Context ctx;
                try {
                        SecurityClient securityClient = 
SecurityClientFactory.getSecurityClient();
                        securityClient.setSimple("admin", "adminpas");
                        securityClient.login();
                        ctx = new InitialContext();
                        Secure bean = (Secure)ctx.lookup("SecureBean/remote");
                        System.out.println(bean.forUsers());
                } catch (NamingException e) {
                        e.printStackTrace();
                } catch (EJBAccessException e){
                        System.out.println("Nicht berechtigt");
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }
}

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232881#4232881

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232881
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to