Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 63143 invoked from network); 2 Dec 2010 16:27:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Dec 2010 16:27:26 -0000 Received: (qmail 77234 invoked by uid 500); 2 Dec 2010 16:27:25 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 77147 invoked by uid 500); 2 Dec 2010 16:27:24 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 77140 invoked by uid 99); 2 Dec 2010 16:27:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 16:27:23 +0000 X-ASF-Spam-Status: No, hits=2.3 required=10.0 tests=FREEMAIL_FROM,RFC_ABUSE_POST,SPF_HELO_PASS,SPF_SOFTFAIL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (nike.apache.org: transitioning domain of yellowb@hotmail.fr does not designate 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Dec 2010 16:27:17 +0000 Received: from ben.nabble.com ([192.168.236.152]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1POBzk-0001kp-FV for user@geronimo.apache.org; Thu, 02 Dec 2010 08:26:56 -0800 Date: Thu, 2 Dec 2010 08:26:56 -0800 (PST) From: yellowb To: user@geronimo.apache.org Message-ID: <1291307216454-2006827.post@n3.nabble.com> Subject: javax.ejb.EJBAccessException - Unauthorized Access by Principal Denied MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm trying to use authenticated remote ejb but it always fails with the exception javax.ejb.EJBAccessException - Unauthorized Access by Principal Denied I've been browsing the web alot but I didn't found a solution. i'm using Geronimo 2.1.7 here is the bean : @Stateless @DeclareRoles({"admin"}) @RolesAllowed({"admin"}) public class UserBean implements UserBeanRemote, UserBeanLocal { public UserBean() { } public String getName() { return "plout" ; } } Here is the client : public class User { private String name=""; public String getName() { return name ; } public void setName(String name) { String n = ""; try { Properties prop = new Properties(); prop.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory"); prop.put("java.naming.provider.url", "ejbd://localhost:4201"); Context ctx= new InitialContext(prop); prop.setProperty("openejb.authentication.realmName", "geronimo-admin"); prop.setProperty("java.naming.security.principal", "system"); prop.setProperty("java.naming.security.credentials", "manager"); UserBeanRemote u1=(UserBeanRemote)ctx.lookup("UserBeanRemote"); n = u1.getName(); } catch (NamingException ne) { System.out.println(ne.toString()); } this.name = n ; } } Here is the openejb-jar.xml : default pkb-ejb 1.0 car Do you know where the problem come from or where I can find a good documentation ? Thanks -- View this message in context: http://apache-geronimo.328035.n3.nabble.com/javax-ejb-EJBAccessException-Unauthorized-Access-by-Principal-Denied-tp2006827p2006827.html Sent from the Users mailing list archive at Nabble.com.