Hi, we have problems by accessing secured EJBs, running on Sun Application Server 9 Update 1. In our scenario we have a Statless Session Bean: @Stateless(mappedName=SecurityRemote.LOOKUP_SECURITYREMOTE) @Remote(SecurityRemote.class) public class SecurityBean implements SecurityRemote { public String allAllowed() { return "All Allowed";} @RolesAllowed("admin") public String onlyAdmin() {return "Admin";} @PermitAll public String onlyLoggedIn() { return "logged in"; } @RolesAllowed("user") public String onlyUser() { return "user"; } @DenyAll public String denyAll() {return "deny all"; } } The Bean is packaged with following xml - File in Meta-Inf Dir: sun-ejb-jar.xml: <!--?xml version="1.0" encoding="UTF-8"?--> admin admin user user TO access the bean we use this standalone client: public class SecurityContextTest { public class MyCallBackHandler implements CallbackHandler{ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { for(int i = 0; i < callbacks.length; ++i){ if(callbacks[i] instanceof NameCallback){ NameCallback nc = (NameCallback) callbacks[i]; System.out.print(nc.getPrompt()); nc.setName(new BufferedReader(new InputStreamReader(System.in)).readLine().toString()); } if(callbacks[i] instanceof PasswordCallback){ PasswordCallback pc = (PasswordCallback) callbacks[i]; System.out.print(pc.getPrompt()); pc.setPassword(new BufferedReader(new InputStreamReader(System.in)).readLine().toCharArray()); } } } } public static void main(String[] args) throws Exception{ LoginContext ctx = new LoginContext("default",new SecurityContextTest().new MyCallBackHandler()); ctx.login(); InitialContext cx = new InitialContext(); Object ref = cx.lookup(SecurityRemote.class.getName()); SecurityRemote session = (SecurityRemote)PortableRemoteObject.narrow(ref,SecurityRemote.class); } } To run this client following vm parameters are passed: -Djava.security.auth.login.config=\lib\appclient\appclientlogin.conf -Djava.security.policy=\lib\appclient\client.policy appclientlogin.conf: default { com.sun.enterprise.security.auth.login.ClientPasswordLoginModule required debug=false; }; certificate { com.sun.enterprise.security.auth.login.ClientCertificateLoginModule required debug=false; }; simpleCustomRealm { de.fhzw.jamazon.security.database.JAmazonLoginModule required; }; client.ploicy is the default from server While obtaining the session bean following Exception occurs: Exception in thread "main" javax.naming.NamingException: ejb ref resolution error for remote business interfacede.fhzw.jamazon.security.SecurityRemote [Root exception is java.rmi.AccessException: CORBA NO_PERMISSION 0 No; nested exception is: org.omg.CORBA.NO_PERMISSION: ----------BEGIN server-side stack trace---------- org.omg.CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: No at com.sun.enterprise.iiop.security.SecServerRequestInterceptor.receive_request(SecServerRequestInterceptor.java:420) at com.sun.corba.ee.impl.interceptors.InterceptorInvoker.invokeServerInterceptorIntermediatePoint(InterceptorInvoker.java:509) at com.sun.corba.ee.impl.interceptors.PIHandlerImpl.invokeServerPIIntermediatePoint(PIHandlerImpl.java:504) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.getServantWithPI(CorbaServerRequestDispatcherImpl.java:369) at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:190) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947) at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178) at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473) at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270) at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479) ... many more Can anyone help me to fix this problem? Many thanks in advance.