2 Replies Latest reply on Aug 24, 2009 8:05 AM by Ales Justin

    AccessControlException in AnnotationValueImpl

    Kabir Khan Master

      I'm able to run the org.jboss.test.kernel.annotations.test.override.XXXOverrideXMLTestCase tests from the command-line, but when I try from my IDE I get the following exception. I'm not sure why it works in one environment and not the other. Flavia/Ales, can you please try this as well?

      org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/Users/kabir/sourcecontrol/kernel/trunk/subversion/kernel/target/test-classes/xml-test/org/jboss/test/kernel/annotations/test/override/testExternalOverride.xml@3,49
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:177)
       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:147)
       at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:147)
       at org.jboss.test.kernel.config.support.XMLUtil.<init>(XMLUtil.java:76)
       at org.jboss.test.kernel.config.test.AbstractKernelConfigTest.bootstrapXML(AbstractKernelConfigTest.java:74)
       at org.jboss.test.kernel.annotations.test.override.ExternalAnnotationOverrideXMLTestCase.getTester(ExternalAnnotationOverrideXMLTestCase.java:49)
       at org.jboss.test.kernel.annotations.test.override.ExternalAnnotationOverrideTestCase.testExternalOverride(ExternalAnnotationOverrideTestCase.java:90)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at junit.framework.TestCase.runTest(TestCase.java:168)
       at junit.framework.TestCase.runBare(TestCase.java:134)
       at junit.framework.TestResult$1.protect(TestResult.java:110)
       at junit.framework.TestResult.runProtected(TestResult.java:128)
       at junit.framework.TestResult.run(TestResult.java:113)
       at junit.framework.TestCase.run(TestCase.java:124)
       at junit.framework.TestSuite.runTest(TestSuite.java:232)
       at junit.framework.TestSuite.run(TestSuite.java:227)
       at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
       at junit.extensions.TestSetup$1.protect(TestSetup.java:23)
       at junit.framework.TestResult.runProtected(TestResult.java:128)
       at junit.extensions.TestSetup.run(TestSetup.java:27)
       at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
       at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
      at org.jboss.beans.metadata.plugins.AbstractBeanMetaData.installCallbacks
      at org.jboss.beans.metadata.plugins.AbstractClassLoaderMetaData.classLoader
      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployment.classLoader
      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployment
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.rethrowWithLocation(JBossXBNoSchemaBuilder.java:2079)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.createRootElementBinding(JBossXBNoSchemaBuilder.java:379)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.createRootElements(JBossXBNoSchemaBuilder.java:354)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.build(JBossXBNoSchemaBuilder.java:238)
       at org.jboss.xb.builder.JBossXBBuilder.build(JBossXBBuilder.java:291)
       at org.jboss.xb.builder.JBossXBBuilder.build(JBossXBBuilder.java:181)
       at org.jboss.xb.builder.JBossXBBuilder.build(JBossXBBuilder.java:160)
       at org.jboss.xb.binding.resolver.AbstractMutableSchemaResolver.resolve(AbstractMutableSchemaResolver.java:315)
       at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:277)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:401)
       at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
       at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
       at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
       at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:173)
       ... 29 more
      Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
       at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
       at java.security.AccessController.checkPermission(AccessController.java:427)
       at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
       at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
       at java.lang.Class.checkMemberAccess(Class.java:2125)
       at java.lang.Class.getDeclaredMethods(Class.java:1762)
       at sun.reflect.annotation.AnnotationInvocationHandler.getMemberMethods(AnnotationInvocationHandler.java:257)
       at sun.reflect.annotation.AnnotationInvocationHandler.equalsImpl(AnnotationInvocationHandler.java:169)
       at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:40)
       at $Proxy22.equals(Unknown Source)
       at org.jboss.reflect.plugins.AnnotationValueImpl.equals(AnnotationValueImpl.java:148)
       at java.util.HashMap.put(HashMap.java:422)
       at java.util.HashSet.add(HashSet.java:194)
       at org.jboss.beans.info.plugins.AbstractBeanInfoFactory.mergeAnnotations(AbstractBeanInfoFactory.java:352)
       at org.jboss.beans.info.plugins.AbstractBeanInfoFactory.getBeanProperties(AbstractBeanInfoFactory.java:311)
       at org.jboss.beans.info.plugins.AbstractBeanInfoFactory.getBeanInfo(AbstractBeanInfoFactory.java:157)
       at org.jboss.beans.info.plugins.AbstractBeanInfoFactory.getBeanInfo(AbstractBeanInfoFactory.java:124)
       at org.jboss.config.plugins.AbstractConfiguration.getBeanInfo(AbstractConfiguration.java:81)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateType(JBossXBNoSchemaBuilder.java:893)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:812)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:800)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateTypeBinding(JBossXBNoSchemaBuilder.java:556)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.resolveTypeBinding(JBossXBNoSchemaBuilder.java:515)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.bindProperty(JBossXBNoSchemaBuilder.java:1745)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateType(JBossXBNoSchemaBuilder.java:1179)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:812)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:800)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateTypeBinding(JBossXBNoSchemaBuilder.java:556)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.resolveTypeBinding(JBossXBNoSchemaBuilder.java:515)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.bindProperty(JBossXBNoSchemaBuilder.java:1745)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateType(JBossXBNoSchemaBuilder.java:1179)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:812)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:800)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateTypeBinding(JBossXBNoSchemaBuilder.java:556)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.resolveTypeBinding(JBossXBNoSchemaBuilder.java:515)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.bindProperty(JBossXBNoSchemaBuilder.java:1745)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateType(JBossXBNoSchemaBuilder.java:1179)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:812)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateBean(JBossXBNoSchemaBuilder.java:800)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.generateTypeBinding(JBossXBNoSchemaBuilder.java:556)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.resolveTypeBinding(JBossXBNoSchemaBuilder.java:515)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.createElementBinding(JBossXBNoSchemaBuilder.java:394)
       at org.jboss.xb.builder.JBossXBNoSchemaBuilder.createRootElementBinding(JBossXBNoSchemaBuilder.java:374)
       ... 49 more
      
      


        • 1. Re: AccessControlException in AnnotationValueImpl
          Flavia Rainone Master

          I'm having problems with setting up the kernel project at Eclipse.

          If I use jdk6, I get errors like this:
          Description Resource Path Location Type
          The method setAliasMetaData(Set) in the type AbstractBeanMetaData is not applicable for the arguments (Collection) AbstractBeanMetaData.java /jboss-kernel/src/main/java/org/jboss/beans/metadata/plugins line 866 Java Problem
          If I use jdk5, I get erros at AbstractBeanMetaData.clone() method like the ones below:
          Description Resource Path Location Type
          The method setAliasMetaData(Set) in the type AbstractBeanMetaData is not applicable for the arguments (Collection) AbstractBeanMetaData.java /jboss-kernel/src/main/java/org/jboss/beans/metadata/plugins line 866 Java Problem

          Apart from that, I can run the tests at command line as well.

          • 2. Re: AccessControlException in AnnotationValueImpl
            Ales Justin Master

            Yeah, I saw this problem as well - when I updated XB in Kernel to be more strict.
            I already have a TODO item somewhere.

            btw: this looks like a JDK bug, as it's the sun.reflect.annotation.AnnotationInvocationHandler who invokes this reflection method,
            hence they should be the one's wrapping that code block into privileged block,
            as all I do is call Annotation::equals, which is far from security hack attempt :-)