Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-6715445

Since jdk7 b15 -Djavatest.security.allowPropertiesAccess=true needed under Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • jt4.2
    • jt4.1.3
    • tools
    • b07
    • generic
    • windows
    • Verified

      JCK6b documentation states:
      " The JavaTest harness security manager denies access to system properties even for the product API under test. This can affect test execution in the single-VM environment or execution of distributed tests (the passive agent for distributed tests also executes a remote test component in single-VM mode).

      To run tests for an API that requires access to system properties, you must start the JavaTest harness agent with the javatest.security.allowPropertiesAccess property set to true. You are not required to set this property for the JavaTest harness agent if you are running tests in multi-VM mode with an agent.

      For example, if you run the JMX Remote API tests (tests for the javax.management.remote API) on Sun's reference runtime in single-VM mode the following VM option must be specified for both VMs running the JavaTest harness agent and the passive agent for distributed tests:
      -Djavatest.security.allowPropertiesAccess=true

      If you run the same tests in multi-VM mode set this option only for the passive agent. "

      But since jdk 7 b15 not only JavaTest harness agent, but also JavaTest harness itself needs "-Djavatest.security.allowPropertiesAccess=true" supplied to start testrun under Windows.
      This applies both to JCK6a and JCK6b.

      Steps to reproduce:
      1. Install jdk 7 any build above 14.
      2. Install JCK 6b.
      3. Start JavaTest harness GUI
      4. As usual, create configuration for runtine testrun.
       4.1 Select any tests.
       4.2 Create “Single VM With an Agent” environment.
       4.3 Select active agent.
      5. Go to "Tools" menu and open "Agent Monitor"
      6. Select "Listening" checkbox.
      7. Exception occures and stack trace will be printed:
      Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
      at java.net.ServerSocket.setImpl(ServerSocket.java:272)
      at java.net.ServerSocket.<init>(ServerSocket.java:213)
      at java.net.ServerSocket.<init>(ServerSocket.java:119)
      at com.sun.javatest.agent.ActiveAgentPool.setListening(ActiveAgentPool.java:493)
      at com.sun.javatest.agent.AgentMonitorTool$AgentPoolSubpanel.itemStateChanged(AgentMonitorTool.java:234)
      at javax.swing.AbstractButton.fireItemStateChanged(AbstractButton.java:2043)
      at javax.swing.AbstractButton$Handler.itemStateChanged(AbstractButton.java:2345)
      at javax.swing.DefaultButtonModel.fireItemStateChanged(DefaultButtonModel.java:457)
      at javax.swing.JToggleButton$ToggleButtonModel.setSelected(JToggleButton.java:272)
      at javax.swing.JToggleButton$ToggleButtonModel.setPressed(JToggleButton.java:289)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:253)
      at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
      at java.awt.Component.processMouseEvent(Component.java:6117)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3293)
      at java.awt.Component.processEvent(Component.java:5882)
      at java.awt.Container.processEvent(Container.java:2101)
      at java.awt.Component.dispatchEventImpl(Component.java:4477)
      at java.awt.Container.dispatchEventImpl(Container.java:2159)
      at java.awt.Component.dispatchEvent(Component.java:4303)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4595)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4258)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4188)
      at java.awt.Container.dispatchEventImpl(Container.java:2145)
      at java.awt.Window.dispatchEventImpl(Window.java:2559)
      at java.awt.Component.dispatchEvent(Component.java:4303)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:604)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
      Caused by: java.lang.SecurityException: Action forbidden by JavaTest Harness: checkPropertiesAccess
      at com.sun.javatest.JavaTestSecurityManager.checkPropertiesAccess(JavaTestSecurityManager.java:135)
      at java.lang.System.getProperties(System.java:618)
      at java.net.PlainSocketImpl$1.run(PlainSocketImpl.java:62)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.PlainSocketImpl.<clinit>(PlainSocketImpl.java:58)
      ... 32 more

      When you start javatest harness from comand line - stack trace is shorter:
      java.lang.ExceptionInInitializerError
              at java.net.ServerSocket.setImpl(ServerSocket.java:272)
              at java.net.ServerSocket.<init>(ServerSocket.java:214)
              at java.net.ServerSocket.<init>(ServerSocket.java:120)
              at com.sun.javatest.agent.ActiveAgentPool.setListening(ActiveAgentPool.java:493)
              at com.sun.javatest.agent.AgentMonitorCommandManager$StartAgentPoolCommand.run(AgentMonitorCommandManager.java:183)
              at com.sun.javatest.tool.CommandContext.runCommands(CommandContext.java:175)
              at com.sun.javatest.tool.Main.run(Main.java:384)
              at com.sun.javatest.tool.Main.main0(Main.java:140)
              at com.sun.javatest.tool.Main.main(Main.java:120)
      Caused by: java.lang.SecurityException: Action forbidden by JavaTest Harness: checkPropertiesAccess
              at com.sun.javatest.JavaTestSecurityManager.checkPropertiesAccess(JavaTestSecurityManager.java:135)
              at java.lang.System.getProperties(System.java:619)
              at java.net.PlainSocketImpl$1.run(PlainSocketImpl.java:63)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.PlainSocketImpl.<clinit>(PlainSocketImpl.java:59)
              ... 9 more

      Workaround - supply "-Djavatest.security.allowPropertiesAccess=true" option to the vm running javatest harness.

            dfazunen Dmitry Fazunenko (Inactive)
            ephilipp Evgeny Philippov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: