0 Replies Latest reply on Jan 27, 2010 2:57 AM by veronica wang

    How to grant java permission to vfsmemory dynamic codesources

    veronica wang Newbie

      Steps to reproduce:

       

      1. Deploy an simple Session bean, with an ejb method that invoke AccessController.checkPermission(SomePermission)
      2. Invoke this EJB method via org.jboss.security.client.SecurityClient.

       

      This checkPermission always fails because it needs a dynamic codesources like "vfsmemory://3w2f44s-kr29e9-g4ax5wao-1-g4ax6882-7"
      being granted permissions. Howerver, whaterver I grant, like "vfsmemory://-", it doesn't work. How to grant permission to vfsmemory dynamic codesources and how's the dynamic directory corresponding to specific classes?

       

      ==================

      Failed protection domain

      ==================

      Failed ProtectionDomain:
                                     
      CodeSource=vfsmemory://3w2f44s-b1kjmu-g4axpkuh-1-g4axpwhp-7                              
                                  
      Permissions=(                               
      (java.util.PropertyPermission line.separator read)                               
      (java.util.PropertyPermission java.vm.version read)                               
      (java.util.PropertyPermission java.vm.specification.version read)                               
      (java.util.PropertyPermission java.vm.specification.vendor read)                               
      (java.util.PropertyPermission java.vendor.url read)                               
      (java.util.PropertyPermission java.vm.name read)                               
      (java.util.PropertyPermission os.name read)                               
      (java.util.PropertyPermission java.vm.vendor read)                               
      (java.util.PropertyPermission path.separator read)                               
      (java.util.PropertyPermission java.specification.name read)                               
      (java.util.PropertyPermission os.version read)                               
      (java.util.PropertyPermission os.arch read)                               
      (java.util.PropertyPermission java.class.version read)                               
      (java.util.PropertyPermission java.version read)                               
      (java.util.PropertyPermission file.separator read)                               
      (java.util.PropertyPermission java.vendor read)                               
      (java.util.PropertyPermission java.vm.specification.name read)                               
      (java.util.PropertyPermission java.specification.version read)                               
      (java.util.PropertyPermission java.specification.vendor read)                               
      (java.lang.RuntimePermission stopThread)                               
      (java.net.SocketPermission localhost:1024- listen,resolve)                               
      (java.net.SocketPermission localhost:1024- listen,resolve)                               
      )

       

      ==================

      The call stack is follows:

      ==================

      Call Stack:          
      java.security.AccessControlException: access denied (java.util.PropertyPermission myPermission read)                                
      java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)                                
      java.security.AccessController.checkPermission(AccessController.java:546)                                
      oracle.security.jps.util.JpsAuth$AuthorizationMechanism$3.checkPermission(JpsAuth.java:360)                                
      oracle.security.jps.util.JpsAuth$Diagnostic.checkPermission(JpsAuth.java:281)                                
      oracle.security.jps.util.JpsAuth$AuthorizationMechanism$6.checkPermission(JpsAuth.java:384)                                
      oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:420)                                
      oracle.security.jps.util.JpsAuth.checkPermission(JpsAuth.java:442)                                
      oracle.security.jps.ejb.HelloBean.sayHello(HelloBean.java:100)                                
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)                                
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)                                
      java.lang.reflect.Method.invoke(Method.java:597)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)                                
      org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)                                
      org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor$InvocationContext.proceed(InvocationContextInterceptor.java:138)                                
      oracle.security.jps.ee.ejb.JpsAbsInterceptor$1.run(JpsAbsInterceptor.java:88)                                
      java.security.AccessController.doPrivileged(Native Method)                                
      oracle.security.jps.util.JpsSubject.doAs(JpsSubject.java:206)                                
      oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:407)                                
      oracle.security.jps.jboss.JpsJBossEjbInterceptor.runJaasMode(JpsJBossEjbInterceptor.java:58)                                
      oracle.security.jps.ee.ejb.JpsAbsInterceptor.intercept(JpsAbsInterceptor.java:106)                                
      oracle.security.jps.ee.ejb.JpsInterceptor.intercept(JpsInterceptor.java:105)                                
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)                                
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)                                
      java.lang.reflect.Method.invoke(Method.java:597)                                
      org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:83)                                
      org.jboss.ejb3.interceptors.aop.EJB3InterceptorInterceptor.invoke(EJB3InterceptorInterceptor.java:70)                                
      org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:59)                                
      org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)                                
      org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)                                
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)                                
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)                                
      java.lang.reflect.Method.invoke(Method.java:597)                                
      org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)                                
      org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_23747531.invoke(InvocationContextInterceptor_z_fillMethod_23747531.java)                          
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)                                
      org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_23747531.invoke(InvocationContextInterceptor_z_setup_23747531.java)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)                                
      org.jboss.aspects.tx.TxInterceptor$Supports.invoke(TxInterceptor.java:143)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.security.RunAsSecurityInterceptorv2.invoke(RunAsSecurityInterceptorv2.java:94)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.security.RoleBasedAuthorizationInterceptorv2.invoke(RoleBasedAuthorizationInterceptorv2.java:201)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)                                
      org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)                                
      org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:421)                                
      org.jboss.ejb3.session.InvokableContextClassProxyHack._dynamicInvoke(InvokableContextClassProxyHack.java:53)                                
      org.jboss.aop.Dispatcher.invoke(Dispatcher.java:91)                                
      org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)                                
      org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:891)                                
      org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:744)                                
      org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:697)                                
      org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:524)                                
      org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:232)