Tuscany
  1. Tuscany
  2. TUSCANY-3992

AccessControlException occurs when calling SCAClientFactory.getService

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Java-SCA-2.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      If a Java2 security manager is active, an application's call to SCAClientFactory.getService() may fail with an AccessControlException.

      java.security.AccessControlException: Access denied (java.lang.RuntimePermission accessDeclaredMembers)
      at java.security.AccessController.checkPermission(AccessController.java:108)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:544)
      at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1689)
      at java.lang.Class.checkMemberAccess(Class.java:107)
      at java.lang.Class.getDeclaredMethods(Class.java:675)
      at org.apache.tuscany.sca.interfacedef.java.impl.JavaIntrospectionHelper.getMethods(JavaIntrospectionHelper.java:621)
      at org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceIntrospectorImpl.introspectInterface(JavaInterfaceIntrospectorImpl.java:150)
      at org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceFactoryImpl.createJavaInterface(JavaInterfaceFactoryImpl.java:80)
      at org.apache.tuscany.sca.interfacedef.java.impl.JavaInterfaceFactoryImpl.createJavaInterface(JavaInterfaceFactoryImpl.java:56)
      at org.apache.tuscany.sca.core.context.impl.ComponentContextImpl.getInterfaceContract(ComponentContextImpl.java:472)
      at org.apache.tuscany.sca.core.context.impl.ComponentContextImpl.createEndpointReference(ComponentContextImpl.java:423)
      at org.apache.tuscany.sca.core.context.impl.ComponentContextImpl.createEndpointReference(ComponentContextImpl.java:399)
      at org.apache.tuscany.sca.core.context.impl.ComponentContextImpl.createSelfReference(ComponentContextImpl.java:300)
      at org.apache.tuscany.sca.core.context.impl.ComponentContextImpl.createSelfReference(ComponentContextImpl.java:254)
      at org.apache.tuscany.sca.core.assembly.impl.RuntimeComponentImpl.getServiceReference(RuntimeComponentImpl.java:134)
      at org.apache.tuscany.sca.client.impl.SCAClientFactoryImpl.getService(SCAClientFactoryImpl.java:98)

      I have attached a patch that resolves the problem.

      1. TUSCANY-3992.patch
        6 kB
        Greg Dritschler

        Activity

        Hide
        ant elder added a comment -

        Patch applied, thanks for the fix Greg.

        Show
        ant elder added a comment - Patch applied, thanks for the fix Greg.

          People

          • Assignee:
            Unassigned
            Reporter:
            Greg Dritschler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development