Privileged blocks
adrian.brock Jun 26, 2006 4:39 AMI got the microcontainer tests working in both weaved and
unweaved configurations.
This involved fixing some access control problems in AOP.
These tests won't excercise the AOP issues too much since
there are no advices applied in these tests.
If I enable a security manager for all the aop-mc tests
src/main/org.jboss.aop.microcontainer.junit.AOPMicrocontainerTest: public static AbstractTestDelegate getDelegate(Class clazz) throws Exception { AOPMicrocontainerTestDelegate delegate = new AOPMicrocontainerTestDelegate(clazz); delegate.enableSecurity = true; return delegate; }
Then I see some more access problems, e.g.
4387 ERROR [AbstractKernelController] Error installing to Described: name=Intercepted state=Not Installed java.lang.RuntimeException: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers) at org.jboss.aop.advice.AdviceFactory.create(AdviceFactory.java:72) at org.jboss.aop.Advisor.createInterceptorChain(Advisor.java:649) at org.jboss.aop.Advisor.pointcutResolved(Advisor.java:935) at org.jboss.aop.Advisor.resolveConstructorPointcut(Advisor.java:888) at org.jboss.aop.ClassContainer.createInterceptorChains(ClassContainer.java:251) at org.jboss.aop.ClassContainer.rebuildInterceptors(ClassContainer.java:121) at org.jboss.aop.ClassContainer.initializeClassContainer(ClassContainer.java:58) at org.jboss.aop.proxy.container.ClassProxyContainer.initialise(ClassProxyContainer.java:182) at org.jboss.aop.proxy.container.InstanceProxyContainer.<init>(InstanceProxyContainer.java:56) at org.jboss.aop.proxy.container.InstanceProxyContainer.createInstanceProxyContainer(InstanceProxyContainer.java:67) at org.jboss.aop.proxy.container.ContainerCache.initInstanceContainer(ContainerCache.java:246) at org.jboss.aop.proxy.container.ContainerCache.initialise(ContainerCache.java:77) at org.jboss.aop.proxy.container.ContainerCache.initialise(ContainerCache.java:68) at org.jboss.aop.microcontainer.integration.AOPDependencyBuilder.getDependencies(AOPDependencyBuilder.java:81) at org.jboss.classadapter.plugins.BasicClassAdapter.getDependencies(BasicClassAdapter.java:79) at org.jboss.beans.info.plugins.AbstractBeanInfo.getDependencies(AbstractBeanInfo.java:135) at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$DescribeAction.installAction(KernelControllerContextActions.java:265) at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction$1.run(KernelControllerContextActions.java:185) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.kernel.plugins.dependency.KernelControllerContextActions$KernelControllerContextAction.install(KernelControllerContextActions.java:208) at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:226)